Channel sharing method, device and computer readable storage medium

文档序号:1430963 发布日期:2020-03-17 浏览:16次 中文

阅读说明:本技术 频道共享方法、设备和计算机可读存储介质 (Channel sharing method, device and computer readable storage medium ) 是由 裴清华 于 2018-09-11 设计创作,主要内容包括:本发明公开了一种频道共享方法、设备和计算机可读存储介质,该方法包括:检测多个流媒体服务器的资源使用率;从所述多个流媒体服务器中选出资源使用率超过预设阈值的第一流媒体服务器,检测根据所述第一流媒体服务器中多个频道的点播情况;根据所述多个频道的点播情况,从所述多个频道中选出至少一个频道作为热点频道;从所述多个流媒体服务器中选出资源使用率不超过所述预设阈值的第二流媒体服务器,在所述第二流媒体服务器上创建所述至少一个频道对应的临时频道。根据本发明的技术方案,能够自动从资源使用率较高的流媒体服务器上发现热点频道,并通过在资源使用率较低的流媒体服务器上创建热点频道的临时频道,来分担热点频道的压力,从而平衡资源使用率较高和较低的流媒体服务器的负载。(The invention discloses a channel sharing method, a device and a computer readable storage medium, wherein the method comprises the following steps: detecting resource utilization rates of a plurality of streaming media servers; selecting a first streaming media server with the resource utilization rate exceeding a preset threshold value from the streaming media servers, and detecting the on-demand condition of a plurality of channels in the first streaming media server; selecting at least one channel from the plurality of channels as a hot spot channel according to the on-demand conditions of the plurality of channels; and selecting a second streaming media server with the resource utilization rate not exceeding the preset threshold value from the plurality of streaming media servers, and creating a temporary channel corresponding to the at least one channel on the second streaming media server. According to the technical scheme of the invention, the hot spot channel can be automatically found from the streaming media server with higher resource utilization rate, and the pressure of the hot spot channel is shared by creating the temporary channel of the hot spot channel on the streaming media server with lower resource utilization rate, so that the load of the streaming media server with higher and lower resource utilization rate is balanced.)

1. A method for sharing a channel, comprising:

detecting resource utilization rates of a plurality of streaming media servers;

selecting a first streaming media server with the resource utilization rate exceeding a preset threshold value from the streaming media servers, and detecting the on-demand condition of a plurality of channels in the first streaming media server;

selecting at least one channel from the plurality of channels as a hot spot channel according to the on-demand conditions of the plurality of channels;

and selecting a second streaming media server with the resource utilization rate not exceeding the preset threshold value from the plurality of streaming media servers, and creating a temporary channel corresponding to the at least one channel on the second streaming media server.

2. The method according to claim 1, wherein said selecting at least one channel from the plurality of channels as a hot channel according to the on-demand status of the plurality of channels comprises:

sampling the on-demand times of the channels in a preset time period, dividing the time period into a plurality of sampling particles, taking the sampling particles with the on-demand times exceeding the preset times as effective sampling particles, and judging whether the channels are the hot channels or not according to the number of the effective sampling particles corresponding to the channels.

3. The method according to claim 1, wherein the detecting resource usage rates of a plurality of streaming media servers comprises:

the method comprises the steps of obtaining a plurality of parameters of each streaming media server, substituting the parameters into a preset formula to calculate the resource utilization rate of each streaming media server when the parameters do not exceed preset values, and setting the resource utilization rate of each streaming media server as a preset fixed value when any one of the parameters exceeds the preset values.

4. The method of claim 1, further comprising:

when a unicast channel serving as the hot spot channel is created, setting a channel outgoing address of the unicast channel as a multicast source address which can be received by an uplink switch, and sending a code stream of the unicast channel to the uplink switch;

when a live broadcast request for the unicast channel is acquired, a multicast channel is created on other streaming media servers outside the streaming media server where the unicast channel is located, and the multicast channel is played to the user by using the code stream from the upper connection switch.

5. The method of claim 4, wherein creating the multicast channel on a streaming server other than the streaming server where the unicast channel is located comprises:

and selecting one streaming media server from other streaming media servers to create the multicast channel according to the resource utilization rate of the other streaming media servers except the streaming media server where the unicast channel is located.

6. A channel sharing device, comprising a processor, a memory, and a communication bus;

the communication bus is used for realizing connection communication between the processor and the memory;

the processor is configured to execute a channel sharing program stored in the memory to implement the following steps:

detecting resource utilization rates of a plurality of streaming media servers;

selecting a first streaming media server with the resource utilization rate exceeding a preset threshold value from the streaming media servers, and detecting the on-demand condition of a plurality of channels in the first streaming media server;

selecting at least one channel from the plurality of channels as a hot spot channel according to the on-demand conditions of the plurality of channels;

and selecting a second streaming media server with the resource utilization rate not exceeding the preset threshold value from the plurality of streaming media servers, and creating a temporary channel corresponding to the at least one channel on the second streaming media server.

