Live stream load control method and device, electronic equipment and storage medium
By obtaining the load of the target node in the live broadcast scenario and determining and maintaining the service of the target live broadcast stream, the problems of wasted resources and high water level of new nodes during node replacement are solved, and efficient resource utilization and stability of service quality are achieved.
Patent Information
- Application Number
- CN202411804323.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-03-14
AI Technical Summary
In live broadcast scenarios, the process of node replacement can easily lead to waste of original node resources and excessive water level of new nodes, which will affect service quality.
By obtaining the current load of the target node, determining that the current load exceeds the preset upper limit, all services to be transferred on the live stream to be transferred are stopped, and services to the target live stream with a preset number ratio are maintained. The preset quantity ratio is the ratio of the target load to the current load, and the target live stream is determined by hash value calculation.
Effectively utilize the resources of the target nodes to avoid the water level of new nodes being too high, and prevent resource waste and service quality reduction.
Smart Images

Figure CN119629376A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network service technology, and in particular to a live streaming load method and device, an electronic device, and a storage medium. Background Art
[0002] At present, in the live broadcast scenario, the finest granularity of the actual content distribution network (CDN) to distribute content is the flow dimension. The content distribution network is a distributed network composed of edge node server clusters distributed in different regions. It distributes user content to edge nodes, effectively solving the Internet network congestion and improving the response speed of users accessing websites. In the scheduling scenario, scheduling is mostly performed according to the domain name dimension, which will cause a decrease in the hit rate (for example, the user requests the corresponding node according to the domain name, but there is no such flow on the node). In order to improve the hit rate, the same flow can be directed to the same node for service through means such as 302. However, this will also cause the water level of the node that undertakes this flow to be too high, resulting in problems with the node service quality, and scheduling is required for relevant control.
[0003] In related technologies, when the node water level (the ratio of the node load to the node threshold, reflecting the node load level) is too high, the node will be prohibited from providing services, and another node will be used to replace the node with excessive load. After directly replacing the node, the new node will take over all the traffic from the previous node, causing the new node to quickly increase in capacity and run full, resulting in an avalanche due to the high water level. At the same time, the original node will quickly decrease in capacity, resulting in a waste of resources.
[0004] Therefore, there are technical problems in the related art such as waste of original node resources and too high water level of new node during node replacement. Summary of the invention
[0005] The present application provides a load control method and device for a live stream, an electronic device and a storage medium, so as to at least solve the technical problem of waste of node resources during node replacement in the related art.
[0006] According to one aspect of an embodiment of the present application, a method for controlling a load of a live stream is provided, comprising:
[0007] Get the current load of the target node;
[0008] When it is determined that the current load exceeds a preset upper limit, all current live streams in the target node are determined;
[0009] Determine a preset number ratio of target live streams from all the current live streams, wherein the preset number ratio is a ratio of the target load to the current load;
[0010] Stop the services of all live streams to be transferred in the target node, and maintain the services of all target live streams, wherein the live streams to be transferred are other current live streams in the current live stream except all the target live streams.
[0011] Optionally, as in the aforementioned method, the step of determining a preset number of target live streams from all the current live streams includes:
[0012] Determine a hash value corresponding to each current live stream;
[0013] According to the preset quantity ratio and based on the hash value, the target live stream is determined from all the current live streams.
[0014] Optionally, as in the aforementioned method, determining the hash value corresponding to each current live stream includes:
[0015] Determine a live stream identifier corresponding to each current live stream;
[0016] Hash values are calculated for all live stream identifiers to obtain the hash value corresponding to each current live stream.
[0017] Optionally, as in the aforementioned method, performing hash value calculation on all live stream identifiers to obtain the hash value corresponding to each current live stream includes:
[0018] The live stream identifier is input into a preset hash algorithm to obtain the hash value corresponding to each current live stream.
[0019] Optionally, as in the aforementioned method, the hash algorithm is the FNV-1a hash algorithm.
[0020] Optionally, as in the aforementioned method, determining the target live stream from all the current live streams according to the preset quantity ratio and based on the hash value includes:
[0021] Determine, from among all the current live streams, a designated live stream whose hash value is less than the preset number ratio, wherein a value range of the hash value is consistent with a value range of the preset number ratio;
[0022] The designated live stream is determined as the target live stream.
[0023] Optionally, as in the aforementioned method, after stopping the services of all live streams to be transferred in the target node, the method further includes:
[0024] Determine a designated node to receive the live stream to be transferred from among all candidate nodes;
[0025] The designated node is controlled to pull the live stream to be transferred, so as to provide a service for the live stream to be transferred through the designated node.
[0026] According to another aspect of the embodiment of the present application, a load control device for a live stream is provided, characterized in that it includes:
[0027] The acquisition module is used to obtain the current load of the target node;
[0028] A determination module, used to determine all current live streams in the target node when it is determined that the current load exceeds a preset upper limit;
[0029] A target live stream determination module, used to determine a preset number of target live streams in all the current live streams, wherein the preset number ratio is a ratio of the target load to the current load;
[0030] A processing module is used to stop the services of all live streams to be transferred in the target node and maintain the services for all target live streams, wherein the live streams to be transferred are other current live streams in the current live stream except all the target live streams.
[0031] According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; wherein the memory is used to store a computer program; and the processor is used to execute the method steps in any of the above embodiments by running the computer program stored in the memory.
[0032] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the method steps in any of the above embodiments when executed.
[0033] In an embodiment of the present application, the current load of the target node is obtained; when it is determined that the current load exceeds a preset upper limit, all current live streams in the target node are determined; a preset number of target live streams are determined among all the current live streams, wherein the preset number ratio is the ratio of the target load to the current load; the service of all live streams to be transferred is stopped in the target node, and the service of all target live streams is maintained, wherein the live streams to be transferred are other current live streams in the current live streams except all the target live streams, by continuing to serve the preset number of target live streams in the target node, and stopping the service of other live streams to be transferred, so that the resources in the target node will not be idle, even if the live stream to be transferred is transferred to the same new node, it will not cause the water level of the new node to be too high, thereby avoiding problems with the service quality of the new node; thereby achieving the technical effect of effectively utilizing the resources of the target node and avoiding the water level of the new node being too high, thereby solving the technical problem of waste of original node resources and too high water level of the new node during node replacement in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0035] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0036] Figure 1 It is a flow chart of an optional live streaming load control method according to an embodiment of the present application;
[0037] Figure 2 is a flow chart of an optional live streaming load control method according to another embodiment of the present application;
[0038] Figure 3 is a flow chart of an optional live streaming load control method according to another embodiment of the present application;
[0039] Figure 4 is a flow chart of an optional live streaming load control method according to another embodiment of the present application;
[0040] Figure 5 is a flow chart of an optional live streaming load control method according to another embodiment of the present application;
[0041] Figure 6 is a structural block diagram of an optional live streaming load control device according to an embodiment of the present application;
[0042] Figure 7 It is a structural block diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0043] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0044] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0045] According to one aspect of an embodiment of the present application, a method for controlling a load of a live stream is provided. Optionally, in this embodiment, the method for controlling a load of a live stream can be applied to Figure 1 In the hardware environment composed of terminal 1402 and server 1404 shown in FIG. Figure 1 As shown, server 1404 is connected to terminal 1402 via a network, and can be used to provide services (such as game services, application services, etc.) for the terminal or a client installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for server 1404.
[0046] The above network may include but is not limited to at least one of the following: wired network, wireless network. The above wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the above wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal may not be limited to a PC, a mobile phone, a tablet computer, etc.
[0047] The load control method of the live streaming of the embodiment of the present application can be executed by a server, or by a terminal, or by both a server and a terminal. The terminal can also execute the load control method of the live streaming of the embodiment of the present application by a client installed thereon.
[0048] Taking the live streaming load control method in this embodiment executed by the server as an example, Figure 2 A method for controlling a live stream load provided in an embodiment of the present application includes the following steps:
[0049] Step S202, obtaining the current load of the target node.
[0050] The live streaming load control method in this embodiment can be applied to scenarios where it is necessary to control the resources of a node used to serve the live streaming.
[0051] In this embodiment, the target node can be any edge node in any content distribution network. The edge node is also called CDN node, Cache node, etc., which refers to a network node with fewer intermediate links from the end user access and has better response capability and connection speed for the end access user. The content distribution network effectively solves the Internet network congestion by distributing user content to edge nodes and improves the response speed of users accessing websites.
[0052] In the live broadcast scenario, it is necessary to ensure that the content can be transmitted to users quickly and stably. Therefore, it is necessary to ensure the stability of the target node to avoid overload. In addition, the node load can be obtained as follows:
[0053] Monitoring tools can help monitor the load of nodes in real time by monitoring tool sets and analyzing the performance data of target nodes. Optional monitoring tools and technologies may include: Prometheus: an open source monitoring and alarm system that can be used to collect and store node monitoring data; Grafana: used to visualize monitoring data and can display the load of nodes; Zabbix: an enterprise-level monitoring tool that supports monitoring network devices, servers, applications, etc.
[0054] In addition, the target node itself can also regularly report its status information, including CPU usage, memory usage, network bandwidth usage, etc. It can report its current status by sending heartbeat packets to the central management system at regular intervals; in addition, it can also actively report the status when the target node status changes significantly (such as CPU usage reaches a threshold), etc.
[0055] Step S204, when it is determined that the current load exceeds the preset upper limit, all current live streams in the target node are determined.
[0056] Specifically, a preset upper limit of the target node may be preset, and the preset upper limit may be a preset value used to characterize that the node water level (the ratio of the node load to the node threshold, reflecting the node load level) of the target node is too high, for example, 0.9, 0.8, etc.
[0057] When it is determined that the current load exceeds the preset upper limit, it means that there are too many users watching the live broadcast through the target node, that is, the current live stream served by the target node has a high viewing volume, which has caused a large load on the target node. Therefore, the target node needs to stop serving some of the current live streams. Based on this, it is necessary to determine all the current live streams currently served by the target node.
[0058] Step S206, determining a preset number ratio of target live streams from all current live streams, wherein the preset number ratio is a ratio of the target load to the current load.
[0059] In this embodiment, the target live stream that needs to be continued to be served is determined according to the ratio of the target load to the current load. The target load is the load required to control the target node. Therefore, the preset quantity ratio can be obtained by dividing the target load by the current load. The target live stream is the live stream that needs to be continued to be served by the target node.
[0060] In general, a node will be used to serve multiple live streams. When there are a large number of live streams, a preset number of target live streams can be selected by randomly selecting all current live streams. Since the target node serves a large number of current live streams, even if the loads corresponding to different live streams are different, the ratio between the target load corresponding to the target live stream selected in this way and the current load will also be close to the preset number ratio.
[0061] like Figure 3 As shown, as an optional implementation, the step S206 of determining a preset number of target live streams in all current live streams can be implemented by the following steps S302 and S304:
[0062] Step S302, determining a hash value corresponding to each current live stream.
[0063] That is to say, a hash value calculation may be performed on each current live stream, thereby obtaining a hash value corresponding to each current live stream. Generally, the hash values corresponding to different live streams are different.
[0064] like Figure 4As shown, as an optional implementation, the step 302 of determining the hash value corresponding to each current live stream can be implemented by the following steps:
[0065] Step S402: Determine a live stream identifier corresponding to each current live stream.
[0066] Generally, in order to distinguish different live streams, a live stream identifier uniquely corresponding to each live stream is generated in advance, and then the live stream identifier corresponding to each current live stream can be directly determined.
[0067] Step S404, performing hash value calculation on all live stream identifiers to obtain a hash value corresponding to each current live stream.
[0068] That is to say, in this embodiment, the hash value corresponding to each current live stream is obtained by calculating the hash value of the live stream identifier. Furthermore, in this embodiment, the hash value corresponding to each current live stream is obtained by inputting the live stream identifier into a preset hash algorithm. Optionally, the hash algorithm can be MD5, SHA-1, SHA-256, FNV-1a, etc. Preferably, the hash algorithm is the FNV-1a hash algorithm. By adopting the FNV-1a hash algorithm, the characteristics of fast calculation speed and uniform distribution of hash value calculation can be achieved, so that the load corresponding to all target live streams can be closer to the target load, thereby achieving a better load control effect.
[0069] Step S304: determine the target live stream from all current live streams according to a preset quantity ratio and based on the hash value.
[0070] After determining the preset quantity ratio, since the hash value generally satisfies the characteristic of uniform distribution within the value range (for example, between 0-1), the target live stream can be determined by interval selection in the hash value. For example, within the hash value interval, the current live stream in the sub-interval of the preset quantity ratio is randomly selected as the target live stream.
[0071] For example, when the preset quantity ratio is 0.3 and the hash value range is [0,1], the current live stream with a hash value in the interval [0,0.3] can be determined as the target live stream, the current live stream with a hash value in the interval [0.1,0.4] can be determined as the target live stream, the current live stream with a hash value in the interval [0.7,1] can be determined as the target live stream, and so on. They are not listed one by one here.
[0072] As an optional implementation, the aforementioned step S304 can be implemented by the following steps to determine the target live stream among all current live streams according to the preset quantity ratio and based on the hash value: among all current live streams, determine the designated live stream whose hash value is less than the preset quantity ratio, wherein the value range of the hash value is consistent with the value range of the preset quantity ratio; determine the designated live stream as the target live stream. That is, in this embodiment, the value range of the hash value is consistent with the value range of the preset quantity ratio, that is, when the value range of the preset quantity ratio is [0,1], the value range of the hash value is also [0,1]; when the value range of the preset quantity ratio is [0,100], the value range of the hash value is also [0,100]. Furthermore, after determining the hash value of the current live stream, directly use the designated live stream whose hash value is less than the preset quantity ratio as the target live stream. For example, when the preset number ratio is 0.3 and the hash value range is [0,1], the current live stream with a hash value less than 0.3 can be determined as the target live stream; when the preset number ratio is 0.4 and the hash value range is [0,1], the current live stream with a hash value less than 0.4 can be determined as the target live stream.
[0073] Step S208, stopping the services of all live streams to be transferred in the target node, and maintaining the services of all target live streams, wherein the live streams to be transferred are other current live streams in the current live stream except all target live streams.
[0074] After determining the target live stream, other current live streams except all target live streams can be determined as live streams to be transferred that need to be served by other nodes. Therefore, the service of all live streams to be transferred can be stopped in the target node and the service of all target live streams can be maintained.
[0075] Through the method of this embodiment, by continuing to serve a preset proportion of target live streams in the target node and stopping the service for other live streams to be transferred, the resources in the target node will not be idle, and even if the live streams to be transferred are transferred to the same new node, the water level of the new node will not be too high, thereby avoiding problems with the service quality of the new node; thereby achieving the technical effect of effectively utilizing the resources of the target node and avoiding the water level of the new node being too high, thereby solving the technical problems of waste of original node resources and too high water level of the new node during node replacement in the related technology.
[0076] like Figure 5 As shown, as an optional implementation, as in the above method, after stopping the services of all live streams to be transferred in the target node in step S208, the method further includes the following steps:
[0077] Step S502: Determine a designated node to undertake the transfer of the live stream from among all candidate nodes.
[0078] Specifically, the relevant implementation methods of the aforementioned embodiments can be executed by the central SDC (Service Discovery and Control Center), and after determining the live stream to be transferred, the central SDC can determine an idle designated node among all candidate nodes under its control that can be used to take over the above-mentioned transferred live stream.
[0079] Step S504, controlling the designated node to pull the live stream to be transferred, so as to provide services for the live stream to be transferred through the designated node.
[0080] After determining the designated node, the central SDC can instruct the designated node to pull the live stream to be transferred, so that the designated node can provide services for the live stream to be transferred; further, the designated node can include one or more, and then all the live streams to be transferred can be transferred to the same designated node or to different nodes.
[0081] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0082] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM (Read-Only Memory) / RAM (Random Access Memory), a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of each embodiment of the present application.
[0083] According to another aspect of an embodiment of the present application, a live stream load control device for implementing the above-mentioned live stream load control method is also provided. Figure 6is a structural block diagram of an optional live stream load control device according to an embodiment of the present application, such as Figure 6 As shown, the device may include:
[0084] An acquisition module 61 is used to acquire the current load of the target node;
[0085] A determination module 62, configured to determine all current live streams in the target node when it is determined that the current load exceeds a preset upper limit;
[0086] The target live stream determination module 63 is used to determine a preset number of target live streams in all current live streams, wherein the preset number ratio is a ratio of the target load to the current load;
[0087] The processing module 64 is used to stop the services of all live streams to be transferred in the target node and maintain the services for all target live streams, wherein the live streams to be transferred are other current live streams in the current live stream except all target live streams.
[0088] It should be noted that the acquisition module 61 in this embodiment can be used to execute the above step S202, the determination module 62 in this embodiment can be used to execute the above step S204, the target live stream determination module 63 in this embodiment can be used to execute the above step S206, and the processing module 64 in this embodiment can be used to execute the above step S208.
[0089] Through the above module, by continuing to serve a preset proportion of target live streams in the target node and stopping the service for other live streams to be transferred, the resources in the target node will not be idle. Even if the live streams to be transferred are transferred to the same new node, the water level of the new node will not be too high, thus avoiding problems with the service quality of the new node. The technical effect of effectively utilizing the resources of the target node and avoiding the water level of the new node being too high is achieved, thereby solving the technical problems of waste of original node resources and too high water level of the new node during node replacement in related technologies.
[0090] As an optional implementation, as in the aforementioned device, the target live stream determination module 63 includes:
[0091] A hash value determination submodule, used to determine a hash value corresponding to each current live stream;
[0092] The target live stream determination submodule is used to determine the target live stream from all current live streams according to a preset quantity ratio and based on a hash value.
[0093] As an optional implementation, in the aforementioned device, the hash value determination submodule includes:
[0094] A live stream identifier determination unit, used to determine a live stream identifier corresponding to each current live stream;
[0095] The hash value calculation unit is used to calculate the hash values of all live stream identifiers to obtain the hash value corresponding to each current live stream.
[0096] As an optional implementation, in the aforementioned device, the hash value calculation unit is used to:
[0097] The live stream identifier is input into a preset hash algorithm to obtain a hash value corresponding to each current live stream.
[0098] As an optional implementation, as in the aforementioned device, the hash algorithm adopts the FNV-1a hash algorithm.
[0099] As an optional implementation, in the aforementioned device, the target live stream determination submodule includes:
[0100] A comparison unit, configured to determine, from among all current live streams, a designated live stream whose hash value is less than a preset number ratio, wherein a value range of the hash value is consistent with a value range of the preset number ratio;
[0101] The determination unit is used to determine the specified live stream as the target live stream.
[0102] As an optional implementation, the aforementioned device further includes a migration unit, wherein the migration unit is configured to:
[0103] Among all candidate nodes, determine the designated node to receive and transfer the live stream;
[0104] The designated node is controlled to pull the live stream to be transferred, so as to provide services for the live stream to be transferred through the designated node.
[0105] The device in this embodiment, in addition to the above-mentioned modules, may also include a module for executing any method in any of the above-mentioned embodiments of the load control method for live streaming.
[0106] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments. It should be noted that the above modules as part of the device can be run in Figure 1 In the hardware environment shown, it can be implemented by software or by hardware, wherein the hardware environment includes a network environment.
[0107] According to another aspect of an embodiment of the present application, an electronic device for implementing the above-mentioned live streaming load control method is also provided. The electronic device may be a server, a terminal, or a combination thereof.
[0108] According to another embodiment of the present application, there is also provided an electronic device, including: Figure 7 As shown, the electronic device may include: a processor 1501 , a communication interface 1502 , a memory 1503 and a communication bus 1504 , wherein the processor 1501 , the communication interface 1502 , and the memory 1503 communicate with each other via the communication bus 1504 .
[0109] Memory 1503, used for storing computer programs;
[0110] The processor 1501 is used to implement the following steps when executing the program stored in the memory 1503:
[0111] Step S202, obtaining the current load of the target node.
[0112] Step S204, when it is determined that the current load exceeds the preset upper limit, all current live streams in the target node are determined.
[0113] Step S206, determining a preset number ratio of target live streams from all current live streams, wherein the preset number ratio is a ratio of the target load to the current load.
[0114] Step S208, stopping the services of all live streams to be transferred in the target node, and maintaining the services of all target live streams, wherein the live streams to be transferred are other current live streams in the current live stream except all target live streams.
[0115] Optionally, in this embodiment, the above-mentioned communication bus can be a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface is used for communication between the above-mentioned electronic device and other devices.
[0116] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0117] As an example, the memory 1503 may include, but is not limited to, the acquisition module 61, the determination module 62, the target live stream determination module 63, and the processing module 64 in the live stream load control device. In addition, it may also include, but is not limited to, other module units in the live stream load control device, which will not be repeated in this example.
[0118] The above-mentioned processor can be a general-purpose processor, which can include but not be limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processor), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0119] An embodiment of the present application further provides a computer-readable storage medium, the storage medium including a stored program, wherein the method steps of the above method embodiment are executed when the program is run.
[0120] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a ROM, a RAM, a mobile hard disk, a magnetic disk, or an optical disk.
[0121] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0122] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
[0123] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0124] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0125] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution provided in this embodiment.
[0126] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0127] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for controlling the load of a live stream, characterized in that: include: Get the current load of the target node; When it is determined that the current load exceeds a preset upper limit, all current live streams in the target node are determined; Determine a preset number ratio of target live streams from all the current live streams, wherein the preset number ratio is a ratio of the target load to the current load; Stop the services of all live streams to be transferred in the target node, and maintain the services of all target live streams, wherein the live streams to be transferred are other current live streams in the current live stream except all the target live streams.
2. The method according to claim 1, characterized in that The step of determining a preset number of target live streams in proportion to all current live streams includes: Determine a hash value corresponding to each current live stream; According to the preset quantity ratio and based on the hash value, the target live stream is determined from all the current live streams.
3. The method according to claim 2, characterized in that The determining of the hash value corresponding to each current live stream includes: Determine a live stream identifier corresponding to each current live stream; Hash values are calculated for all live stream identifiers to obtain the hash value corresponding to each current live stream.
4. The method according to claim 3, characterized in that The performing hash value calculation on all live stream identifiers to obtain the hash value corresponding to each current live stream includes: The live stream identifier is input into a preset hash algorithm to obtain the hash value corresponding to each current live stream.
5. The method according to claim 4, characterized in that The hash algorithm is the FNV-1a hash algorithm.
6. The method according to claim 2, characterized in that The determining the target live stream from all the current live streams according to the preset quantity ratio and the hash value includes: Determine, from among all the current live streams, a designated live stream whose hash value is less than the preset number ratio, wherein a value range of the hash value is consistent with a value range of the preset number ratio; The designated live stream is determined as the target live stream.
7. The method according to any one of claims 1 to 6, characterized in that After stopping the services of all the live streams to be transferred in the target node, the method further includes: Determine a designated node to receive the live stream to be transferred from among all candidate nodes; The designated node is controlled to pull the live stream to be transferred, so as to provide a service for the live stream to be transferred through the designated node.
8. A load control device for live streaming, characterized in that: include: The acquisition module is used to obtain the current load of the target node; A determination module, used to determine all current live streams in the target node when it is determined that the current load exceeds a preset upper limit; A target live stream determination module, used to determine a preset number ratio of target live streams from all the current live streams, wherein the preset number ratio is a ratio of the target load to the current load; A processing module is used to stop the services of all live streams to be transferred in the target node and maintain the services for all target live streams, wherein the live streams to be transferred are other current live streams in the current live stream except all the target live streams.
9. An electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein: The processor, the communication interface and the memory communicate with each other via the communication bus, wherein: The memory is used to store computer programs; The processor is configured to execute the method according to any one of claims 1 to 7 by running the computer program stored in the memory.
10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 7 when executed.
Citation Information
Cited By
Live broadcast stream scheduling method, apparatus and device, and computer readable storage medium
CN121397276A