CN108307206A - A kind of distribution method and device of live streaming encoding tasks - Google Patents
A kind of distribution method and device of live streaming encoding tasks Download PDFInfo
- Publication number
- CN108307206A CN108307206A CN201711424396.2A CN201711424396A CN108307206A CN 108307206 A CN108307206 A CN 108307206A CN 201711424396 A CN201711424396 A CN 201711424396A CN 108307206 A CN108307206 A CN 108307206A
- Authority
- CN
- China
- Prior art keywords
- weighted value
- load weighted
- server
- encoding tasks
- servers
- 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
Links
- 238000009826 distribution Methods 0.000 title claims abstract description 79
- 238000000034 method Methods 0.000 title claims abstract description 53
- 238000012544 monitoring process Methods 0.000 claims description 22
- 230000005540 biological transmission Effects 0.000 claims description 5
- 238000010586 diagram Methods 0.000 description 14
- 238000012545 processing Methods 0.000 description 7
- 238000004590 computer program Methods 0.000 description 6
- 230000008569 process Effects 0.000 description 5
- 230000006978 adaptation Effects 0.000 description 4
- 230000005658 nuclear physics Effects 0.000 description 4
- 238000003860 storage Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 238000013507 mapping Methods 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 230000014759 maintenance of location Effects 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 238000012163 sequencing technique Methods 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 230000002860 competitive effect Effects 0.000 description 1
- 238000000205 computational method Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/24—Monitoring of processes or resources, e.g. monitoring of server load, available bandwidth, upstream requests
- H04N21/2405—Monitoring of the internal components or processes of the server, e.g. server load
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/234—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
- H04N21/2343—Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- General Engineering & Computer Science (AREA)
- Information Transfer Between Computers (AREA)
Abstract
An embodiment of the present invention provides it is a kind of live streaming encoding tasks distribution method and device, the method includes:Receive the encoding tasks that code stream manager is sent;Determine the encoding tasks weighted value of the encoding tasks;Obtain the maximum load weighted value of all kinds of servers and corresponding present load weighted value in server cluster;The disposable load weighted value of Servers-all is determined according to the maximum load weighted value and present load weighted value;Select the maximum server of disposable load weighted value as destination server from the disposable load weighted value of Servers-all;The encoding tasks weighted value is distributed into the destination server.The embodiment of the present invention dynamically distributes encoding tasks according to load weight limit value and the weighted value of present load dynamic, solves the problems, such as encoding tasks unreasonable distribution in the prior art, improves the computational efficiency of server.
Description
Technical field
The present invention relates to coding techniques fields, more particularly to a kind of distribution method and device of live streaming encoding tasks.
Background technology
Current internet video live broadcasting (such as party grand ceremony, concert, competitive sports, commercial distribution, show field live streaming, game
Live streaming etc.) background framework, all there are the processing links of live streaming coding.Live streaming coding refer to download video flowing (such as ts streams,
Rtmp streams or capture card etc.) server end is arrived, video flowing is compressed and is converted code check by server end, for example, by single code
Rate generates code checks such as 1080p, 720p etc..In essence, encoding tasks are exactly that a kind of higher calculate of requirement of real-time is appointed
Business.
Currently, what existing encoding tasks took is a kind of calculating task scheduling mode of static state, exactly by high code check
Calculating task is dispatched to the higher server of CPU core number, and the calculating task of low bit- rate is dispatched to the lower service of CPU core number
Device.But in practical applications, the computing capability of every server is not only related with the CPU core number of its server, also with real-time
Load condition it is related.If the higher server of check figure, load it is also higher, computing capability may might as well load compared with
Server low, check figure is relatively low, so as to cause encoding tasks unreasonable distribution, the coding for reducing server calculates effect
Rate.
Therefore, how reasonably encoding tasks to be assigned on server, is to have technical problem to be solved at present.
Invention content
The embodiment of the present invention is the technical problem to be solved is that a kind of distribution method of live streaming encoding tasks is provided, to solve
In the prior art to encoding tasks unreasonable distribution, cause to encode the technical issues of computational efficiency reduces.
Correspondingly, the embodiment of the present invention additionally provides a kind of distributor of live streaming encoding tasks, to ensure above-mentioned side
The realization and application of method.
To solve the above-mentioned problems, the present invention is achieved through the following technical solutions:
First aspect provides a kind of distribution method of live streaming encoding tasks, the method includes:
Receive the encoding tasks that code stream manager is sent;
Determine the encoding tasks weighted value of the encoding tasks;
Obtain the maximum load weighted value of all kinds of servers and corresponding present load weighted value in server cluster;
The disposable load weighted value of Servers-all is determined according to the maximum load weighted value and present load weighted value;
Select the maximum server of disposable load weighted value as target from the disposable load weighted value of Servers-all
Server;
The encoding tasks weighted value is distributed into the destination server.
Optionally, described that the available of Servers-all is determined according to the maximum load weighted value and present load weighted value
Loading weighted value includes:
The difference for calculating the maximum load weighted value and present load weighted value, obtains the disposable load of Servers-all
Weighted value.
Optionally, the method further includes:
The maximum load weighted value and the corresponding encoding tasks weighted value of various code checks of all kinds of servers are set.
Optionally, after the encoding tasks weighted value being distributed to the destination server, the method further includes:
In weight distribution table, the present load weighted value of the destination server is added into the encoding tasks weight
Value, to update the present load weighted value of destination server described in weight distribution table.
Optionally, the method further includes:
After monitoring that the destination server completes the encoding tasks, by the coding in the weight distribution table
Task weight value is subtracted from the present load weighted value of the destination server, to update the clothes of target described in weight distribution table
The present load weighted value of business device.
Optionally, the method further includes:
Monitor the CPU usage of all kinds of servers;
Judge whether the CPU usage of all kinds of servers in preset time is more than first threshold;
Then it is more than the load of the server of first threshold by CPU usage when the CPU usage is more than first threshold
Weighted value is offline from weight distribution table.
Optionally, the method further includes:
Monitor the CPU usage of the offline server from the weight distribution table;
Judge whether the CPU usage of the offline server is less than second threshold;
When the CPU usage is less than second threshold, by the load weighted value of the offline server in the power
It reaches the standard grade in reassignment table.
Second aspect provides the distributor of a kind live streaming encoding tasks, and described device includes:
Receiving unit, the encoding tasks for receiving the transmission of code stream manager;
First determination unit, the encoding tasks weighted value for determining the encoding tasks;
Acquiring unit, maximum load weighted value for obtaining all kinds of servers in server cluster and corresponding current negative
Carry weighted value;
Second determination unit, for determining Servers-all according to the maximum load weighted value and present load weighted value
Disposable load weighted value;
Selecting unit, for selecting the maximum clothes of disposable load weighted value from the disposable load weighted value of Servers-all
Device be engaged in as destination server;
Allocation unit, for the encoding tasks weighted value to be distributed to the destination server.
Optionally, second determination unit is specifically used for calculating the maximum load weighted value and present load weight
The difference of value obtains the disposable load weighted value of Servers-all.
Optionally, described device further includes:
Setting unit, the maximum load weighted value for presetting all kinds of servers and the corresponding volume of various code checks
Code task weight value.
Optionally, described device further includes:
Updating unit, for the encoding tasks weighted value to be distributed to the destination server in the allocation unit
Afterwards, in weight distribution table, the present load weighted value of the destination server is added into the encoding tasks weighted value, with more
The present load weighted value of destination server described in new weight distribution table.
Optionally, the updating unit is additionally operable to after monitoring that the destination server completes the encoding tasks,
The encoding tasks weighted value is subtracted from the present load weighted value of the destination server in the weight distribution table, with
Update the present load weighted value of destination server described in weight distribution table.
Optionally, described device further includes:
First monitoring unit, the CPU usage for monitoring all kinds of servers;
First judging unit, for judging whether the CPU usage of all kinds of servers in preset time is more than threshold value;
Offline unit, for when first judging unit judges that the CPU usage is more than threshold value, CPU to be used
Rate is more than that the load weighted value of the server of threshold value is offline from weight distribution table.
Optionally, described device further includes:
Second monitoring unit, the CPU usage for monitoring the offline server from the weight distribution table;
Second judgment unit, for judging whether the CPU usage of the offline server is less than threshold value;
It reaches the standard grade unit, for judging that the CPU usage of offline server is less than threshold in the second judgment unit
When value, the load weighted value of the server is reached the standard grade in the weight distribution table.
Compared with prior art, the embodiment of the present invention includes following advantages:
In the embodiment of the present invention, when receiving encoding tasks, according to the maximum load weighted value of server and corresponding
Present load weighted value calculates the disposable load weighted value of Servers-all, then by the corresponding encoding tasks weight of encoding tasks
Value distributes to the maximum server of present load weighted value.That is, the embodiment of the present invention according to load weight limit value and
The weighted value dynamic of present load dynamically distributes encoding tasks, solves encoding tasks unreasonable distribution in the prior art
Problem improves the coding computational efficiency of server.
It should be understood that above general description and following detailed description is only exemplary and explanatory, not
The application can be limited.
Description of the drawings
Fig. 1 is a kind of flow chart of the distribution method of live streaming encoding tasks provided in an embodiment of the present invention;
Fig. 2 is a kind of another flow chart of the distribution method of live streaming encoding tasks provided in an embodiment of the present invention;
Fig. 3 is a kind of another flow chart of the distribution method of live streaming encoding tasks provided in an embodiment of the present invention;
Fig. 4 is a kind of structural schematic diagram of the distributor of live streaming encoding tasks provided in an embodiment of the present invention;
Fig. 5 is a kind of another structural schematic diagram of the distributor of live streaming encoding tasks provided in an embodiment of the present invention;
Fig. 6 is a kind of another structural schematic diagram of the distributor of live streaming encoding tasks provided in an embodiment of the present invention;
Fig. 7 is a kind of another structural schematic diagram of the distributor of live streaming encoding tasks provided in an embodiment of the present invention;
Fig. 8 is a kind of structural schematic diagram of the distribution system of live streaming encoding tasks provided in an embodiment of the present invention.
Specific implementation mode
In order to make the foregoing objectives, features and advantages of the present invention clearer and more comprehensible, below in conjunction with the accompanying drawings and specific real
Applying mode, the present invention is described in further detail.
Referring to Fig. 1, for a kind of flow chart of the distribution method of live streaming encoding tasks provided in an embodiment of the present invention, specifically
It may include steps of:
Step 101:Receive the encoding tasks that code stream manager is sent;
In the step, distributing center server receives the encoding tasks that code stream manager is sent, which is exactly one
The coding of a code stream is thought, can also be the encoding tasks of multiple code streams, and each code stream can correspond to an encoding tasks.Wherein
Code stream such as 720p, high definition etc..That is, code stream manager is encoded into one kind after receiving primary flow, by source code flow
Or the encoding tasks of a variety of code streams, and the encoding tasks are exported and give distributing center server.
Assuming that some primary flow, is denoted as S, it is determined that source code flow is encoded into two kinds of code stream outputs, respectively 720p
And high definition, then this cataloged procedure is really two encoding tasks:S->720p and S->High definition.
Step 102:Determine the encoding tasks weighted value of the encoding tasks;
In the step, after distributing center server receives encoding tasks (one or more encoding tasks), in order according to
The encoding tasks weighted value for each encoding tasks that secondary determination receives.Its method of determination is:
Distributing center server can obtain the coding of encoding tasks by inquiring the mapping table of code stream and code weight value
Task weight value, wherein the mapping table is pre-set, and the encoding tasks weighted value of 4K code checks is usually set as 30,
The encoding tasks weighted value that the encoding tasks weighted value of 1080p code streams is set as 10,720p code streams is set as 5, and high definition is corresponding
Encoding tasks weighted value is set as 2, and smooth corresponding encoding tasks weighted value is set as 1.Certainly, it is not limited in practical application
This, can also carry out adaptation as needed.
Step 103:Obtain the maximum load weighted value of all kinds of servers and corresponding present load power in server cluster
Weight values;
In the step, distributing center server all kinds of servers from acquisition server cluster on the weight distribution table of maintenance
Maximum load weighted value and present load weighted value.
In the embodiment, distributing center server real-time servicing weight distribution table, according to the encoding tasks of distribution and completion
Encoding tasks, on the weight distribution table of maintenance update server cluster in every server load condition, for example, some
24 nuclear physics machine maximum load weighted values are 70, are used for 20 at present;If reallocated one 30 to this server
Encoding tasks, then on the weight distribution table that distributing center server is safeguarded, the present load weighted value of the server reforms into
50.
It should be noted that in this embodiment, the maximum load weighted value of all kinds of servers is pre-set.Than
Such as, the maximum load weighted value of the virtual machine setting of 8 core CPU is that the maximum load weighted value of 10,16 core CPU virtual machines setting is
The maximum load weighted value of 40,24 nuclear physics machines setting is that the maximum load weighted value of 70,32 core CPU settings is 100 etc..But
It is, in practical applications, however it is not limited to this, adaptation can also be carried out as needed.
In addition, distributing center server also monitors the CPU usage of all kinds of servers in server cluster in real time, if one section
The CPU usage of some server is excessively high in time, then corresponding server is offline from weight distribution table, does not distribute temporarily
Encoding tasks;And the server continues to monitor its CPU usage after offline in weight distribution table;If CPU usage reduces
To normal level (e.g., more than 85% in the case of utilization rate be below 70%), reach the standard grade from weight distribution table again.
Step 104:The available negative of Servers-all is determined according to the maximum load weighted value and present load weighted value
Carry weighted value;
Distributing center server calculates the difference of the maximum load weighted value and present load weighted value, obtains all clothes
The disposable load weighted value of business device.
Assuming that there is four servers in server cluster, be denoted as A, B, C, D, maximum load weighted value is respectively 10,40,
70、100;Present load weighted value is respectively 8,20,30,50;By calculating, the disposable load weighted value difference of all kinds of servers
It is 2,20,40,50.
Step 105:The maximum server of disposable load weighted value is selected from the disposable load weighted value of Servers-all
As destination server;
In the step, distributing center server selects disposable load weight from the disposable load weighted value of Servers-all
It is worth maximum server as destination server.
Step 106:The encoding tasks weighted value is distributed into the destination server.
In the step, if the corresponding encoding tasks weighted value of encoding tasks is respectively 5 (720p) and 2 (high definitions), distribution
Central server (is individually for each encoding tasks and distributes destination server) in order according to distribution principle, if first distributing 720p's
Encoding tasks can then assign it to D servers based on the embodiment in step 104;The currently available load of D servers later
Weighted value becomes 45, is still highest in remaining load weighted value, therefore the encoding tasks of high definition can also be assigned to D services
Device.
In the embodiment of the present invention, when receiving encoding tasks, according to the maximum load weighted value of all kinds of servers and right
The present load weighted value answered calculates the disposable load weighted value of Servers-all, then by the corresponding encoding tasks of encoding tasks
Weighted value distributes to the maximum server of present load weighted value.That is, the embodiment of the present invention is according to load weight limit
Value and the weighted value of present load dynamic dynamically distribute encoding tasks, solve encoding tasks distribution in the prior art and do not conform to
The problem of reason, improves the coding computational efficiency of server.
Optionally, in another embodiment, on the basis of the above embodiments, the method can also wrap the embodiment
It includes:To the difference according to being ranked sequentially from big to small, or according to being ranked sequentially from small to large;
Select the maximum server of present load weighted value as destination server, packet in the weighted value from present load
It includes:The maximum server of present load weighted value is chosen from the difference as destination server.
In the embodiment of the present invention, distributing center server is calculating the maximum load weighted value and present load weight
After the difference of value, which can be ranked up, it can be according to being ranked sequentially from big to small, it can also be according to from small to large
Be ranked sequentially, the maximum server of present load weighted value is then chosen from the difference as destination server, so as to
In encoding tasks weighted value is distributed to the destination server.
Optionally, in another embodiment, on the basis of the above embodiments, the method can also wrap the embodiment
It includes:The maximum load weighted value and the corresponding encoding tasks weighted value of various code checks of all kinds of servers are set.
In this embodiment, the maximum load weighted value of all kinds of servers is pre-set.For example, 8 core CPU's is virtual
The maximum load weighted value of machine setting is that the maximum load weighted value of 10,16 core CPU virtual machines setting is that 40,24 nuclear physics machines are set
The maximum load weighted value set is that the maximum load weighted value of 70,32 core CPU settings is 100 etc..But in practical applications,
It is not limited to this, adaptation can also be carried out as needed.These information storages are in weight distribution table, by distributing center
Server is safeguarded.
Wherein, the corresponding encoding tasks weighted value of various code checks is pre-set, usually by the encoding tasks of 4K code checks
Weighted value be set as 30,1080p code streams encoding tasks weighted value be set as 10,720p code streams encoding tasks weighted value setting
It is 5, the corresponding encoding tasks weighted value of high definition is set as 2, and smooth corresponding encoding tasks weighted value is set as 1.Certainly, practical
It is not limited to this in, adaptation can also be carried out as needed.These information storages in the mapping table, in distributing
Central server is safeguarded.
Optionally, in another embodiment, on the basis of the above embodiments, the method can also wrap the embodiment
It includes:Data after the maximum server completion encoding tasks of present load weighted value are sent to content point by distributing center server
Hairnet network (CDN, Content Delivery Network), i.e., by the data after server code from website orientation to closest
The network " edge " of user improves the response speed that user accesses website in order to which user can obtain required content nearby.
Also referring to Fig. 2, for a kind of another flow of the distribution method of live streaming encoding tasks provided in an embodiment of the present invention
Figure, the method includes:
Step 201:Receive the encoding tasks that code stream manager is sent;
Step 202:Determine the encoding tasks weighted value of the encoding tasks;
Step 203:Obtain the maximum load weighted value of all kinds of servers and corresponding present load power in server cluster
Weight values;
Step 204:The available negative of Servers-all is determined according to the maximum load weighted value and present load weighted value
Carry weighted value;
Step 205:The maximum server of disposable load weighted value is selected from the disposable load weighted value of Servers-all
As destination server;
Step 206:The encoding tasks weighted value is distributed into the destination server;
The specific implementation process of step 201 to step 206 is identical as the realization process of step 101 to step 106, specific detailed
See above-mentioned, details are not described herein.
Step 207:In weight distribution table, the present load weighted value of the destination server is appointed plus the coding
Business weighted value, to update the present load weighted value of destination server described in weight distribution table;
Step 208:It, will in the weight distribution table after monitoring that the destination server completes the encoding tasks
The encoding tasks weighted value is subtracted from the present load weighted value of the destination server, to update institute in weight distribution table
State the present load weighted value of destination server.
In the embodiment, distributing center server safeguards weight distribution table, is appointed according to the coding distributed for destination server
It is engaged in and after the encoding tasks that destination server is completed, updates the state of the present load weighted value of the destination server.Example
Such as, some 24 nuclear physics machine maximum load is 70, is used for 20 at present;If reallocated one 30 to this server
Encoding tasks, then on the weight distribution table that distributing center server is safeguarded, the disposable load weighted value of the server reforms into
50.Further, when the encoding tasks on some destination server are completed, distributing center server is notified that, in distributing
Central server subtracts the load weighted value of the destination server from weight distribution table.
Also referring to Fig. 3, for a kind of another flow of the distribution method of live streaming encoding tasks provided in an embodiment of the present invention
Figure.In this embodiment, for all kinds of server failures and emergency situations in detection service device cluster, in the embodiment of the present invention
Further include:Distributing center server also monitors the CPU usage of all kinds of servers in server cluster in real time, if in a period of time
CPU usage is excessively high, then the load weighted value of corresponding server is offline from weight distribution table, and temporarily allocated code is not appointed
Business.If CPU usage is too low within another a period of time, then by the load weighted value of corresponding server from weight distribution table
Line allows to give its allocated code task.The method specifically includes:
Step 301:Monitor the CPU usage of all kinds of servers;
Step 302:Judge whether the CPU usage of all kinds of servers in preset time is more than first threshold;If it does,
Execute step 303;Otherwise, return to step 301:
Step 303:By CPU usage be more than first threshold server load weighted value under in weight distribution table
Line;
Step 304:Monitor the CPU usage of the offline server from the weight distribution table;
Step 305:Judge whether the CPU usage of the offline server is less than the second threshold;If so, holding
Row step 306;Otherwise, return to step 304:
Step 306:The load weighted value of the offline server is reached the standard grade in the weight distribution table.
In order to make it easy to understand, illustrating that all kinds of server CPU are used in monitoring server cluster below with simple example
The method of rate:If server uses Linux system, read/proc/stat in information and calculating;Computational methods
It is to take two to be separated by extremely short time point, is denoted as t1 and t2, reads the first row information of this file of each time point;Enable s1=
The sum of all numerical value of the first row in t1, the sum of all numerical value of the first row, total=s2-s1 in s2=t2.In addition, in i1=t1
The value that a line the 4th arranges, the value that the first row the 4th arranges in i2=t2, idle=i2-i1.Then utilization rate q=(total-idle)/
total.Monitoring programme on server monitors CPU usage in real time, if utilization rate is all higher than v% under the time more than u%,
Then think to need to ask to distributing center server offline;Such as, more than 85% in the case of utilization rate all be higher than 90%.
After offline in weight distribution table, distributing center server continues to monitor it load weighted value of certain server
CPU usage;If CPU usage be reduced to normal level (e.g., more than 85% in the case of utilization rate be below 70%), from
The load weighted value of the server is reached the standard grade again in weight distribution table.
In the embodiment of the present invention, distributing center server pass through monitor in real time server cluster in all kinds of servers CPU
Utilization rate, and if CPU usage is excessively high whithin a period of time, by the load weighted value of respective server from weight distribution table
It is offline, the server allocated code task is not given temporarily;Then offline server is continued to monitor, and offline monitoring
When the CPU usage of server is less than second threshold, by the load weighted value of the offline server in the weight distribution
It reaches the standard grade in table.To cope with real time fail and emergency situations in time, accident treatment efficiency is improved.
It should be noted that for embodiment of the method, for simple description, therefore it is all expressed as a series of action group
It closes, but those skilled in the art should understand that, the embodiment of the present invention is not limited by the described action sequence, because according to
According to the embodiment of the present invention, certain steps can be performed in other orders or simultaneously.Secondly, those skilled in the art also should
Know, embodiment described in this description belongs to preferred embodiment, and the involved action not necessarily present invention is implemented
Necessary to example.
Also referring to Fig. 4, for a kind of structural representation of the distributor of live streaming encoding tasks provided in an embodiment of the present invention
Figure, described device include:Receiving unit 41, the first determination unit 42, acquiring unit 43, the second determination unit 44, selecting unit
45 and allocation unit 46, wherein
Receiving unit 41, the encoding tasks for receiving the transmission of code stream manager;
First determination unit 42, the encoding tasks weighted value for determining the encoding tasks;
Acquiring unit 43, maximum load weighted value for obtaining all kinds of servers in server cluster and corresponding current
Load weighted value;
Second determination unit 44, for determining all services according to the maximum load weighted value and present load weighted value
The disposable load weighted value of device;Specifically for calculating the difference of the maximum load weighted value and present load weighted value, obtain
The disposable load weighted value of Servers-all.
Selecting unit 45, for selecting disposable load weighted value maximum from the disposable load weighted value of Servers-all
Server is as destination server;
Allocation unit 46, for the encoding tasks weighted value to be distributed to the destination server.
Optionally, in another embodiment, on the basis of the above embodiments, described device can also wrap the embodiment
It includes:Sequencing unit (not shown), wherein
The sequencing unit, the difference for second determination unit 44 to be calculated is according to from big to small
It is ranked sequentially, or according to being ranked sequentially from small to large;
The selecting unit 45 is specifically used for choosing the maximum server conduct of present load weighted value from the difference
Destination server.
Optionally, in another embodiment, on the basis of the above embodiments, described device can also wrap the embodiment
It includes:Setting unit 51, structural schematic diagram is as shown in Figure 5, wherein
The setting unit 51 is connect with acquiring unit 43, and the maximum load for presetting all kinds of servers is weighed
Weight values and the corresponding encoding tasks weighted value of various code checks.
Optionally, in another embodiment, on the basis of the above embodiments, described device can also wrap the embodiment
It includes:Updating unit 61, structural schematic diagram is as shown in Figure 6, wherein updating unit 61 is used for will be described in the allocation unit 46
After encoding tasks weighted value distributes to the destination server, in weight distribution table, by the current negative of the destination server
It carries weighted value and adds the encoding tasks weighted value, to update the present load weight of destination server described in weight distribution table
Value.
Optionally, in another embodiment, on the basis of the above embodiments, described device can also wrap the embodiment
It includes:The updating unit 61 is additionally operable to after monitoring that the destination server completes the encoding tasks, in the weight point
With subtracting the encoding tasks weighted value from the present load weighted value of the destination server in table, to update weight point
Present load weighted value with destination server described in table.
Optionally, in another embodiment, on the basis of the above embodiments, described device can also wrap the embodiment
It includes:First monitoring unit 71, the first judging unit 72, offline unit 73, further, described device can also include:Second prison
Unit 74, second judgment unit 75 and unit 76 of reaching the standard grade are controlled, structural schematic diagram is as shown in Figure 7, wherein
First monitoring unit 71, the CPU usage for monitoring all kinds of servers;
First judging unit 72, for judging whether the CPU usage of all kinds of servers in preset time is more than threshold value;
Offline unit 73, for first judging unit 72 judge the CPU usage be more than threshold value when, by CPU
Utilization rate is more than that the load weighted value of the server of threshold value is offline from weight distribution table.
Second monitoring unit 74, the CPU usage for monitoring offline server from weight distribution table;
Second judgment unit 75, for judging whether the CPU usage of the offline server is less than threshold value;
It reaches the standard grade unit 76, the CPU usage for judging offline server in the second judgment unit 75 is low
When threshold value, the load weighted value of the server is reached the standard grade in the weight distribution table.
In the embodiment of the present invention, when receiving encoding tasks, according to the maximum load weighted value of server and corresponding
Present load weighted value calculates the disposable load weighted value of Servers-all, then by the corresponding encoding tasks weight of encoding tasks
Value distributes to the maximum server of present load weighted value.That is, the embodiment of the present invention according to load weight limit value and
The weighted value dynamic of present load dynamically distributes encoding tasks, solves encoding tasks unreasonable distribution in the prior art
Problem improves the computational efficiency of server.
For device embodiments, since it is basically similar to the method embodiment, so fairly simple, the correlation of description
Place illustrates referring to the part of embodiment of the method.
Also referring to Fig. 8, showing for a kind of structure of distribution system of live streaming encoding tasks provided in an embodiment of the present invention
It is intended to, as shown, including:Stream pushing server 81, code stream manager 82, distributing center server 83, server cluster 84 (should
Cluster includes multiple servers or calculation server) and (CDN, the Content Delivery of content distributing network 85
Network), wherein
Stream pushing server 81, for receiving primary flow, wherein primary flow can be ts streams, rtmp streams etc.;And it is this is original
Stream is sent to streaming server 82;
Code stream manager 82, for receive stream pushing server 81 transmission primary flow after, as needed by source code
Stream encryption and exports the encoding tasks to distributing center server 83 at the encoding tasks of one or more code streams;
Distributing center server 83, the encoding tasks for receiving the transmission of code stream manager, determines the encoding tasks
Encoding tasks weighted value;Obtain the maximum load weighted value of all kinds of servers and corresponding present load power in server cluster 84
Weight values;The disposable load weighted value of Servers-all is determined according to the maximum load weighted value and present load weighted value;From
Select the maximum server of disposable load weighted value as destination server in the disposable load weighted value of Servers-all;By institute
It states encoding tasks weighted value and distributes to the destination server.
Destination server in server cluster 84, the encoding tasks weight for receiving the distribution of distributing center server 83
Value, carries out coding calculation processing, the data flow after being encoded according to the encoding tasks weighted value to video flowing;By the data
Stream feeds back to distributing center server 83;
Distributing center server 83 is additionally operable to the data after destination server completion encoding tasks being sent to content distribution
Network C DN, i.e., by the data after server code from website orientation to the network " edge " closest to user, in order to which user can
To obtain required content nearby, to improve the response speed that user accesses website.
Each embodiment in this specification is described in a progressive manner, the highlights of each of the examples are with
The difference of other embodiment, the same or similar parts between the embodiments can be referred to each other.
It should be understood by those skilled in the art that, the embodiment of the embodiment of the present invention can be provided as method, apparatus or calculate
Machine program product.Therefore, the embodiment of the present invention can be used complete hardware embodiment, complete software embodiment or combine software and
The form of the embodiment of hardware aspect.Moreover, the embodiment of the present invention can be used one or more wherein include computer can
With in the computer-usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) of program code
The form of the computer program product of implementation.
The embodiment of the present invention be with reference to according to the method for the embodiment of the present invention, terminal device (system) and computer program
The flowchart and/or the block diagram of product describes.It should be understood that flowchart and/or the block diagram can be realized by computer program instructions
In each flow and/or block and flowchart and/or the block diagram in flow and/or box combination.These can be provided
Computer program instructions are set to all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing terminals
Standby processor is to generate a machine so that is held by the processor of computer or other programmable data processing terminal equipments
Capable instruction generates for realizing in one flow of flow chart or multiple flows and/or one box of block diagram or multiple boxes
The device of specified function.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing terminal equipments
In computer-readable memory operate in a specific manner so that instruction stored in the computer readable memory generates packet
The manufacture of command device is included, which realizes in one flow of flow chart or multiple flows and/or one side of block diagram
The function of being specified in frame or multiple boxes.
These computer program instructions can be also loaded into computer or other programmable data processing terminal equipments so that
Series of operation steps are executed on computer or other programmable terminal equipments to generate computer implemented processing, thus
The instruction executed on computer or other programmable terminal equipments is provided for realizing in one flow of flow chart or multiple flows
And/or in one box of block diagram or multiple boxes specify function the step of.
Although the preferred embodiment of the embodiment of the present invention has been described, once a person skilled in the art knows bases
This creative concept, then additional changes and modifications can be made to these embodiments.So the following claims are intended to be interpreted as
Including preferred embodiment and fall into all change and modification of range of embodiment of the invention.
Finally, it is to be noted that, herein, relational terms such as first and second and the like be used merely to by
One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation
Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning
Covering non-exclusive inclusion, so that process, method, article or terminal device including a series of elements not only wrap
Those elements are included, but also include other elements that are not explicitly listed, or further include for this process, method, article
Or the element that terminal device is intrinsic.In the absence of more restrictions, being wanted by what sentence "including a ..." limited
Element, it is not excluded that there is also other identical elements in process, method, article or the terminal device including the element.
Above to a kind of distribution method and device of live streaming encoding tasks provided by the present invention, it is described in detail,
Principle and implementation of the present invention are described for specific case used herein, and the explanation of above example is only used
In facilitating the understanding of the method and its core concept of the invention;Meanwhile for those of ordinary skill in the art, according to the present invention
Thought, there will be changes in the specific implementation manner and application range, in conclusion the content of the present specification should not be construed as
Limitation of the present invention.
Claims (14)
1. a kind of distribution method of live streaming encoding tasks, which is characterized in that including:
Receive the encoding tasks that code stream manager is sent;
Determine the encoding tasks weighted value of the encoding tasks;
Obtain the maximum load weighted value of all kinds of servers and corresponding present load weighted value in server cluster;
The disposable load weighted value of Servers-all is determined according to the maximum load weighted value and present load weighted value;
Select the maximum server of disposable load weighted value as destination service from the disposable load weighted value of Servers-all
Device;
The encoding tasks weighted value is distributed into the destination server.
2. according to the method described in claim 1, it is characterized in that, described according to the maximum load weighted value and present load
Weighted value determines that the disposable load weighted value of Servers-all includes:
The difference for calculating the maximum load weighted value and present load weighted value obtains the disposable load weight of Servers-all
Value.
3. method according to claim 1 or 2, which is characterized in that further include:
The maximum load weighted value and the corresponding encoding tasks weighted value of various code checks of all kinds of servers are set.
4. method according to claim 1 or 2, which is characterized in that the encoding tasks weighted value is distributed to the mesh
After marking server, the method further includes:
The present load weighted value of the destination server is added into the encoding tasks weighted value, to update in weight distribution table
The present load weighted value of the destination server.
5. according to the method described in claim 4, it is characterized in that, the method further includes:
After monitoring that the destination server completes the encoding tasks, by the encoding tasks in the weight distribution table
Weighted value is subtracted from the present load weighted value of the destination server, to update destination server described in weight distribution table
Present load weighted value.
6. method according to claim 1 or 2, which is characterized in that further include:
Monitor the CPU usage of all kinds of servers;
Judge whether the CPU usage of all kinds of servers in preset time is more than first threshold;
Then it is more than the load weight of the server of first threshold by CPU usage when the CPU usage is more than first threshold
Value is offline from weight distribution table.
7. according to the method described in claim 6, it is characterized in that, further including:
Monitor the CPU usage of the offline server from the weight distribution table;
Judge whether the CPU usage of the offline server is less than second threshold;
When the CPU usage is less than second threshold, by the load weighted value of the offline server in the weight point
With reaching the standard grade in table.
8. a kind of distributor of live streaming encoding tasks, which is characterized in that including:
Receiving unit, the encoding tasks for receiving the transmission of code stream manager;
First determination unit, the encoding tasks weighted value for determining the encoding tasks;
Acquiring unit, the maximum load weighted value for obtaining all kinds of servers in server cluster and corresponding present load power
Weight values;
Second determination unit, for according to the maximum load weighted value and present load weighted value determine Servers-all can
With load weighted value;
Selecting unit, for selecting the maximum server of disposable load weighted value from the disposable load weighted value of Servers-all
As destination server;
Allocation unit, for the encoding tasks weighted value to be distributed to the destination server.
9. device according to claim 8, which is characterized in that
Second determination unit is specifically used for calculating the difference of the maximum load weighted value and present load weighted value, obtain
To the disposable load weighted value of Servers-all.
10. device according to claim 8 or claim 9, which is characterized in that further include:
Setting unit, the corresponding coding of maximum load weighted value and various code checks for presetting all kinds of servers are appointed
Business weighted value.
11. device according to claim 8 or claim 9, which is characterized in that further include:
Updating unit, for after the encoding tasks weighted value is distributed to the destination server by the allocation unit,
In weight distribution table, the present load weighted value of the destination server is added into the encoding tasks weighted value, to update power
Reassign the present load weighted value of destination server described in table.
12. according to the devices described in claim 11, which is characterized in that
The updating unit is additionally operable to after monitoring that the destination server completes the encoding tasks, in the weight point
With subtracting the encoding tasks weighted value from the present load weighted value of the destination server in table, to update weight point
Present load weighted value with destination server described in table.
13. device according to claim 8 or claim 9, which is characterized in that further include:
First monitoring unit, the CPU usage for monitoring all kinds of servers;
First judging unit, for judging whether the CPU usage of all kinds of servers in preset time is more than threshold value;
Offline unit, for when first judging unit judges that the CPU usage is more than threshold value, CPU usage to be surpassed
The load weighted value for crossing the server of threshold value is offline from weight distribution table.
14. device according to claim 13, which is characterized in that further include:
Second monitoring unit, the CPU usage for monitoring the offline server from the weight distribution table;
Second judgment unit, for judging whether the CPU usage of the offline server is less than threshold value;
It reaches the standard grade unit, when for judging that the CPU usage of offline server is less than threshold value in the second judgment unit,
The load weighted value of the server is reached the standard grade in the weight distribution table.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711424396.2A CN108307206A (en) | 2017-12-25 | 2017-12-25 | A kind of distribution method and device of live streaming encoding tasks |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711424396.2A CN108307206A (en) | 2017-12-25 | 2017-12-25 | A kind of distribution method and device of live streaming encoding tasks |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108307206A true CN108307206A (en) | 2018-07-20 |
Family
ID=62870772
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711424396.2A Pending CN108307206A (en) | 2017-12-25 | 2017-12-25 | A kind of distribution method and device of live streaming encoding tasks |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108307206A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109600396A (en) * | 2019-01-23 | 2019-04-09 | 浙江安点科技有限责任公司 | Realize the firewall system of highly reliable safety |
CN115514996A (en) * | 2021-06-22 | 2022-12-23 | 武汉斗鱼鱼乐网络科技有限公司 | Method and device for determining state of live transcoding machine |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102075425A (en) * | 2008-12-16 | 2011-05-25 | 中国移动通信集团北京有限公司 | Business allocation method and load balancer |
CN102984184A (en) * | 2011-09-05 | 2013-03-20 | 上海可鲁系统软件有限公司 | A method and a device for service load balancing for a distributed system |
CN105468458A (en) * | 2015-11-26 | 2016-04-06 | 北京航空航天大学 | Resource scheduling method and system of computer cluster |
CN105791381A (en) * | 2015-12-30 | 2016-07-20 | 东莞市青麦田数码科技有限公司 | Access control method and apparatus |
CN107231565A (en) * | 2017-07-25 | 2017-10-03 | 网宿科技股份有限公司 | A kind of live task management dispatching method and its system |
-
2017
- 2017-12-25 CN CN201711424396.2A patent/CN108307206A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102075425A (en) * | 2008-12-16 | 2011-05-25 | 中国移动通信集团北京有限公司 | Business allocation method and load balancer |
CN102984184A (en) * | 2011-09-05 | 2013-03-20 | 上海可鲁系统软件有限公司 | A method and a device for service load balancing for a distributed system |
CN105468458A (en) * | 2015-11-26 | 2016-04-06 | 北京航空航天大学 | Resource scheduling method and system of computer cluster |
CN105791381A (en) * | 2015-12-30 | 2016-07-20 | 东莞市青麦田数码科技有限公司 | Access control method and apparatus |
CN107231565A (en) * | 2017-07-25 | 2017-10-03 | 网宿科技股份有限公司 | A kind of live task management dispatching method and its system |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109600396A (en) * | 2019-01-23 | 2019-04-09 | 浙江安点科技有限责任公司 | Realize the firewall system of highly reliable safety |
CN115514996A (en) * | 2021-06-22 | 2022-12-23 | 武汉斗鱼鱼乐网络科技有限公司 | Method and device for determining state of live transcoding machine |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109194984B (en) | Video frame scheduling method based on edge calculation | |
CN108965884B (en) | Distribution method of transcoding tasks, scheduling device and transcoding device | |
CN102891868B (en) | The load-balancing method of a kind of distributed system and device | |
Ashraf et al. | Stream-based admission control and scheduling for video transcoding in cloud computing | |
US11080090B2 (en) | Method and system for scalable job processing | |
US20140143300A1 (en) | Method and Apparatus for Controlling Utilization in a Horizontally Scaled Software Application | |
CN108933829A (en) | A kind of load-balancing method and device | |
CN105703927A (en) | Resource allocation method, network device and network system | |
CN106101276B (en) | A kind of cluster load balancing method and device | |
CN114915593B (en) | Redis-based flow control method and device, electronic equipment and storage medium | |
EP3021521A1 (en) | A method and system for scaling, telecommunications network and computer program product | |
CN105471700B (en) | A kind of methods, devices and systems of Message Processing | |
CN108243222A (en) | Server network architecture method and device | |
CN103595736B (en) | Access request treating method and apparatus in video monitoring system | |
CN108234242A (en) | A kind of method for testing pressure and device based on stream | |
CN108307206A (en) | A kind of distribution method and device of live streaming encoding tasks | |
Hassan et al. | Efficient virtual machine resource management for media cloud computing | |
CN107872405A (en) | Distributed bandwidth allocation and regulation | |
CN108551571B (en) | Monitoring video distribution method, device and system and distribution server | |
CN110351376A (en) | A kind of edge calculations node selecting method based on negative feedback mechanism | |
CN103297511A (en) | Client/ server scheduling method and system under highly dynamic environment | |
CN109670691A (en) | Method, equipment and the customer service system distributed for customer service queue management and customer service | |
CN112073223B (en) | System and method for managing and controlling operation of cloud computing terminal and cloud server | |
CN109600402A (en) | Server load balancing method and device, storage medium, server, service system | |
KR20140097881A (en) | Apparatus and method for load balancing using resource usage prediction |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180720 |