7. The apparatus as claimed in claim 6, wherein in said selecting at least one channel from said plurality of channels as a hot channel according to the on-demand condition of said plurality of channels, said processor executes said channel sharing program to implement the following steps:

sampling the on-demand times of the channels in a preset time period, dividing the time period into a plurality of sampling particles, taking the sampling particles with the on-demand times exceeding the preset times as effective sampling particles, and judging whether the channels are the hot channels or not according to the number of the effective sampling particles corresponding to the channels.

8. The apparatus of claim 6, wherein in detecting resource usage of a plurality of streaming media servers, the processor further executes the channel sharing program to perform the following steps:

the method comprises the steps of obtaining a plurality of parameters of each streaming media server, substituting the parameters into a preset formula to calculate the resource utilization rate of each streaming media server when the parameters do not exceed preset values, and setting the resource utilization rate of each streaming media server as a preset fixed value when any one of the parameters exceeds the preset values.

9. The apparatus of claim 6, wherein the processor further executes the channel sharing program to perform the steps of:

when a unicast channel serving as the hot spot channel is created, setting a channel outgoing address of the unicast channel as a multicast source address which can be received by an uplink switch, and sending a code stream of the unicast channel to the uplink switch;

when a live broadcast request for the unicast channel is acquired, a multicast channel is created on other streaming media servers outside the streaming media server where the unicast channel is located, and the multicast channel is played to the user by using the code stream from the upper connection switch.

10. A computer readable storage medium, characterized in that the computer readable storage medium stores one or more programs which are executable by one or more processors to implement the steps of the method of any one of claims 1 to 5.

Technical Field

The present invention relates to the field of communications technologies, and in particular, to a channel sharing method, device, and computer-readable storage medium.

Background

In an IPTV (interactive network television) service, a live broadcast service is a video-like basic service, and the distribution mode mainly includes multicast, unicast, and unicast plus live broadcast. When the live broadcast service is sent by multicast, the streaming media server sends a multicast code stream to a multicast source of an upper connection switch, and when a user requests service, the multicast source directly broadcasts the code stream without being limited by the capacity of the streaming media server, but the corresponding requirement on network equipment is higher; when the live broadcast service is sent by unicast, a server is required to provide live broadcast code streams to users, the requirements on network equipment are low, but the requirements on a streaming media server are high.

In a unicast or unicast plus multicast-based live broadcast service model in the IPTV service system, the system enhances the live broadcast service capability of the system by intensively deploying a plurality of sets of streaming media servers. If one live broadcast code stream is received from the encoder on each set of streaming media server for the same channel, the operation cost is inevitably high due to the need of multiple encoders; on the contrary, if a plurality of sets of streaming media servers only receive one live broadcast code stream, but the attention degrees of the users of each channel are different, the load among the streaming media servers is unbalanced, and especially, the streaming media server where the hot channel is located may not normally provide the live broadcast service of the user due to insufficient capacity, which not only affects the playing experience of the user, but also affects the acceptance of the operator on the comprehensive capacity of the system. Although the multicast channel can satisfy the condition that the user live broadcast service is not influenced by the capability limitation of the streaming media server, once the user enters time shifting from multicast, the user can only provide the service by the streaming media of the channel, and other devices cannot provide the service due to no fragment recording.

It can be seen that the hot spot channel causes the problem of load imbalance among streaming media servers in the system.

Disclosure of Invention

The invention mainly aims to provide a channel sharing method, a device and a computer readable storage medium, aiming at solving the problem of load imbalance among streaming media servers caused by hot channels.

In order to achieve the above object, the present invention provides a channel sharing method, including: detecting resource utilization rates of a plurality of streaming media servers; selecting a first streaming media server with the resource utilization rate exceeding a preset threshold value from the streaming media servers, and detecting the on-demand condition of a plurality of channels in the first streaming media server; selecting at least one channel from the plurality of channels as a hot spot channel according to the on-demand conditions of the plurality of channels; and selecting a second streaming media server with the resource utilization rate not exceeding the preset threshold value from the plurality of streaming media servers, and creating a temporary channel corresponding to the at least one channel on the second streaming media server.

To achieve the above object, the present invention also provides a channel sharing device, which includes a processor, a memory, and a communication bus; the communication bus is used for realizing connection communication between the processor and the memory; the processor is configured to execute a channel sharing program stored in the memory to implement the following steps: detecting resource utilization rates of a plurality of streaming media servers; selecting a first streaming media server with the resource utilization rate exceeding a preset threshold value from the streaming media servers, and detecting the on-demand condition of a plurality of channels in the first streaming media server; selecting at least one channel from the plurality of channels as a hot spot channel according to the on-demand conditions of the plurality of channels; and selecting a second streaming media server with the resource utilization rate not exceeding the preset threshold value from the plurality of streaming media servers, and creating a temporary channel corresponding to the at least one channel on the second streaming media server.

To achieve the above object, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, which are executable by one or more processors to implement the steps of the aforementioned channel sharing method.

According to the above technical solutions, it can be seen that the channel sharing method, device and computer-readable storage medium of the present invention have at least the following advantages:

