Live streaming scheduling method, apparatus and device, and computer readable storage medium
Patent Information
- Application Number
- CN202511594142.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-03
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2045-11-03
AI Technical Summary
当服务器所承担的流量负载超出其本身的所能承担的负载上限时,若流量无法被有效调度,会导致超限流量无法在该服务器参与组网,而是被动分发至其他服务器,而其他服务器需要重新拉取该直播流,增加了回源成本
[0011]本公开实施例提供的直播流调度方法、装置、设备及计算机可读存储介质,通过在第一服务器节点的流量负载超过限定值时,基于第一哈希算法确定第一服务器节点中需要被转出的直播流,并基于第二哈希算法重新确定该直播流的目标转出节点,将第一服务器节点中需要被转出的直播流调度至目标转出节点上以缓解第一服务器节点的负载压力,同时被调度的直播流也能够在目标转出节点上实现组网,能够解决出现非组网流量而导致的回源成本增加的问题。
Smart Images

Figure CN121397276B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of live streaming service technology, and in particular to a live streaming scheduling method, apparatus, device and computer-readable storage medium. Background Technology
[0002] Existing online live streaming is typically based on a Content Delivery Network (CDN). Based on user viewing requests, the server retrieves the live stream and distributes it to the user's device. For a single server, if it doesn't cache a particular live stream, it needs to retrieve the stream from an upstream server or the broadcaster's server when it receives a viewing request from a user. This process is called origin pull.
[0003] When a server distributes a live stream, the more users watching that stream, the greater the traffic load on the server. When the traffic load on a server exceeds its capacity, if the traffic cannot be effectively scheduled, the excess traffic cannot participate in the network on that server and is passively distributed to other servers. These other servers then need to fetch the live stream again, increasing the cost of back-to-origin service.
[0004] Therefore, there is an urgent need for an effective traffic scheduling method to reduce the origin-to-origin cost in live streaming services. Summary of the Invention
[0005] To address the aforementioned technical issues, this disclosure provides a live stream scheduling method, apparatus, device, and computer-readable storage medium to reduce the origin-following cost in live streaming services.
[0006] In a first aspect, embodiments of this disclosure provide a live stream scheduling method, including: When the traffic load value of the first server node among multiple preset server nodes is greater than the preset load threshold, at least one target live stream is determined among multiple live streams to be scheduled corresponding to the first server node based on the first hash algorithm. The first server node is used to process the acquisition requests of the live streams to be scheduled other than the target live stream among the multiple live streams to be scheduled. The identifier of each target live stream in the at least one target live stream is hashed based on the second hash algorithm to determine the second server node corresponding to each target live stream. The second server node is a server node other than the first server node among the plurality of preset server nodes. The first server node schedules the at least one target live stream to the second server node, and the second server node is used to process the live stream acquisition request of the target live stream.
[0007] Secondly, embodiments of this disclosure provide a live stream scheduling device, comprising: The first determining module is used to determine at least one target live stream among multiple live streams to be scheduled corresponding to the first server node based on a first hash algorithm when the traffic load value of the first server node among multiple preset server nodes is greater than a preset load threshold. The first server node is used to process the acquisition requests of the live streams to be scheduled other than the target live stream among the multiple live streams to be scheduled. The second determining module is used to perform hash calculation on the identifier of each target live stream in the at least one target live stream based on the second hash algorithm, and determine the second server node corresponding to each target live stream. The second server node is a server node other than the first server node among the plurality of preset server nodes. The scheduling module is used to schedule the at least one target live stream from the first server node to the second server node, and the second server node is used to process the live stream acquisition request of the target live stream.
[0008] Thirdly, embodiments of this disclosure provide a server, including: Memory; Processor; and Computer programs; The computer program is stored in the memory and configured to be executed by the processor to implement the method as described in the first aspect.
[0009] Fourthly, embodiments of this disclosure provide a computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the method described in the first aspect.
[0010] Fifthly, embodiments of this disclosure also provide a computer program product, which includes a computer program or instructions that, when executed by a processor, implement the live stream scheduling method as described above.
[0011] The live stream scheduling method, apparatus, device, and computer-readable storage medium provided in this disclosure, when the traffic load of the first server node exceeds a limit, determine the live stream that needs to be transferred out of the first server node based on a first hash algorithm, and re-determine the target transfer node of the live stream based on a second hash algorithm, and schedule the live stream that needs to be transferred out of the first server node to the target transfer node to alleviate the load pressure of the first server node. At the same time, the scheduled live stream can also form a network on the target transfer node, which can solve the problem of increased back-to-origin costs caused by non-networked traffic. Attached Figure Description
[0012] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0013] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0014] Figure 1 A flowchart of a live stream scheduling method provided in this embodiment of the disclosure; Figure 2 A schematic diagram illustrating an application scenario provided by an embodiment of this disclosure; Figure 3 A flowchart of a live stream scheduling method provided in another embodiment of this disclosure; Figure 4 This is a schematic diagram of the structure of the live stream scheduling device provided in the embodiments of this disclosure; Figure 5 This is a schematic diagram of the server structure provided in an embodiment of this disclosure. Detailed Implementation
[0015] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.
[0016] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.
[0017] This disclosure provides a live stream scheduling method, which will be described below with reference to specific embodiments.
[0018] Figure 1 A flowchart illustrating a live stream scheduling method provided in this embodiment of the disclosure. This method can be applied to... Figure 2 The application scenario shown includes multiple preset server nodes (n1, n2, and n3 as examples) and a scheduling control component 21 for scheduling live streams. The scheduling control component can be a component within any of the preset server nodes, or a component within a central server node other than the multiple preset server nodes.
[0019] The following is combined with Figure 2The application scenarios shown are for Figure 1 The live stream scheduling method shown is described below, and the specific steps of this method are as follows: S101. When the traffic load value of the first server node among multiple preset server nodes is greater than the preset load threshold, at least one target live stream is determined from the multiple live streams to be scheduled corresponding to the first server node based on the first hash algorithm.
[0020] The first server node is used to process requests for obtaining live streams other than the target live stream from among multiple live streams to be scheduled.
[0021] Multiple pre-planned server nodes refer to server nodes pre-planned and incorporated into the live streaming network resource pool within the Content Delivery Network (CDN) distributed cluster, such as... Figure 2 The server nodes n1, n2, and n3 are shown.
[0022] Optionally, the preset load threshold can be a load threshold set individually for the first server node, or a load threshold set together for multiple preset server nodes.
[0023] Optionally, the preset load threshold can be set after the first server node has already carried multiple live streams to be scheduled.
[0024] The traffic load value of the first server node is a load indicator value such as the total bandwidth of the live stream currently being handled by the first server node and the number of live stream acquisition requests. When the traffic load value of the first server node exceeds the preset load threshold, it means that the current load pressure of the first server node is relatively large and exceeds the ideal load level. In this case, some live streams need to be scheduled to other server nodes to alleviate the load pressure on the first server node.
[0025] Multiple pending live streams refer to the live streams currently being handled by the first server node. Before scheduling the live streams, the first server node processes the acquisition requests for multiple pending live streams, causing the traffic load value to exceed the preset load threshold.
[0026] The target live stream is the live stream that needs to be migrated from the first server node, selected by the first hash algorithm. After the scheduling control component schedules at least one target live stream to other nodes, the first server node only processes the remaining at least one live stream to be scheduled, and the traffic load value of the first server node is less than the preset load threshold.
[0027] S102. Based on the second hash algorithm, perform hash calculation on the identifier of each target live stream in at least one target live stream to determine the second server node corresponding to each target live stream.
[0028] The second server node is a server node other than the first server node among multiple preset server nodes.
[0029] Optionally, when the preset load threshold is a load threshold set for multiple preset server nodes, the traffic load value of the second server node is less than the preset load threshold.
[0030] Optionally, when the preset load threshold is a load threshold set separately for the first server node, the traffic load value of the second server node is less than the load threshold corresponding to the second server node.
[0031] The second hash algorithm can be a consistent hash algorithm, used to assign at least one target live stream to a second server node.
[0032] Optionally, the second hash algorithm differs from the first hash algorithm to ensure that the target live stream is not redistributed back to the first server node.
[0033] Each live stream has a unique identifier, which can be a unique string. For each target live stream, a second hash algorithm is used to map the target live stream's identifier to a specific value, which is then matched with the node identifier of the server node to determine the second server node corresponding to that target live stream.
[0034] S103. Schedule at least one target live stream from the first server node to the second server node.
[0035] The second server node is used to process the live stream acquisition requests of the target live stream.
[0036] The scheduling control component adjusts the routing rules for at least one target live stream, changing the original routing rule that directed the acquisition request for at least one target live stream to the first server node to the routing rule that directed the acquisition request for at least one target live stream to the second server node.
[0037] Therefore, when any subsequent server node receives a request to acquire at least one target live stream, it will send the acquisition request to the second server node, which will then process the acquisition request.
[0038] This embodiment of the disclosure, when the traffic load of the first server node exceeds a certain value, determines the live stream that needs to be transferred out of the first server node based on a first hash algorithm, and re-determines the target transfer node of the live stream based on a second hash algorithm. The live stream that needs to be transferred out of the first server node is scheduled to the target transfer node to alleviate the load pressure of the first server node. At the same time, the scheduled live stream can also form a network on the target transfer node, which can solve the problem of increased back-to-origin costs caused by non-networked traffic.
[0039] It is understandable that when at least one target live stream is rerouted from the first server node to the second server node, the traffic load value of the second server node may exceed the preset load threshold. In this case, the second server node whose traffic load value exceeds the preset load threshold is designated as the first server node, and steps S101 to S103 are executed. This process continues until the traffic load values of multiple preset server nodes are all less than or equal to the preset load threshold; or until the difference between the traffic load value of each preset server node and the average traffic load value of multiple preset server nodes is less than a preset difference value, at which point the multiple preset server nodes achieve load balancing.
[0040] The following describes the specific implementation method for determining at least one target live stream.
[0041] Specifically, the identifiers of multiple live streams to be scheduled are hashed based on the first hash algorithm to obtain the first hash value corresponding to each live stream to be scheduled; the first target range in the first value range is determined according to the live stream scheduling ratio of the first server node.
[0042] The first hash algorithm is used to map the identifiers of the live streams to be scheduled to a first value range. That is, after the first hash algorithm is applied, the identifiers of multiple live streams to be scheduled will be transformed into multiple first hash values distributed within the first value range.
[0043] The live stream scheduling ratio is used to determine the number of live streams allowed to be scheduled from the first server node, so that the ratio of the first target range to the first value range conforms to the live stream scheduling ratio.
[0044] Specifically, the live stream scheduling ratio is determined by the traffic load value of the first server node and the preset load value.
[0045] First, calculate the difference between the traffic load value of the first server node and the preset load threshold to obtain the traffic difference value. Next, calculate the ratio of the traffic difference value to the preset load threshold to obtain the live stream scheduling ratio.
[0046] It is understandable that since the traffic load value of the first server node is greater than the preset load threshold, the traffic difference obtained by subtracting the preset load threshold from the traffic load value of the first server node is a positive number, and the live stream scheduling ratio obtained by further calculation is also a positive number.
[0047] Therefore, the live stream scheduling ratio reflects the extent to which the current traffic load of the first server node exceeds the preset load threshold. In other words, if the traffic load of the first server node needs to be reduced to below the preset load threshold, the traffic load of the target live stream needs to be scheduled to other server nodes.
[0048] For example, if the preset load threshold is 5G, the current traffic load of the first server node is 6G, the traffic difference is 1G, and the live stream scheduling ratio is the ratio of 1G to 5G, which is 20%.
[0049] Based on the live stream scheduling ratio, the proportion of target live streams to the total number of live streams to be scheduled is calculated. Since the first hash algorithm hashes the first hash value corresponding to the live stream to be scheduled to a first value range, and the first target range is controlled as the product of the first value range and the live stream scheduling ratio, the probability that the first hash value belongs to the first target range meets the live stream scheduling ratio. Therefore, the proportion of live streams to be scheduled (i.e., target live streams) whose first hash value belongs to the first target range also meets the restriction of the live stream scheduling ratio.
[0050] For example, the live streams currently carried by the first server node are S1, S2, S3, S4, and S5, with a first value range of 0-1, and the live stream scheduling ratio is 20%. Assuming the first target range is 0-0.2, the first hash values corresponding to S1~S5 are calculated to be 0.12, 0.31, 0.57, 0.74, and 0.96 respectively. S1, corresponding to the first hash value of 0.12, is determined as the target live stream.
[0051] This embodiment calculates the live stream scheduling ratio corresponding to the first server node to ensure that the ratio of the target live stream to the live stream to be scheduled is consistent with the current traffic load value of the first server node exceeding the preset load threshold, thereby achieving on-demand scheduling, avoiding excessive scheduling of target live streams that would lead to resource waste of the first server node, and improving the accuracy of live stream scheduling.
[0052] Based on any of the above embodiments, for determining the second server node corresponding to each target live stream, one possible implementation is to obtain the node identifier of each server node other than the first server node among a plurality of preset server nodes; perform hash calculation on the identifier of each target live stream in at least one target live stream based on the second hash algorithm to obtain the second hash value corresponding to each target live stream; for each target live stream, determine the server node corresponding to the node identifier with the smallest difference from the second hash value as the second server node corresponding to the target live stream.
[0053] Each of the multiple preset server nodes is configured with a unique node identifier. For a target live stream, after obtaining the second hash value through the second hash algorithm, there is a server node whose node identifier is closest to the second server node. This node is then identified as the second server node, and the target live stream is scheduled to the second server node.
[0054] It is understood that the second server node is a server node other than the first server node among multiple preset server nodes. When calculating the difference between the second hash value and each node identifier, it is not necessary to consider the node identifier of the first server node.
[0055] Specifically, the method of hashing the identifier of each target live stream in at least one target live stream based on the second hash algorithm includes: reversing the characters included in the identifier of the target live stream to obtain the reverse identifier of the target live stream; and hashing the reverse identifier based on the second hash algorithm.
[0056] Optionally, when the first hash algorithm and the second hash algorithm are different, the identifier of the target live stream can be directly hashed to obtain the second hash value, or the first hash value and the second hash value of the same target live stream can be different.
[0057] If the first hash algorithm and the second hash algorithm are the same, then the characters included in the identifier of the target live stream need to be reversed to obtain a reverse identifier. The reverse identifier is then hashed based on the second hash algorithm to obtain a second hash value that is different from the first hash value.
[0058] Alternatively, if the first hash algorithm is different from the second hash algorithm, the characters included in the identifier of the target live stream can be reversed to obtain a reverse identifier. The reverse identifier can then be hashed based on the second hash algorithm to obtain a second hash value that is different from the first hash value.
[0059] The embodiments of this disclosure provide corresponding calculation methods based on whether the first hash algorithm and the second hash algorithm are the same or different, so that the live stream scheduling method provided by this disclosure can be adapted to different computing scenarios and improve the flexibility of the live stream scheduling method.
[0060] In some embodiments, a preset load ratio can be set for a cluster containing multiple preset server nodes, thereby enabling overall control of the load status in the cluster.
[0061] Correspondingly, the preset load threshold is the product of the preset maximum load value of the server node and the preset load ratio. If the traffic load value of each server node is controlled below the preset load threshold, the overall load traffic of the cluster containing multiple preset server nodes can be controlled below the preset load ratio of the preset overall load maximum value of the cluster.
[0062] The overall load traffic of the cluster is the sum of the traffic load values of multiple preset server nodes, and the preset maximum overall load of the cluster is the sum of the preset maximum load values of multiple preset server nodes.
[0063] For example, the preset load threshold of the first server node is the product of the preset maximum load value and the preset load ratio of the first server node.
[0064] If it is necessary to control the traffic load in the cluster below the preset load ratio, then when the overall load traffic of the cluster exceeds the product of the preset overall load maximum and the preset load ratio, the multiple live streams in the cluster need to be scheduled as a whole, and at least one live stream needs to be scheduled to a server node in another cluster.
[0065] Figure 3 A flowchart of a live stream scheduling method provided in another embodiment of this disclosure is shown below. Figure 3 As shown, the method includes the following steps: S301. Based on the third hash algorithm, perform hash calculation on the identifiers of multiple live streams to obtain the third hash value corresponding to each live stream.
[0066] Among them, multiple live streams are live streams carried by multiple preset server nodes. The third hash algorithm is used to map the identifier of the live stream to the second value range.
[0067] For example, such as Figure 2 The server node n1 corresponds to live streams S1, S2, and S3; server node n2 corresponds to live streams S4, S5, and S6; and server node n3 corresponds to live streams S7, S8, S9, and S10. The identifiers of live streams S1 through S10 are hashed using the third hash algorithm to obtain the corresponding third hash values for each stream.
[0068] Taking the second value range of 0-1 as an example, the third hash values corresponding to S1~S10 are 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, and 1.0, respectively.
[0069] S302. Determine multiple live streams to be scheduled from among multiple live streams based on the third hash value.
[0070] The ratio of the number of multiple live streams to be scheduled to the number of multiple live streams is the preset load ratio.
[0071] The live streams to be scheduled are those that, after being filtered by the third hash algorithm, are still retained in the current cluster for networking, such as the multiple live streams to be scheduled corresponding to the first server node.
[0072] Specifically, the second target range in the second value range is determined according to the preset load ratio, and the ratio of the second target range to the second value range is the preset load ratio; at least one live stream whose third hash value belongs to the second target range is determined as a live stream to be scheduled.
[0073] Since the third hash algorithm hashes the third hash value corresponding to the live stream to the second value range, and controls the second target range to be the product of the second value range and the preset load ratio, the probability that the third hash value belongs to the second target range meets the preset load ratio. Therefore, the proportion of live streams whose third hash value belongs to the second target range to the total number of live streams also meets the limitation of the preset load ratio.
[0074] Optionally, for live streams other than the multiple live streams to be scheduled, the node that initiated the request to obtain the live stream shall handle the request itself.
[0075] For example, the preset load ratio is set to 50%, the second value range is 0-0.5, and based on the third hash values corresponding to S1~S10 calculated in S301, the live streams to be scheduled include S1~S5.
[0076] Live streams S6 through S10 are processed by the node that initiated the request to acquire the live stream. Taking live stream S6 as an example, before filtering based on the third hash value, live stream S6 is networked on server node n2. The acquisition request for S6 is received by server node n4 (or another server node) and then sent to server node n2 for processing. After filtering based on the third hash value, server node n4, upon receiving the acquisition request for live stream S6, no longer sends it to server node n2 for processing; instead, it is processed by the server node that received the acquisition request for live stream S6 (server node n4 itself).
[0077] Therefore, multiple preset server nodes only need to process the requests for acquiring the live stream to be scheduled, and the sum of the load traffic values is less than the sum of the load traffic values before filtering.
[0078] S303. When the traffic load value of the first server node among multiple preset server nodes is greater than the preset load threshold, at least one target live stream is determined from the multiple live streams to be scheduled corresponding to the first server node based on the first hash algorithm.
[0079] Specifically, the identifiers of multiple live streams to be scheduled are hashed based on the first hash algorithm to obtain the first hash value corresponding to each live stream to be scheduled; the first target range in the first value range is determined according to the live stream scheduling ratio of the first server node.
[0080] After determining that the live streams to be scheduled include S1 to S5, the load pressure on server node n1 does not decrease because it still corresponds to live streams S1 to S3; while server node n3 does not have a corresponding live stream to be scheduled, and the load pressure between the nodes is not balanced.
[0081] Taking server node n1 as the first server node as an example, the traffic load value of server node n1 is greater than the preset load threshold, and the live stream scheduling ratio is 30%, with the first value range being 0~1 and the first target range being 0-0.3. Based on the first hash algorithm, the identifiers of S1~S3 are hashed respectively, and the first hash values corresponding to S1~S3 are 0.1, 0.5, and 0.8 respectively, thus determining that live stream S1 is the target live stream.
[0082] S304. Based on the second hash algorithm, perform hash calculation on the identifier of each target live stream in at least one target live stream to determine the second server node corresponding to each target live stream.
[0083] S305. Schedule at least one target live stream from the first server node to the second server node.
[0084] Taking live stream S1 as the target live stream as an example, the request to obtain S1 is no longer handled by server node n1. At this time, server node n1 is used to handle live streams S2 and S3, which reduces the load pressure compared to before the target live stream is scheduled.
[0085] Further hash calculations are performed on the identifier of live stream S1 based on the second hash algorithm to determine the second server node of live stream S1.
[0086] Assuming the second server node of live stream S1 is server node n3, live stream S1 is scheduled to server node n3. Subsequently, any node that receives a request to obtain live stream S1 will send it to server node n3 for processing.
[0087] This embodiment of the disclosure controls the overall load of multiple preset server nodes before scheduling the live stream among multiple preset server nodes, thereby ensuring that the overall load of the multiple preset server nodes is controllable, providing load space for subsequent live stream scheduling among nodes, and ensuring the stability of live stream scheduling.
[0088] Figure 4 This is a schematic diagram of the structure of a live stream scheduling device provided in an embodiment of this disclosure. The live stream scheduling device can be a scheduling control component as described in the above embodiment, or it can be a server node containing the scheduling control component. The live stream scheduling device provided in this embodiment can execute the processing flow provided in the live stream scheduling method embodiment, such as... Figure 4 As shown, the live stream scheduling device 40 includes: a first determining module 41, a second determining module 42, and a scheduling module 43; wherein, the first determining module 41 is used to determine at least one target live stream among multiple live streams to be scheduled corresponding to the first server node based on a first hash algorithm when the traffic load value of the first server node among multiple preset server nodes is greater than a preset load threshold, and the first server node is used to process the acquisition requests of the live streams to be scheduled other than the target live stream among the multiple live streams to be scheduled; the second determining module 42 is used to perform hash calculation on the identifier of each target live stream among the at least one target live stream based on a second hash algorithm to determine the second server node corresponding to each target live stream, and the second server node is a server node other than the first server node among multiple preset server nodes; the scheduling module 43 is used to schedule at least one target live stream from the first server node to the second server node, and the second server node is used to process the live stream acquisition requests of the target live stream.
[0089] Optionally, the first determining module 41 includes a first calculation unit, a first determining unit, and a second determining unit; the first calculation unit is used to perform hash calculations on the identifiers of multiple live streams to be scheduled based on a first hash algorithm to obtain a first hash value corresponding to each live stream to be scheduled, and the first hash algorithm is used to map the identifiers of the live streams to be scheduled to a first value range; the first determining unit is used to determine a first target range in the first value range according to the live stream scheduling ratio of the first server node, and the live stream scheduling ratio is used to determine the number of live streams allowed to be scheduled from the first server node, and the ratio of the first target range to the first value range is the live stream scheduling ratio; the second determining unit is used to determine at least one live stream to be scheduled whose first hash value belongs to the first target range as at least one target live stream.
[0090] Optionally, the first determining module 41 further includes a second calculation unit, used to calculate the difference between the traffic load value of the first server node and a preset load threshold before determining the target value range in the first value range based on the live stream scheduling ratio of the first server node, to obtain the traffic difference value; and to calculate the ratio of the traffic difference value to the preset load threshold to obtain the live stream scheduling ratio.
[0091] Optionally, the preset load threshold is the product of the preset maximum load value of the first server node and the preset load ratio; the live stream scheduling device 40 also includes a third determining module, which includes a third calculation unit and a third determining unit; the third calculation unit is used to perform hash calculation on the identifiers of multiple live streams based on the third hash algorithm to obtain the third hash value corresponding to each live stream; the third determining unit is used to determine multiple live streams to be scheduled among the multiple live streams according to the third hash value, and the ratio of the number of multiple live streams to be scheduled to the number of multiple live streams is the preset load ratio.
[0092] Optionally, the third hash algorithm is used to map the identifier of the live stream to the second value range, and the third determining unit is used to determine the second target range in the second value range according to the preset load ratio, the ratio of the second target range to the second value range is the preset load ratio; and at least one live stream whose third hash value belongs to the second target range is determined as a live stream to be scheduled.
[0093] Optionally, the second determining module 42 includes a reverse arrangement unit and a fourth calculation unit; the reverse arrangement unit is used to reverse the characters included in the identifier of the target live stream to obtain the reverse identifier of the target live stream; the fourth calculation unit is used to perform hash calculation on the reverse identifier based on the second hash algorithm.
[0094] Optionally, the second determining module 42 is used to obtain the node identifier of each server node other than the first server node among multiple preset server nodes; perform hash calculation on the identifier of each target live stream in at least one target live stream based on the second hash algorithm to obtain the second hash value corresponding to each target live stream; for each target live stream, determine the server node corresponding to the node identifier with the smallest difference from the second hash value as the second server node corresponding to the target live stream.
[0095] Figure 4 The live stream scheduling device shown in the embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar, and will not be described again here.
[0096] Figure 5 This is a schematic diagram of the server structure provided in an embodiment of this disclosure. The server may be a server node including the scheduling control components described in the above embodiments. The server provided in this embodiment of the disclosure can execute the processing flow provided in the live stream scheduling method embodiments, such as... Figure 5 As shown, server 50 includes: memory 51, processor 52, computer program and communication interface 53; wherein, the computer program is stored in memory 51 and configured to be executed by processor 52 as described above in the live stream scheduling method.
[0097] In addition, this disclosure also provides a computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the live stream scheduling method described in the above embodiments.
[0098] Furthermore, this disclosure also provides a computer program product, which includes a computer program or instructions that, when executed by a processor, implement the live stream scheduling method described above.
[0099] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0100] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A live stream scheduling method, characterized in that, The method includes: When the traffic load value of the first server node among multiple preset server nodes is greater than the preset load threshold, at least one target live stream is determined among multiple live streams to be scheduled corresponding to the first server node based on the first hash algorithm. The first server node is used to process the acquisition requests of the live streams to be scheduled other than the target live stream among the multiple live streams to be scheduled. The identifier of each target live stream in the at least one target live stream is hashed based on the second hash algorithm to determine the second server node corresponding to each target live stream. The second server node is a server node other than the first server node among the plurality of preset server nodes. The first server node schedules the at least one target live stream to the second server node, and the second server node is used to process the live stream acquisition request of the target live stream. The step of determining at least one target live stream among multiple live streams to be scheduled corresponding to the first server node based on the first hash algorithm includes: The identifiers of the multiple live streams to be scheduled are hashed based on the first hash algorithm to obtain the first hash value corresponding to each live stream to be scheduled. The first hash algorithm is used to map the identifier of the live stream to be scheduled to a first value range. The first target range in the first value range is determined based on the live stream scheduling ratio of the first server node. The live stream scheduling ratio is used to determine the number of live streams allowed to be scheduled from the first server node. The ratio of the first target range to the first value range is the live stream scheduling ratio. Determine at least one of the live streams to be scheduled whose first hash value belongs to the first target range as the at least one target live stream; The step of performing hash calculation on the identifier of each target live stream in the at least one target live stream based on the second hash algorithm to determine the second server node corresponding to each target live stream includes: for each target live stream, mapping the identifier of the target live stream to a specific value through the second hash algorithm, matching it with the node identifier of the server node, and determining the second server node corresponding to the target live stream.
2. The method according to claim 1, characterized in that, Before determining the target value range within the first value range based on the live stream scheduling ratio of the first server node, the method further includes: The traffic difference is obtained by subtracting the preset load threshold from the traffic load value of the first server node. The ratio of the traffic difference to the preset load threshold is calculated to obtain the live stream scheduling ratio.
3. The method according to any one of claims 1-2, characterized in that, The preset load threshold is the product of the preset maximum load value of the first server node and the preset load ratio; Before determining at least one target live stream among the multiple live streams to be scheduled corresponding to the first server node based on the first hash algorithm, the method further includes: The identifiers of multiple live streams are hashed using the third hash algorithm to obtain the third hash value corresponding to each live stream. The multiple live streams to be scheduled are determined based on the third hash value, and the ratio of the number of multiple live streams to be scheduled to the number of multiple live streams is the preset load ratio.
4. The method according to claim 3, characterized in that, The third hash algorithm is used to map the identifier of the live stream to a second value range. The step of determining the live stream to be scheduled among the multiple live streams based on the third hash value includes: The second target range in the second value range is determined according to the preset load ratio, and the ratio of the second target range to the second value range is the preset load ratio; At least one of the live streams whose third hash value belongs to the second target range is identified as the live stream to be scheduled.
5. The method according to any one of claims 1-2, characterized in that, The step of hashing the identifier of each target live stream in the at least one target live stream based on the second hash algorithm includes: The reverse identifier of the target live stream is obtained by reversing the order of the characters included in the identifier of the target live stream. The reverse identifier is hashed based on the second hash algorithm.
6. The method according to any one of claims 1-2, characterized in that, The step of hashing the identifier of each target live stream in the at least one target live stream based on the second hash algorithm to determine the second server node corresponding to each target live stream includes: Obtain the node identifier of each server node other than the first server node among the plurality of preset server nodes; The identifier of each target live stream in the at least one target live stream is hashed based on the second hash algorithm to obtain the second hash value corresponding to each target live stream; For each target live stream, the server node corresponding to the node identifier with the smallest difference from the second hash value is determined as the second server node corresponding to the target live stream.
7. A live stream scheduling device, characterized in that, include: The first determining module is used to determine at least one target live stream among multiple live streams to be scheduled corresponding to the first server node based on a first hash algorithm when the traffic load value of the first server node among multiple preset server nodes is greater than a preset load threshold. The first server node is used to process the acquisition requests of the live streams to be scheduled other than the target live stream among the multiple live streams to be scheduled. The second determining module is used to perform hash calculation on the identifier of each target live stream in the at least one target live stream based on the second hash algorithm, and determine the second server node corresponding to each target live stream. The second server node is a server node other than the first server node among the plurality of preset server nodes. The scheduling module is used to schedule the at least one target live stream from the first server node to the second server node, and the second server node is used to process the live stream acquisition request of the target live stream; The first determining module includes a first calculation unit, a first determining unit, and a second determining unit; The first calculation unit is used to perform hash calculations on the identifiers of multiple live streams to be scheduled based on the first hash algorithm to obtain the first hash value corresponding to each live stream to be scheduled. The first hash algorithm is used to map the identifiers of the live streams to be scheduled to a first value range. The first determination unit is used to determine the first target range in the first value range according to the live stream scheduling ratio of the first server node. The live stream scheduling ratio is used to determine the number of live streams allowed to be scheduled from the first server node. The ratio of the first target range to the first value range is the live stream scheduling ratio. The second determining unit is used to determine at least one live stream to be scheduled whose first hash value belongs to the first target range as at least one target live stream; The second determining module is used to map the identifier of each target live stream to a specific value using a second hash algorithm, and match it with the node identifier of the server node to determine the second server node corresponding to the target live stream.
8. A server, characterized in that, include: Memory; processor; as well as Computer programs; The computer program is stored in the memory and configured to be executed by the processor to implement the method as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Data storage method and device based on block chain, computer equipment, storage medium and computer program product
CN118607013A
Live stream load control method and device, electronic equipment and storage medium
CN119629376A