according to the technical scheme of the invention, the hot spot channel can be automatically found from the streaming media server with higher resource utilization rate, and the pressure of the hot spot channel is shared by creating the temporary channel of the hot spot channel on the streaming media server with lower resource utilization rate, so that the load of the streaming media server with higher and lower resource utilization rate is balanced.

Drawings

Fig. 1 is a flowchart of a channel sharing method according to an embodiment of the present invention;

fig. 2 is a flowchart of a channel sharing method according to an embodiment of the present invention;

fig. 3 is a diagram illustrating a channel sharing method according to an embodiment of the present invention;

fig. 4 is a block diagram of a channel sharing apparatus according to an embodiment of the present invention.

The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.

Detailed Description

It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

In the following description, suffixes such as "module", "part", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no peculiar meaning in itself. Thus, "module", "component" or "unit" may be used mixedly.

As shown in fig. 1, an embodiment of the present invention provides a channel sharing method, including:

step S110, detecting resource utilization rates of a plurality of streaming media servers.

Step S120, select a first streaming media server with a resource usage rate exceeding a preset threshold from the multiple streaming media servers, and detect an on-demand situation according to multiple channels in the first streaming media server.

Step S130, selecting at least one channel from the multiple channels as a hot spot channel according to the on-demand condition of the multiple channels.

In this embodiment, first, the IPTV management platform issues a resource usage threshold to each streaming media server, and when the comprehensive resource usage rate of the subordinate streaming media servers exceeds the threshold, the IPTV management platform sets several channels with higher on-demand frequency recorded in the data table as hot channels.

Step S140, selecting a second streaming media server from the plurality of streaming media servers, where the resource usage rate does not exceed a preset threshold, and creating a temporary channel corresponding to at least one channel on the second streaming media server.

In this embodiment, a temporary channel is automatically created to other streaming media servers by means of channel relay, so that each streaming media server can provide live broadcast and time shift services of a hot spot channel. And when the user service is provided, the management platform selects the streaming media server with relatively idle resource occupation to provide the live broadcast service according to the comprehensive utilization rate of the resources of each streaming media server reported by the load balancing module.

The IPTV service system of this embodiment is automatically implemented without requiring manual intervention and without special requirements for data devices, but if there is a certain delay, it is necessary to trigger a server resource threshold and form a hot channel, and then balance the service provision to each streaming media server.

As shown in fig. 2, an embodiment of the present invention provides a channel sharing method, including:

step S210, obtaining a plurality of parameters of each streaming media server, substituting the parameters into a preset formula to calculate the resource utilization rate of each streaming media server when the parameters do not exceed preset values, and setting the resource utilization rate of each streaming media server as a preset fixed value when any one of the parameters exceeds the preset values.

In this embodiment, statistics of the comprehensive capacity of streaming media server resources is realized, and weighted calculation is performed according to the current statistics of the access flow usage rate of the streaming media server, the read-write IO usage rate of the disk, and the CPU and memory usage rate of the device, so as to provide a basis for the management platform to select which streaming media server through load balancing.

In this embodiment, when a channel is used as a hotspot channel to provide live broadcast service, it is mentioned that a streaming media server is selected to provide service through load balancing, where the load balancing is based on statistical comprehensive utilization rate of resources of each streaming media server, and the specific calculation method is as follows:

the parameter S5 represents that the flow occupation ratio of the streaming media server is (current ingress and egress traffic of the server + current egress/ingress traffic of the server)/the maximum traffic allocated to the server, except the current ingress and egress traffic of the current ingress and egress, the disk IO read-write usage rate, the CPU usage rate of the server, and the memory usage rate also need to be reflected in the comprehensive capacity of the server, and here, the parameters are represented by S6, S7, and S8, respectively; the comprehensive utilization rate S9 of the corresponding streaming media server is calculated by the formula:

if all of S7, S8, S9 are less than 90%, S9 ═ S6 × 60% + S7 × 20% + S8 × 10% + S9 × 10%;

if the values of S7, S8 and S9 are greater than or equal to 90%, S9 is 95%, and no user service is provided to the outside;

the above formula is represented by 60%, 20%, 10% and 10% as conversion coefficients of the current server flow occupation ratio, the disk IO read-write utilization ratio, the CPU utilization ratio and the memory utilization ratio in the comprehensive utilization ratio, and the conversion coefficients are obtained by performing logic analysis according to respective importance degree of the IPTV system running on the server. Meanwhile, in order to ensure the stable operation of the system, a certain threshold value is set, when the utilization rate of the service in the S7, the S8 and the S9 reaches more than 90%, the user service is not continuously provided to the outside, and the service quality of the current user is preferentially ensured. Meanwhile, reporting of the comprehensive capacity of the server requires setting a timer, wherein the current flow, the disk read-write IO, the CPU utilization rate and the memory utilization rate of the server are reported every 30S, and the comprehensive capacity utilization rate of each streaming media server is calculated according to the reported numerical values, so that the server with lower utilization rate is selected to provide user services.

In the embodiment, the CPU utilization rate, the memory utilization rate and the disk IO utilization rate are not calculated independently, the importance degree of each parameter value to the system is obtained through the call test of the actual user model, the parameter folding system is obtained by combining the performance bottleneck of the system hardware, and meanwhile, the abnormal protection under the condition that the utilization rates of the system CPU, the memory and the like are close to the upper limit of the system utilization is considered in the algorithm, so that each streaming media server can effectively, stably and maximally provide the resource capacity of the streaming media server.

Step S220, select a first streaming media server with a resource usage rate exceeding a preset threshold from the multiple streaming media servers, and detect an on-demand situation according to multiple channels in the first streaming media server.

Step S230, sampling the on-demand times of the multiple channels in a preset time period, dividing the time period into multiple sampling particles, taking the sampling particles with the on-demand times exceeding the preset times as effective sampling particles, and determining whether the multiple channels are hot channels according to the number of the effective sampling particles corresponding to the multiple channels.

In this embodiment, a statistical function is added to count the popularity of the channel, and whether the channel is a popular channel is determined according to the playing frequency of the channel in a period of time during the day.

In order to count whether a channel has a trigger condition for forming a hot channel, a separate process is required to be processed, two timers are set, when the timer 1 is triggered, a judgment whether the hot channel meets the creation condition is performed, the hot channel meeting the condition is created, but the hot channel judges whether the hot channel is still hot or not when the timer 2 is triggered, if not, the hot channel is deleted, and the specific process is as follows:

and setting a timing task, and starting the timing task at 6 points every day to count whether the channel meets the condition of forming the hot spot. The statistics need to be recorded into a data table of the IPTV system, wherein the table consists of four fields, the first field is a character type field S1, and a hot channel cid is recorded; the second field is an array type field S2 for recording the frequency of channel on demand in each day; the third field is an array type field S3 for recording the current state of the hot channel on each streaming media server; the fourth field is a boolean value S4 with values 0 and 1, where 1 indicates that the channel has formed a hot channel. And in a sampling period, recording the frequency of the channels providing services in each sampling granularity, recording an effective value of the sampling granularity to S2 according to a judgment condition after the time of each sampling granularity is over, recording 01 if the sampling granularity is effective, otherwise, recording 00, and determining whether the channels meet the condition of forming hot spots or not according to the value of the sampling granularity in one sampling period. S2 channel on-demand frequency calculation method: counting the channel on-demand times from 6 points every day to the next day in 1 point in the morning, setting the sampling period to be 1h, and setting the sampling granularity to be 15min, if the on-demand times of one channel in each granularity exceed 5 times, considering the sampling granules to be effective, and if 2 or more granules are effective in the sampling granularity contained in 1h of one sampling period, judging the channel to be a hot channel. If the channel has the condition of forming the hot spot, the management platform relays the channel to other streaming media servers, and if the channel relay is successful, the state of the channel on each streaming media server is recorded in S3, and meanwhile, if only one streaming media server successfully establishes the relay channel, the parameter S4 for recording the state of the hot spot channel is set to 1. When the channel does not satisfy the hot channel creation condition, the hot channel is not created, and the hot channel status parameter S4 is still 0. A timer is also set, and the hot channel formed in the previous day is deleted in the data table when the time of each day is 1 in the morning, so that a new hot channel is formed in a new day.

In this embodiment, the hot channel is determined not only by the number of on-demand times, which prevents some channels from having more on-demand users in one time point, but does not have any other time period to play, but determines whether the channel is the hot channel by the on-demand frequency, and the sampling period, the sampling granularity, and the number of on-demand times in each particle are flexibly configurable.

Step S240, selecting a second streaming media server from the plurality of streaming media servers, where the resource usage rate does not exceed a preset threshold, and creating a temporary channel corresponding to at least one channel on the second streaming media server.

In this embodiment, as shown in fig. 3, a user requests a channel live broadcast service from a node, a load balancing module on the user requests a database DB to send a resource query request, and returns a streaming media server SS1 capable of providing a user service, the streaming media service will report the resource usage to the DB to determine whether the resource exceeds a threshold, and if the resource exceeds the threshold, the streaming media service will enter into an automatic creation process of a hot channel. When the hot channel is triggered to be created, the responsible balancing module on the node inquires database table records from the DB, and judges whether channels with the on-demand frequency exceeding a threshold value exist on a streaming media server where the channels are located to perform the creation of the hot channel. When the hot channel is created, the load balancing module of the node sends a message to the DB to apply for creating the resources required by the temporary channel. And the DB reports the stream media resources where the inquired non-hotspot channels are located to the node, the node initiates the creation of the temporary channels, the creation of the temporary channels of the stream media server SS2 of the existing resources is successful, and otherwise, the creation of the stream media server SS3 is failed due to insufficient resources, and the reconstruction is continued for each 1S. And the hot channel which is failed to be established is continuously established until the next sampling period, and if the channel does not meet the hot channel establishing condition in the new sampling period, the temporary channel is failed to be established and cannot be established on the streaming media server.

Step S250, when creating a unicast channel as a hot spot channel, setting a channel outgoing address of the unicast channel as a multicast source address receivable by an uplink switch, and sending a code stream of the unicast channel to the uplink switch;

step S260, when acquiring the live broadcast request for the unicast channel, creating a multicast channel on another streaming media server outside the streaming media server where the unicast channel is located, and playing the multicast channel to the user by using the code stream from the uplink switch.

In this embodiment, for a known hot channel, a multicast channel in a node may be directly created at a service management portal, where the channel is created to fill a multicast source address that can be received by an uplink switch, and a channel code stream on a single streaming media server is multicast to other streaming media servers through the uplink switch, so as to implement sharing of the hot channel, but the method needs to plan a multicast group address in advance, and has certain requirements for network equipment. Although the technical scheme of the embodiment has relatively high requirements on data equipment, the hot channel can be manually identified in advance for presetting, so that when a user requests the channel to play, load balancing can be realized, and a plurality of servers provide services together.

In a specific example of the technical solution of this embodiment, a process of manually identifying and creating a hot channel is as follows: firstly, a hot channel is manually identified, a unicast channel is created on a service management portal, but the channel is filled with a multicast group address which can be received by an uplink switch. After the channel is established, the multicast code stream is sent to an upper connection exchanger, only the multicast code stream is allowed to be sent to the upper connection exchanger connected with the stream media server by limiting the TTL value, and simultaneously other stream media servers in the IPTV system are allowed to pull the multicast code stream to the exchanger to establish a multicast channel in each node. When a live broadcast user requests service, multicast channels in nodes are created on other streaming media servers, code streams come from a main channel and are sent to multicast code streams on an uplink switch, and after the channels are created, a management platform selects one server with relatively low resource utilization rate according to load balance to provide service.

And selecting one streaming media server from other streaming media servers to create the multicast channel according to the resource utilization rate of other streaming media servers except the streaming media server where the unicast channel is located.

In this embodiment, a channel live broadcast service flow in the IPTV system is also optimized, when a user requests a live broadcast, the user may determine whether the channel is a hot channel, a non-hot broadcast channel only provides a service by a streaming media server where the channel is located, and a multicast channel sends a code stream to the user by a multicast source, if the channel is the hot channel, an idle streaming media server is selected according to a comprehensive utilization rate of streaming media resources, which is as follows: when the streaming media server receives a live broadcast service request sent by a user, a channel live broadcast source address contained in the request of the request live broadcast server is obtained. If the obtained channel live broadcast source address is the multicast source address sent to the switch, the channel is a multicast channel, the channel outgoing code stream is sent to the multicast source of the network equipment, and the user can directly go to the multicast source of the network equipment to pull down the code stream. If the channel is a unicast channel but the obtained live broadcast source address of the channel is a multicast source address sent to the switch, the channel is a hot channel created manually, the type of channel code stream is sent to the uplink network equipment in a multicast mode, and a user selects a service with low resource utilization rate according to load balance when requesting to play. If the obtained live broadcast source address of the channel is a unicast address, the channel is indicated to be a unicast channel, and a data table needs to be inquired to confirm whether the channel is a hot channel. If the unicast channel is confirmed to be not the hot channel by the query database, the user can only provide service by the streaming media of the channel when sending the live broadcast request. If the channel requested by the user forms a hot channel, and the live broadcast user sends a request at this time, the load balancing module will determine to select service provided by all streaming media servers with free resources.

According to the technical scheme of the embodiment, through improvement and innovation on the channel creation process, the defect that the original live broadcast service of the multicast output frequency is not limited by the capacity of the streaming media server of the channel but is still limited by the read-write IO of the streaming media server of the channel after live broadcast is switched to the time shift is optimized, the hot channel can be provided with live broadcast and time shift requests by all the streaming media servers in the node, and the capacity of all the streaming media servers is fully exerted. Firstly, the channel which is judged to be the hot channel by manual work can be set as the hot channel on a service portal, the condition of judging whether the channel is the hot channel or not through a strategy is provided in the patent, and the channel which is judged to be the hot channel can be automatically established as the hot channel. The embodiment realizes the sharing of the hot channel among all the streaming media servers in the system, and the method for selecting one server to provide services more reasonably as a load balancing basis by calculating the comprehensive utilization rate of all the streaming media servers at the service side after the hot channel is established is considered; therefore, the method tends to be more reasonable, the server resource statistics is more accurate, and the full and stable utilization of resources is ensured. Other similar arrangements are within the scope of the claims.

As shown in fig. 4, an embodiment of the present invention provides a channel sharing device, which includes a processor 410, a memory 420, and a communication bus 430;

the communication bus 430 is used for realizing connection communication between the processor 410 and the memory 420;

the processor 410 is configured to execute the channel sharing program stored in the memory 420 to implement the following steps:

detecting resource utilization rates of a plurality of streaming media servers.

The method comprises the steps of selecting a first streaming media server with the resource utilization rate exceeding a preset threshold value from a plurality of streaming media servers, and detecting the on-demand condition of a plurality of channels in the first streaming media server.

And selecting at least one channel from the plurality of channels as a hot spot channel according to the on-demand conditions of the plurality of channels.

In this embodiment, first, the IPTV management platform issues a resource usage threshold to each streaming media server, and when the comprehensive resource usage rate of the subordinate streaming media servers exceeds the threshold, the IPTV management platform sets several channels with higher on-demand frequency recorded in the data table as hot channels.

And selecting a second streaming media server with the resource utilization rate not exceeding a preset threshold value from the plurality of streaming media servers, and creating a temporary channel corresponding to at least one channel on the second streaming media server.

In this embodiment, a temporary channel is automatically created to other streaming media servers by means of channel relay, so that each streaming media server can provide live broadcast and time shift services of a hot spot channel. And when the user service is provided, the management platform selects the streaming media server with relatively idle resource occupation to provide the live broadcast service according to the comprehensive utilization rate of the resources of each streaming media server reported by the load balancing module.

The IPTV service system of this embodiment is automatically implemented without requiring manual intervention and without special requirements for data devices, but if there is a certain delay, it is necessary to trigger a server resource threshold and form a hot channel, and then balance the service provision to each streaming media server.

As shown in fig. 4, an embodiment of the present invention provides a channel sharing device, which includes a processor 410, a memory 420, and a communication bus 430;

the communication bus 430 is used for realizing connection communication between the processor 410 and the memory 420;

the processor 410 is configured to execute the channel sharing program stored in the memory 420 to implement the following steps:

the method comprises the steps of obtaining a plurality of parameters of each streaming media server, substituting the parameters into a preset formula to calculate the resource utilization rate of each streaming media server when the parameters do not exceed preset values, and setting the resource utilization rate of each streaming media server as a preset fixed value when any one of the parameters exceeds the preset values.

In this embodiment, statistics of the comprehensive capacity of streaming media server resources is realized, and weighted calculation is performed according to the current statistics of the access flow usage rate of the streaming media server, the read-write IO usage rate of the disk, and the CPU and memory usage rate of the device, so as to provide a basis for the management platform to select which streaming media server through load balancing.

In this embodiment, when a channel is used as a hotspot channel to provide live broadcast service, it is mentioned that a streaming media server is selected to provide service through load balancing, where the load balancing is based on statistical comprehensive utilization rate of resources of each streaming media server, and the specific calculation method is as follows:

the parameter S5 represents that the flow occupation ratio of the streaming media server is (current ingress and egress traffic of the server + current egress/ingress traffic of the server)/the maximum traffic allocated to the server, except the current ingress and egress traffic of the current ingress and egress, the disk IO read-write usage rate, the CPU usage rate of the server, and the memory usage rate also need to be reflected in the comprehensive capacity of the server, and here, the parameters are represented by S6, S7, and S8, respectively; the comprehensive utilization rate S9 of the corresponding streaming media server is calculated by the formula:

if all of S7, S8, S9 are less than 90%, S9 ═ S6 × 60% + S7 × 20% + S8 × 10% + S9 × 10%;

if the values of S7, S8 and S9 are greater than or equal to 90%, S9 is 95%, and no user service is provided to the outside;

the above formula is represented by 60%, 20%, 10% and 10% as conversion coefficients of the current server flow occupation ratio, the disk IO read-write utilization ratio, the CPU utilization ratio and the memory utilization ratio in the comprehensive utilization ratio, and the conversion coefficients are obtained by performing logic analysis according to respective importance degree of the IPTV system running on the server. Meanwhile, in order to ensure the stable operation of the system, a certain threshold value is set, when the utilization rate of the service in the S7, the S8 and the S9 reaches more than 90%, the user service is not continuously provided to the outside, and the service quality of the current user is preferentially ensured. Meanwhile, reporting of the comprehensive capacity of the server requires setting a timer, wherein the current flow, the disk read-write IO, the CPU utilization rate and the memory utilization rate of the server are reported every 30S, and the comprehensive capacity utilization rate of each streaming media server is calculated according to the reported numerical values, so that the server with lower utilization rate is selected to provide user services.

In the embodiment, the CPU utilization rate, the memory utilization rate and the disk IO utilization rate are not calculated independently, the importance degree of each parameter value to the system is obtained through the call test of the actual user model, the parameter folding system is obtained by combining the performance bottleneck of the system hardware, and meanwhile, the abnormal protection under the condition that the utilization rates of the system CPU, the memory and the like are close to the upper limit of the system utilization is considered in the algorithm, so that each streaming media server can effectively, stably and maximally provide the resource capacity of the streaming media server.

The method comprises the steps of selecting a first streaming media server with the resource utilization rate exceeding a preset threshold value from a plurality of streaming media servers, and detecting the on-demand condition of a plurality of channels in the first streaming media server.

Sampling the on-demand times of the channels in a preset time period, dividing the time period into a plurality of sampling particles, taking the sampling particles with the on-demand times exceeding the preset times as effective sampling particles, and judging whether the channels are hot channels or not according to the number of the effective sampling particles corresponding to the channels.

In this embodiment, a statistical function is added to count the popularity of the channel, and whether the channel is a popular channel is determined according to the playing frequency of the channel in a period of time during the day.

In order to count whether a channel has a trigger condition for forming a hot channel, a separate process is required to be processed, two timers are set, when the timer 1 is triggered, a judgment whether the hot channel meets the creation condition is performed, the hot channel meeting the condition is created, but the hot channel judges whether the hot channel is still hot or not when the timer 2 is triggered, if not, the hot channel is deleted, and the specific process is as follows:

and setting a timing task, and starting the timing task at 6 points every day to count whether the channel meets the condition of forming the hot spot. The statistics need to be recorded into a data table of the IPTV system, wherein the table consists of four fields, the first field is a character type field S1, and a hot channel cid is recorded; the second field is an array type field S2 for recording the frequency of channel on demand in each day; the third field is an array type field S3 for recording the current state of the hot channel on each streaming media server; the fourth field is a boolean value S4 with values 0 and 1, where 1 indicates that the channel has formed a hot channel. And in a sampling period, recording the frequency of the channels providing services in each sampling granularity, recording an effective value of the sampling granularity to S2 according to a judgment condition after the time of each sampling granularity is over, recording 01 if the sampling granularity is effective, otherwise, recording 00, and determining whether the channels meet the condition of forming hot spots or not according to the value of the sampling granularity in one sampling period. S2 channel on-demand frequency calculation method: counting the channel on-demand times from 6 points every day to the next day in 1 point in the morning, setting the sampling period to be 1h, and setting the sampling granularity to be 15min, if the on-demand times of one channel in each granularity exceed 5 times, considering the sampling granules to be effective, and if 2 or more granules are effective in the sampling granularity contained in 1h of one sampling period, judging the channel to be a hot channel. If the channel has the condition of forming the hot spot, the management platform relays the channel to other streaming media servers, and if the channel relay is successful, the state of the channel on each streaming media server is recorded in S3, and meanwhile, if only one streaming media server successfully establishes the relay channel, the parameter S4 for recording the state of the hot spot channel is set to 1. When the channel does not satisfy the hot channel creation condition, the hot channel is not created, and the hot channel status parameter S4 is still 0. A timer is also set, and the hot channel formed in the previous day is deleted in the data table when the time of each day is 1 in the morning, so that a new hot channel is formed in a new day.

In this embodiment, the hot channel is determined not only by the number of on-demand times, which prevents some channels from having more on-demand users in one time point, but does not have any other time period to play, but determines whether the channel is the hot channel by the on-demand frequency, and the sampling period, the sampling granularity, and the number of on-demand times in each particle are flexibly configurable.

And selecting a second streaming media server with the resource utilization rate not exceeding a preset threshold value from the plurality of streaming media servers, and creating a temporary channel corresponding to at least one channel on the second streaming media server.

In this embodiment, as shown in fig. 3, a user requests a channel live broadcast service from a node, a load balancing module on the user requests a database DB to send a resource query request, and returns a streaming media server SS1 capable of providing a user service, the streaming media service will report the resource usage to the DB to determine whether the resource exceeds a threshold, and if the resource exceeds the threshold, the streaming media service will enter into an automatic creation process of a hot channel. When the hot channel is triggered to be created, the responsible balancing module on the node inquires database table records from the DB, and judges whether channels with the on-demand frequency exceeding a threshold value exist on a streaming media server where the channels are located to perform the creation of the hot channel. When the hot channel is created, the load balancing module of the node sends a message to the DB to apply for creating the resources required by the temporary channel. And the DB reports the stream media resources where the inquired non-hotspot channels are located to the node, the node initiates the creation of the temporary channels, the creation of the temporary channels of the stream media server SS2 of the existing resources is successful, and otherwise, the creation of the stream media server SS3 is failed due to insufficient resources, and the reconstruction is continued for each 1S. And the hot channel which is failed to be established is continuously established until the next sampling period, and if the channel does not meet the hot channel establishing condition in the new sampling period, the temporary channel is failed to be established and cannot be established on the streaming media server.

When a unicast channel serving as a hot channel is created, setting a channel outgoing address of the unicast channel as a multicast source address which can be received by an uplink switch, and transmitting a code stream of the unicast channel to the uplink switch;

when a live broadcast request for a unicast channel is acquired, a multicast channel is created on other streaming media servers outside the streaming media server where the unicast channel is located, and the multicast channel is played to a user by using a code stream from an uplink switch.

In this embodiment, for a known hot channel, a multicast channel in a node may be directly created at a service management portal, where the channel is created to fill a multicast source address that can be received by an uplink switch, and a channel code stream on a single streaming media server is multicast to other streaming media servers through the uplink switch, so as to implement sharing of the hot channel, but the method needs to plan a multicast group address in advance, and has certain requirements for network equipment. Although the technical scheme of the embodiment has relatively high requirements on data equipment, the hot channel can be manually identified in advance for presetting, so that when a user requests the channel to play, load balancing can be realized, and a plurality of servers provide services together.

In a specific example of the technical solution of this embodiment, a process of manually identifying and creating a hot channel is as follows: firstly, a hot channel is manually identified, a unicast channel is created on a service management portal, but the channel is filled with a multicast group address which can be received by an uplink switch. After the channel is established, the multicast code stream is sent to an upper connection exchanger, only the multicast code stream is allowed to be sent to the upper connection exchanger connected with the stream media server by limiting the TTL value, and simultaneously other stream media servers in the IPTV system are allowed to pull the multicast code stream to the exchanger to establish a multicast channel in each node. When a live broadcast user requests service, multicast channels in nodes are created on other streaming media servers, code streams come from a main channel and are sent to multicast code streams on an uplink switch, and after the channels are created, a management platform selects one server with relatively low resource utilization rate according to load balance to provide service.

And selecting one streaming media server from other streaming media servers to create the multicast channel according to the resource utilization rate of other streaming media servers except the streaming media server where the unicast channel is located.

In this embodiment, a channel live broadcast service flow in the IPTV system is also optimized, when a user requests a live broadcast, the user may determine whether the channel is a hot channel, a non-hot broadcast channel only provides a service by a streaming media server where the channel is located, and a multicast channel sends a code stream to the user by a multicast source, if the channel is the hot channel, an idle streaming media server is selected according to a comprehensive utilization rate of streaming media resources, which is as follows: when the streaming media server receives a live broadcast service request sent by a user, a channel live broadcast source address contained in the request of the request live broadcast server is obtained. If the obtained channel live broadcast source address is the multicast source address sent to the switch, the channel is a multicast channel, the channel outgoing code stream is sent to the multicast source of the network equipment, and the user can directly go to the multicast source of the network equipment to pull down the code stream. If the channel is a unicast channel but the obtained live broadcast source address of the channel is a multicast source address sent to the switch, the channel is a hot channel created manually, the type of channel code stream is sent to the uplink network equipment in a multicast mode, and a user selects a service with low resource utilization rate according to load balance when requesting to play. If the obtained live broadcast source address of the channel is a unicast address, the channel is indicated to be a unicast channel, and a data table needs to be inquired to confirm whether the channel is a hot channel. If the unicast channel is confirmed to be not the hot channel by the query database, the user can only provide service by the streaming media of the channel when sending the live broadcast request. If the channel requested by the user forms a hot channel, and the live broadcast user sends a request at this time, the load balancing module will determine to select service provided by all streaming media servers with free resources.

According to the technical scheme of the embodiment, through improvement and innovation on the channel creation process, the defect that the original live broadcast service of the multicast output frequency is not limited by the capacity of the streaming media server of the channel but is still limited by the read-write IO of the streaming media server of the channel after live broadcast is switched to the time shift is optimized, the hot channel can be provided with live broadcast and time shift requests by all the streaming media servers in the node, and the capacity of all the streaming media servers is fully exerted. Firstly, the channel which is judged to be the hot channel by manual work can be set as the hot channel on a service portal, the condition of judging whether the channel is the hot channel or not through a strategy is provided in the patent, and the channel which is judged to be the hot channel can be automatically established as the hot channel. The embodiment realizes the sharing of the hot channel among all the streaming media servers in the system, and the method for selecting one server to provide services more reasonably as a load balancing basis by calculating the comprehensive utilization rate of all the streaming media servers at the service side after the hot channel is established is considered; therefore, the method tends to be more reasonable, the server resource statistics is more accurate, and the full and stable utilization of resources is ensured. Other similar arrangements are within the scope of the claims.

One embodiment of the present invention provides a computer-readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to perform the steps of:

detecting resource utilization rates of a plurality of streaming media servers.

The method comprises the steps of selecting a first streaming media server with the resource utilization rate exceeding a preset threshold value from a plurality of streaming media servers, and detecting the on-demand condition of a plurality of channels in the first streaming media server.

And selecting at least one channel from the plurality of channels as a hot spot channel according to the on-demand conditions of the plurality of channels.

In this embodiment, first, the IPTV management platform issues a resource usage threshold to each streaming media server, and when the comprehensive resource usage rate of the subordinate streaming media servers exceeds the threshold, the IPTV management platform sets several channels with higher on-demand frequency recorded in the data table as hot channels.

And selecting a second streaming media server with the resource utilization rate not exceeding a preset threshold value from the plurality of streaming media servers, and creating a temporary channel corresponding to at least one channel on the second streaming media server.

In this embodiment, a temporary channel is automatically created to other streaming media servers by means of channel relay, so that each streaming media server can provide live broadcast and time shift services of a hot spot channel. And when the user service is provided, the management platform selects the streaming media server with relatively idle resource occupation to provide the live broadcast service according to the comprehensive utilization rate of the resources of each streaming media server reported by the load balancing module.

The IPTV service system of this embodiment is automatically implemented without requiring manual intervention and without special requirements for data devices, but if there is a certain delay, it is necessary to trigger a server resource threshold and form a hot channel, and then balance the service provision to each streaming media server.

It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.

The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.

Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.

While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

16页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:多媒体流服务方法及系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类