Live broadcast back-to-source processing method and device, computing equipment, storage medium and product

By querying and transferring back to the source node in the CDN cluster, the problem of multiple sources in the live broadcast return source is solved, the return source convergence is achieved, and the load on the source station is reduced.

CN119629375APending Publication Date: 2025-03-14SHANGHAI BILIBILI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411769509.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

The existing live broadcast return method has multiple return sources, resulting in the increase in bandwidth and load pressure of the source station.

Method used

By receiving the return source query request sent by the CDN node at any level in the live return source path, check whether there is a current return source node that is performing the return source task of the target live stream in the CDN cluster to which the CDN node belongs. If the current return source nodes are large and meet the preset conditions, the hash ring of the CDN cluster will be reconstructed, the target return source node is determined, and the return source link is forwarded to the target return source node.

Benefits of technology

The return source convergence is achieved, which avoids long-term multiple return sources due to hash ring changes, and reduces the load and pressure of the source station or next-level CDN cluster.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119629375A_ABST
    Figure CN119629375A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a live broadcast back-to-source processing method and device, computing equipment, a storage medium and a product, and the method comprises the steps: receiving a back-to-source query request for a target live broadcast stream sent by any level of CDN node in a live broadcast back-to-source path; according to the back-to-source query request, querying whether a current back-to-source node which is executing a back-to-source task of the target live broadcast stream exists in a CDN cluster to which the CDN node belongs; and if the number of the current back-to-source nodes is multiple and the current back-to-source nodes meet the preset back-to-source transfer starting condition, reconstructing a hash ring corresponding to the CDN cluster according to available CDN nodes in the CDN cluster, determining a target back-to-source node from the CDN cluster according to the hash ring, and transferring a back-to-source link of the current back-to-source node to the target back-to-source node. According to the method and the device, long-time multi-path back-to-source caused by Hash ring change is effectively avoided through a back-to-source switching mode, and the load and pressure of a source station or a next-level CDN cluster are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of Internet technology, and specifically to a live broadcast back-to-source processing method, apparatus, computing device, storage medium, and product. Background Art

[0002] Currently, CDN technology can be applied to various businesses, among which live broadcast business is a relatively critical one. Since the business scenario of live broadcast requires real-time data, it is necessary to obtain real-time live media data through back-to-source means to provide it to users for viewing. In order to avoid causing greater pressure on the source station, CDN usually converges user requests to the same node through back-to-source convergence and other means before returning to the source station.

[0003] In the prior art, a hashing method is usually used to select CDN nodes for executing back-to-source tasks, and the back-to-source tasks are converged to one CDN node as much as possible to achieve the effect of back-to-source convergence. However, when the number of nodes changes due to service iteration or node offline, the hash ring will change, resulting in the back-to-source not being able to completely converge to one CDN node. In the scenario of back-to-source requests using long links (such as requests based on the flv protocol), there will be multiple back-to-source situations, which will increase the bandwidth and load pressure of the source station. Summary of the invention

[0004] In view of the above problems, the present application proposes a live broadcast back-to-source processing method, apparatus, computing device, storage medium and product to solve the following problems: the existing live broadcast back-to-source method has multiple back-to-source situations, which increases the pressure on the source station.

[0005] According to one aspect of an embodiment of the present application, a live broadcast source return processing method is provided, including:

[0006] Receive a back-to-source query request for a target live stream sent by a CDN node at any level in the live back-to-source path;

[0007] According to the back-to-source query request, query whether there is a current back-to-source node that is executing the back-to-source task of the target live stream in the CDN cluster to which the CDN node belongs;

[0008] If there are multiple back-to-source nodes at present and they meet the preset back-to-source transfer start conditions, the hash ring corresponding to the CDN cluster is reconstructed according to the available CDN nodes in the CDN cluster, and the target back-to-source node is determined from the CDN cluster based on the hash ring, and the back-to-source link of the current back-to-source node is transferred to the target back-to-source node.

[0009] Furthermore, the method further comprises:

[0010] Receive the flow information of the back-to-source tasks performed by the CDN nodes at all levels in the live back-to-source path.

[0011] Furthermore, according to the back-to-source query request, querying whether there is a current back-to-source node that is executing the back-to-source task of the target live stream in the CDN cluster to which the CDN node belongs further includes:

[0012] In the stream information reported by each CDN node in the CDN cluster, it is checked whether there is target stream information corresponding to the stream identifier of the target live stream and in a stream pulling state;

[0013] If so, the CDN node that reports the target stream information is used as the current back-to-source node that is executing the back-to-source task of the target live stream.

[0014] Furthermore, transferring the back-to-source link of the current back-to-source node to the target back-to-source node further includes:

[0015] A back-to-source forwarding command containing the address of the target back-to-source node is sent to the CDN cluster, and a back-to-source link of the target back-to-source node is established so that the CDN cluster can change the back-to-source link for the target live stream to the address of the target back-to-source node, and disconnect the back-to-source links of other back-to-source nodes in the current back-to-source node except the target back-to-source node.

[0016] Furthermore, the method further comprises:

[0017] If the current back-to-origin node does not exist, the target back-to-origin node is determined from the CDN cluster based on the hash ring corresponding to the CDN cluster;

[0018] Determine whether the CDN node is the target back-to-origin node;

[0019] If the CDN node is the target back-to-source node, determine whether there is a next-level CDN node after the CDN node in the live back-to-source path;

[0020] If there is a CDN node at the next level of the CDN node, the next level target back-to-origin node is determined from the next level CDN cluster according to the hash ring corresponding to the next level CDN cluster and the flow information corresponding to the next level CDN cluster, and the address of the next level target back-to-origin node is sent to the CDN node;

[0021] If there is no CDN node at the next level of the CDN node, the address of the source station is sent to the CDN node;

[0022] If the CDN node is not the target back-to-origin node, the address of the target back-to-origin node is sent to the CDN node.

[0023] Furthermore, the method further comprises:

[0024] Detect whether the next-level return-to-source links of different CDN clusters at any level in the live broadcast return-to-source path for the target live broadcast stream correspond to different CDN nodes in the same CDN cluster at the next level;

[0025] If they correspond to different CDN nodes in the same CDN cluster at the next level and meet the preset back-to-source transfer start conditions, the hash ring corresponding to the CDN cluster will be reconstructed according to the available CDN nodes in the CDN cluster at the next level, and the target back-to-source node at the next level will be determined from the CDN cluster based on the hash ring, and the next-level back-to-source link of the target live stream of different CDN clusters at any level will be transferred to the target back-to-source node at the next level.

[0026] Furthermore, the preset back-to-source switching start condition includes: a start time condition and a back-to-source path number condition.

[0027] According to another aspect of an embodiment of the present application, a live broadcast source return processing device is provided, including:

[0028] A receiving module, adapted to receive a back-to-source query request for a target live stream sent by a CDN node at any level in a live back-to-source path;

[0029] A query module, adapted to query whether there is a current back-to-source node that is executing a back-to-source task of a target live stream in the CDN cluster to which the CDN node belongs according to a back-to-source query request;

[0030] The switching module is suitable for reconstructing the hash ring corresponding to the CDN cluster according to the available CDN nodes in the CDN cluster if there are multiple current back-to-source nodes and they meet the preset back-to-source switching start conditions, and determining the target back-to-source node from the CDN cluster based on the hash ring, and switching the back-to-source link of the current back-to-source node to the target back-to-source node.

[0031] According to another aspect of the embodiment of the present application, there is provided a computing device, including: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;

[0032] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute operations corresponding to the above-mentioned live broadcast back-to-source processing method.

[0033] According to another aspect of the embodiments of the present application, a computer storage medium is provided, in which at least one executable instruction is stored, and the executable instruction enables a processor to perform operations corresponding to the above-mentioned live broadcast back-to-source processing method.

[0034] According to another aspect of the embodiments of the present application, a computer program product is provided, including at least one executable instruction, which enables a processor to perform operations corresponding to the above-mentioned live broadcast back-to-source processing method.

[0035] According to the technical solution provided in the embodiment of the present application, a back-to-source convergence mechanism is set for each level of CDN nodes in the live back-to-source path. When a CDN node at any level in the live back-to-source path receives a new back-to-source request for a target live stream, it sends a back-to-source query request to the data center, and the data center queries whether there is a current back-to-source node that is executing the back-to-source task of the target live stream in the CDN cluster to which the CDN node belongs. If there are multiple current back-to-source nodes, it means that there are multiple back-to-source situations, and if the current situation meets the preset back-to-source forwarding start conditions, the back-to-source forwarding function is started to converge the back-to-source task to the target back-to-source node for processing, thereby achieving back-to-source convergence. The back-to-source forwarding method effectively avoids long-term multi-path back-to-source caused by hash ring changes, thereby reducing the load and pressure on the source station or the next-level CDN cluster.

[0036] The above description is only an overview of the technical solution of the embodiment of the present application. In order to more clearly understand the technical means of the embodiment of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiment of the present application more obvious and easy to understand, the specific implementation method of the embodiment of the present application is listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only used for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the embodiments of the present application. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0038] Figure 1 A schematic diagram of a live broadcast source return processing method according to an embodiment of the present application is shown;

[0039] Figure 2 A schematic diagram of a flow chart of a live broadcast source return processing method according to another embodiment of the present application is shown;

[0040] Figure 3 A structural block diagram of a live broadcast source return processing device according to an embodiment of the present application is shown;

[0041] Figure 4 A schematic diagram of the structure of a computing device according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0042] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0043] First, the terms involved in one or more embodiments of the present application are explained.

[0044] CDN: Content Delivery Network is an intelligent virtual network built on the existing network. It deploys nodes at the edge of the network to cache the static resources of the website to edge nodes closer to the user, thereby improving user access speed, reducing bandwidth consumption, and increasing concurrent capacity. The CDN distribution system is usually a tree-like structure that relies on layering and port multiplexing to improve the load capacity of the entire system. The edge CDN node close to the user obtains real-time media streams or static files from the source station through layers of back-to-source according to the decision of the scheduling system, thereby providing services to users.

[0045] Live Streaming: refers to the transmission of video content to the audience in real time, with users watching the same content at the same time with no delay or little delay.

[0046] FLV (Flash Video) protocol: is a streaming media format; because the files it forms are extremely small and load very quickly, it makes it possible to watch video files on the Internet. Its appearance effectively solves the problem that after the video files are imported into Flash, the exported SWF files become huge in size and cannot be used well on the Internet.

[0047] QPS (Queries Per Second): is an indicator to measure system performance, indicating the number of requests processed per second.

[0048] Cluster: refers to a collection of many CDN nodes deployed in the same area.

[0049] Figure 1 A schematic diagram of a live broadcast source return processing method according to an embodiment of the present application is shown. Figure 1 As shown, the method comprises the following steps:

[0050] Step S101: receiving a back-to-source query request for a target live stream sent by a CDN node at any level in a live back-to-source path.

[0051] In the embodiment of the present application, the live broadcast back-to-source path used is: client → multi-level CDN node → source station. Each level of CDN node in the live broadcast back-to-source path can be set with a back-to-source convergence mechanism to reduce the bandwidth and QPS pressure of the next level service.

[0052] When a CDN node at any level in the live broadcast back-to-source path receives a new back-to-source request, the back-to-source request is used to request to obtain the media data of the target live broadcast stream. Before back-to-source, the CDN node first accesses the data center and sends a back-to-source query request for the target live broadcast stream to the data center. The data center receives the back-to-source query request and determines the target back-to-source node for executing the back-to-source task of the target live broadcast stream based on the back-to-source query request.

[0053] Step S102: According to the back-to-source query request, it is queried in the CDN cluster to which the CDN node belongs whether there is a current back-to-source node that is executing the back-to-source task of the target live broadcast stream.

[0054] In the embodiment of the present application, a flow information reporting mechanism is set up, and the data center provides a reporting interface for CDN nodes at all levels in the live broadcast back-to-source path, so that CDN nodes at all levels can report the flow information of the back-to-source tasks they perform to the data center through the reporting interface. According to the reported flow information, the data center can clearly know the information of the live streams existing in each CDN node, which live streams are in the pull state, which live streams are in the deregistered state, etc. Among them, the flow information may include the flow identifier of the live stream, the processing state, the corresponding CDN node, the CDN cluster to which the corresponding CDN node belongs, and other information.

[0055] After receiving a back-to-source query request sent by a CDN node, the data center can query whether there is a current back-to-source node that is executing the back-to-source task of the target live stream in the CDN cluster based on the stream information of the CDN cluster to which the CDN node belongs.

[0056] Step S103: If there are multiple back-to-source nodes at present and the preset back-to-source switching start condition is met, a hash ring corresponding to the CDN cluster is reconstructed according to the available CDN nodes in the CDN cluster.

[0057] If the query finds that there is a current back-to-source node in the CDN cluster, and the number of current back-to-source nodes is multiple, it means that there are multiple back-to-source paths for the target live stream in the CDN cluster. The back-to-source switching function can be started to achieve back-to-source convergence and converge the back-to-source task of the target live stream to a CDN node in the CDN cluster. In the embodiment of the present application, in order to avoid the back-to-source effect being affected by too frequent back-to-source switching, a preset back-to-source switching start condition is also set. The preset back-to-source switching start condition can limit the start time of the back-to-source switching function, the number of back-to-source paths required to be met, etc.

[0058] When there are multiple return sources for the target live stream and the current situation meets the preset return source switching start conditions, the hash ring corresponding to the CDN cluster is reconstructed according to the available CDN nodes in the CDN cluster. The hash ring is a virtual ring structure, and the nodes are arranged on the ring in the order of hash values.

[0059] Step S104: determine the target back-to-source node from the CDN cluster according to the hash ring, and transfer the back-to-source link of the current back-to-source node to the target back-to-source node.

[0060] Specifically, a hash function can be used to perform hash calculation on the stream identifier (such as the stream name, etc.) of the target live stream to obtain the hash value corresponding to the target live stream. According to the hash value corresponding to the target live stream, the target back-to-source node responsible for executing the back-to-source task of the target live stream is searched on the hash ring. Then, the back-to-source link of the current back-to-source node is transferred to the target back-to-source node, and the back-to-source task of the target live stream in the CDN cluster is converged to the target back-to-source node for processing, thereby achieving back-to-source convergence.

[0061] According to the live broadcast source return processing method provided by the embodiment of the present application, a source return convergence mechanism is set for each level of CDN nodes in the live broadcast source return path. When a CDN node at any level in the live broadcast source return path receives a new source return request for the target live stream, it sends a source return query request to the data center, and the data center queries whether there is a current source return node that is executing the source return task of the target live stream in the CDN cluster to which the CDN node belongs. If there are multiple current source return nodes, it means that there are multiple source returns. If the current situation meets the preset source return forwarding start conditions, the source return forwarding function is started to converge the source return task to the target source return node for processing, thereby achieving source return convergence. The source return forwarding method effectively avoids long-term multi-path source returns due to hash ring changes, and reduces the load and pressure on the source station or the next-level CDN cluster.

[0062] Figure 2 A flowchart of a live broadcast source return processing method according to another embodiment of the present application is shown. Figure 2 As shown, the method comprises the following steps:

[0063] Step S201: receiving a back-to-source query request for a target live stream sent by a CDN node at any level in a live back-to-source path.

[0064] In the embodiment of the present application, the live broadcast back-to-source path used is: client → multi-level CDN node → source station. Taking the multi-level CDN node as two levels as an example, the first-level CDN node can be specifically an edge CDN node, and the second-level CDN node can be specifically a secondary convergence CDN node. In other words, the live broadcast back-to-source path is: client → edge CDN node → secondary convergence CDN node → source station. In the embodiment of the present application, each level of CDN node in the live broadcast back-to-source path can be set with a back-to-source convergence mechanism to reduce the bandwidth and QPS pressure of the next level service.

[0065] Assume that when an edge CDN node in the live broadcast back-to-source path receives a new back-to-source request, the back-to-source request is used to request to obtain the media data of the target live broadcast stream. Before back-to-source, the edge CDN node first accesses the data center and sends a back-to-source query request for the target live broadcast stream to the data center. The data center receives the back-to-source query request and determines the target back-to-source node for executing the back-to-source task of the target live broadcast stream based on the back-to-source query request.

[0066] Step S202: According to the back-to-source query request, it is queried in the CDN cluster to which the CDN node belongs whether there is a current back-to-source node that is executing the back-to-source task of the target live broadcast stream.

[0067] In order to facilitate the identification of multi-path back-to-source situations, the data center provides a reporting interface for CDN nodes at all levels in the live back-to-source path, so that CDN nodes at all levels can report the flow information of the back-to-source tasks they perform to the data center through the reporting interface. The data center then receives the flow information of the back-to-source tasks they perform reported by CDN nodes at all levels in the live back-to-source path, and caches and processes the received flow information.

[0068] The stream information may include the stream identifier, processing status, corresponding CDN node, and CDN cluster to which the corresponding CDN node belongs of the live stream. Specifically, the processing status may include the start-up stream pulling status, the deregistration stream pulling status, etc.; when the CDN node starts the stream pulling for a certain live stream, the processing status in the reported stream information is the start-up stream pulling status; when the CDN node deregisters the stream pulling for a certain live stream, the processing status in the reported stream information is the deregistration stream pulling status, indicating that no user comes to pull the media data of the live stream and the return to the source is interrupted; if for a certain live stream, the data center not only receives the stream information with the processing status of the start-up stream pulling status reported by a certain CDN node, but also receives the stream information with the processing status of the deregistration stream pulling status afterwards, then it means that the CDN node has completed the return to the source task of the live stream; if for a certain live stream, the data center only receives the stream information with the processing status of the start-up stream pulling status reported by a certain CDN node, and has not received the stream information with the processing status of the deregistration stream pulling status reported by it afterwards, then it means that the stream information is in the stream pulling state and the CDN node is executing the return to the source task of the live stream.

[0069] In addition to storing the stream information reported by CDN nodes at all levels, the data center also stores the CDN node information in the CDN clusters at all levels in the live broadcast back-to-source path. The data center processes this information, builds the hash ring required for back-to-source convergence of CDN clusters at all levels, and determines the target back-to-source node for back-to-source convergence, thereby providing back-to-source address access for CDN nodes at all levels.

[0070] Specifically, after receiving a back-to-source query request sent by a CDN node, the data center queries whether there is target stream information that corresponds to the stream identifier of the target live stream and is in a stream pulling state in the stream information reported by each CDN node in the CDN cluster to which the CDN node belongs; if so, the CDN node that reports the target stream information is used as the current back-to-source node that is executing the back-to-source task of the target live stream; if not, it means that there is no current back-to-source node.

[0071] Step S203: If the current back-to-source node does not exist, determine the target back-to-source node from the CDN cluster according to the hash ring corresponding to the CDN cluster.

[0072] In the absence of a current back-to-source node, the data center needs to select the target back-to-source node responsible for executing the back-to-source task of the target live stream through the hash ring mode. Specifically, the stream identifier (such as the stream name, etc.) of the target live stream can be hashed using a hash function to obtain the hash value corresponding to the target live stream, and the matching CDN node is searched on the hash ring as the target back-to-source node according to the hash value corresponding to the target live stream.

[0073] Step S204, determine whether the CDN node is the target back-to-origin node; if so, execute step S205; if not, execute step S208.

[0074] Step S205, determine whether there is a next-level CDN node after the CDN node in the live broadcast back-to-source path; if so, execute step S206; if not, execute step S207.

[0075] Considering that the live broadcast return-to-source path contains multiple levels of CDN nodes, when the CDN node is determined to be the target return-to-source node, it is also necessary to determine whether there is a next-level CDN node after the CDN node in the live broadcast return-to-source path, so that the data center can send the corresponding return-to-source address to the CDN node according to the specific situation for it to return to the source.

[0076] Step S206, determining the next-level target back-to-origin node from the next-level CDN cluster according to the hash ring corresponding to the next-level CDN cluster and the flow information corresponding to the next-level CDN cluster, and sending the address of the next-level target back-to-origin node to the CDN node.

[0077] If there is a CDN node at the next level after the CDN node, the data center will send the address of the target back-to-source node at the next level to the CDN node, so that the CDN node can return to the target back-to-source node at the next level according to the address. Among them, the data center determines the target back-to-source node at the next level from the CDN cluster at the next level based on the hash ring corresponding to the CDN cluster at the next level and the flow information corresponding to the CDN cluster at the next level. The specific method of determining the target back-to-source node at the next level is similar to the method of determining the target back-to-source node at the current level, and will not be repeated here.

[0078] Step S207: Send the address of the source site to the CDN node.

[0079] If there is no next-level CDN node after the CDN node, it means that the source station needs to be returned next. The data center can send the address of the source station to the CDN node so that the CDN node can return to the source station according to the address.

[0080] Step S208: Send the address of the target back-source node to the CDN node.

[0081] When the CDN node is not the target back-to-source node, it means that the determined target back-to-source node is another CDN node in the same cluster. In this case, the address of the target back-to-source node is sent to the CDN node so that the CDN node can transfer the back-to-source task of the target live stream to the target back-to-source node for processing, thereby ensuring that the back-to-source task of the target live stream is converged to a CDN node in the CDN cluster for processing.

[0082] Step S209: If the number of the current back-to-source node is 1, the current back-to-source node is used as the target back-to-source node, and then the process jumps to step S204 to step S208.

[0083] If the number of current back-source nodes is 1, it means that there is no multi-path back-source situation for the target live stream in the CDN cluster, and the current back-source node can be directly used as the target back-source node. Then jump to step S204 to step S208 to determine and process whether the current CDN node is the target back-source node and whether there is a next-level CDN node in the live back-source path.

[0084] Step S210: If the number of current back-to-source nodes is multiple and meets the preset back-to-source switching start condition, a hash ring corresponding to the CDN cluster is reconstructed according to the available CDN nodes in the CDN cluster.

[0085] Normally, for the same live stream, there will only be one CDN node in a CDN cluster that goes back and forth to the next-level CDN cluster or source station. However, if a CDN node goes offline, the number of available CDN nodes in the CDN cluster changes, or the CDN node fails or is delayed in reporting stream information, multiple routes back to the source will be caused.

[0086] If it is found that there is a current back-to-source node in the CDN cluster, and the number of current back-to-source nodes is multiple, it means that there are multiple back-to-source situations for the target live stream in the CDN cluster, and the back-to-source switching function can be started to achieve back-to-source convergence. Considering that multiple offline times during service iteration will lead to multiple back-to-source in a short period of time, in order to avoid the back-to-source effect being affected by too frequent back-to-source switching, a preset back-to-source switching start condition is also set. Those skilled in the art can set the preset back-to-source switching start condition according to actual needs, which is not limited here. For example, the preset back-to-source switching start condition may include: a start time condition and a back-to-source number condition. Specifically, the start time condition may record the time interval required to be met between two adjacent back-to-source switching starts, and the back-to-source number condition may record the number of paths required to be met for the back-to-source switching start. The number of back-to-source paths in the current situation can be determined according to the number of current back-to-source nodes. For example, if the number of current back-to-source nodes is 3, it means that the number of back-to-source paths in the current situation is 3. In actual applications, the preset back-to-source transfer start conditions can also be customized according to different operators and different CDN clusters to meet various back-to-source transfer requirements.

[0087] In the case where there are multiple return sources for the target live stream and the current situation does not meet the preset return source switching start conditions, it means that there is no need to start the return source switching function, and it can be processed according to the existing common return source method. For example, the target return source node can be determined from the CDN cluster according to the hash ring corresponding to the CDN cluster to which the CDN node belongs, or a current return source node can be selected from multiple current return source nodes as the target return source node, and then steps S204 to S208 are executed to determine and process whether the current CDN node is the target return source node and whether there is a CDN node at the next level in the live return source path.

[0088] When there are multiple return sources for the target live stream and the current situation meets the preset return source switching start conditions, the hash ring corresponding to the CDN cluster is reconstructed according to the available CDN nodes in the CDN cluster. Specifically, the data center maps the node identifier (such as IP address, node ID, etc.) of each available CDN node currently in the CDN cluster to the same hash space through the same hash function, and arranges the hash values ​​corresponding to these node identifiers in order on the ring to form a ring structure, thereby completing the reconstruction of the hash ring corresponding to the CDN cluster.

[0089] Step S211, determine the target back-to-source node from the CDN cluster according to the hash ring, and transfer the back-to-source link of the current back-to-source node to the target back-to-source node.

[0090] After determining the target back-to-source node, the data center starts the back-to-source switching function, sends the back-to-source switching command containing the address of the target back-to-source node to the CDN cluster, and establishes the back-to-source link of the target back-to-source node. Specifically, the back-to-source switching command can be sent to all CDN nodes in the CDN cluster, so that the CDN cluster can change the back-to-source link for the target live stream to the address of the target back-to-source node, and disconnect the back-to-source links of other back-to-source nodes in the current back-to-source node except the target back-to-source node. Then, the execution of steps S204 to S208 can be jumped to determine and process whether the current CDN node is the target back-to-source node and whether there is a CDN node at the next level in the live back-to-source path.

[0091] For example, the current back-to-source nodes include CDN node A and CDN node D, and the target back-to-source node is CDN node A. If the back-to-source forwarding function is enabled, the back-to-source address for the target live stream in the CDN cluster will be changed to the address of CDN node A, and the original link to CDN node D will be disconnected. In order to reduce the impact of back-to-source forwarding on user stream pulling, the back-to-source link of the address of CDN node A can be connected first, and then the back-to-source link of CDN node D can be disconnected, which effectively ensures that only one CDN node in the CDN cluster performs the back-to-source task of the target live stream, conveniently realizes the back-to-source convergence within the cluster, avoids the occurrence of long-term multi-path back-to-source situations, and reduces the pressure on the source station or the next-level CDN cluster.

[0092] Optionally, the embodiment of the present application provides not only the back-to-source switching function within a cluster, but also the back-to-source switching function between clusters. For example, for the target live stream, different CDN nodes at the same level pull different CDN nodes in the same CDN cluster at the next level. In this case, the back-to-source switching function between clusters can be enabled.

[0093] Specifically, the method also includes: detecting whether the next-level return-to-source links of different CDN clusters at any level in the live broadcast return-to-source path for the target live broadcast stream correspond to different CDN nodes in the same CDN cluster at the next level; if they correspond to different CDN nodes in the same CDN cluster at the next level and meet the preset return-to-source switching start conditions, then reconstructing the hash ring corresponding to the CDN cluster according to the available CDN nodes in the CDN cluster at the next level, and determining the next-level target return-to-source node from the CDN cluster based on the hash ring, and switching the next-level return-to-source links of different CDN clusters at any level for the target live broadcast stream to the target return-to-source node at the next level.

[0094] For example, for the target live stream, edge CDN cluster A returns to the secondary convergence CDN node D in the secondary convergence CDN cluster C, and edge CDN cluster B returns to the secondary convergence CDN node F in the secondary convergence CDN cluster C. If the current situation meets the preset return-to-source forwarding start conditions, the data center can send a return-to-source forwarding command to edge CDN cluster A and edge CDN cluster B to change the return-to-source address to the address of the correct secondary convergence CDN node. Similarly, a new link can be established first and then the original link can be disconnected.

[0095] The live broadcast source return processing method provided by the embodiment of the present application provides a flow information reporting function and a source return switching function within a cluster and between clusters. According to the source return query request for the target live broadcast stream sent by the CDN node at any level in the live broadcast source return path, it is queried based on the reported flow information whether there is a current source return node that is executing the source return task of the target live broadcast stream in the CDN cluster to which the CDN node belongs. If there are multiple current source return nodes, it means that there are multiple source return situations. In order to avoid affecting the source return effect due to excessively frequent source return switching, a preset source return switching start condition is also set. When the current situation meets the preset source return switching start condition, the cluster is started. The back-to-source forwarding function within the group; in addition, when different CDN nodes at the same level pull different CDN nodes in the same CDN cluster of the next level, the back-to-source forwarding function between clusters can be enabled; during the back-to-source forwarding process, the back-to-source address is changed through the background, and the back-to-source link of the target back-to-source node is first established and then the original back-to-source link is disconnected, so that the back-to-source task is converged to the target back-to-source node for processing. This not only achieves back-to-source convergence, but also effectively avoids long-term multi-path back-to-source caused by hash ring changes through back-to-source forwarding, reduces the load and pressure of the source station or the next-level CDN cluster, and the back-to-source forwarding is imperceptible to users and will not affect their live viewing experience.

[0096] Figure 3 A structural block diagram of a live broadcast source return processing device according to an embodiment of the present application is shown. Figure 3 As shown, the device includes: a receiving module 310, a query module 320 and a switching module 330.

[0097] The receiving module 310 is adapted to receive a back-to-source query request for a target live stream sent by a CDN node at any level in a live back-to-source path.

[0098] The query module 320 is adapted to: query whether there is a current back-to-source node that is executing a back-to-source task of a target live broadcast stream in the CDN cluster to which the CDN node belongs according to a back-to-source query request.

[0099] The switching module 330 is suitable for: if there are multiple current back-to-source nodes and they meet the preset back-to-source switching start conditions, then the hash ring corresponding to the CDN cluster is reconstructed according to the available CDN nodes in the CDN cluster, and the target back-to-source node is determined from the CDN cluster based on the hash ring, and the back-to-source link of the current back-to-source node is switched to the target back-to-source node.

[0100] Optionally, the receiving module 310 is further adapted to: receive stream information of the back-to-source tasks executed by the CDN nodes at various levels in the live back-to-source path.

[0101] Optionally, the query module 320 is further adapted to: query whether there is target stream information corresponding to the stream identifier of the target live stream and in a stream pulling state in the stream information reported by each CDN node in the CDN cluster; if so, the CDN node that reports the target stream information is used as the current return-to-source node that is executing the return-to-source task of the target live stream.

[0102] Optionally, the switching module 330 is further adapted to: send a source switching command including the address of the target source node to the CDN cluster, and establish a source link for the target source node, so that the CDN cluster can change the source link for the target live stream to the address of the target source node, and disconnect the source links of other source nodes in the current source node except the target source node.

[0103] Optionally, the device further includes: a processing module 340. The processing module 340 is adapted to: if the current return source node does not exist, determine the target return source node from the CDN cluster according to the hash ring corresponding to the CDN cluster; determine whether the CDN node is the target return source node; if the CDN node is the target return source node, determine whether there is a next-level CDN node after the CDN node in the live return source path; if there is a next-level CDN node of the CDN node, determine the next-level target return source node from the next-level CDN cluster according to the hash ring corresponding to the next-level CDN cluster and the flow information corresponding to the next-level CDN cluster, and send the address of the next-level target return source node to the CDN node; if there is no next-level CDN node of the CDN node, send the address of the source station to the CDN node; if the CDN node is not the target return source node, send the address of the target return source node to the CDN node.

[0104] Optionally, the device also includes a detection module 350. The detection module 350 is suitable for: detecting whether the next-level return-to-source links of different CDN clusters at any level in the live broadcast return-to-source path for the target live broadcast stream correspond to different CDN nodes in the same CDN cluster at the next level. The switching module 330 is further suitable for: if it corresponds to different CDN nodes in the same CDN cluster at the next level and meets the preset return-to-source switching start conditions, then the hash ring corresponding to the CDN cluster is reconstructed according to the available CDN nodes in the CDN cluster at the next level, and the target return-to-source node at the next level is determined from the CDN cluster based on the hash ring, and the next-level return-to-source links of different CDN clusters at any level for the target live broadcast stream are switched to the target return-to-source node at the next level.

[0105] Optionally, the preset back-to-source switching start condition includes: a start time condition and a back-to-source path number condition.

[0106] The description of each module above refers to the corresponding description in the method embodiment and will not be repeated here.

[0107] The live broadcast source return processing device provided by the embodiment of the present application provides a flow information reporting function and a source return switching function within a cluster and between clusters. According to the source return query request for the target live broadcast stream sent by the CDN node at any level in the live broadcast source return path, it is queried based on the reported flow information whether there is a current source return node that is executing the source return task of the target live broadcast stream in the CDN cluster to which the CDN node belongs. If there are multiple current source return nodes, it means that there are multiple source return situations. In order to avoid affecting the source return effect due to excessively frequent source return switching, a preset source return switching start condition is also set. When the current situation meets the preset source return switching start condition, the cluster is started. The back-to-source forwarding function within the group; in addition, when different CDN nodes at the same level pull different CDN nodes in the same CDN cluster of the next level, the back-to-source forwarding function between clusters can be enabled; during the back-to-source forwarding process, the back-to-source address is changed through the background, and the back-to-source link of the target back-to-source node is first established and then the original back-to-source link is disconnected, so that the back-to-source task is converged to the target back-to-source node for processing. This not only achieves back-to-source convergence, but also effectively avoids long-term multi-path back-to-source caused by hash ring changes through back-to-source forwarding, reduces the load and pressure of the source station or the next-level CDN cluster, and the back-to-source forwarding is imperceptible to users and will not affect their live viewing experience.

[0108] An embodiment of the present application provides a non-volatile computer storage medium, which stores at least one executable instruction or computer program, which enables a processor to perform operations corresponding to the live broadcast back-to-source processing method in any of the above method embodiments.

[0109] An embodiment of the present application provides a computer program product, which includes at least one executable instruction or computer program, and the executable instruction or computer program can enable a processor to perform operations corresponding to the live broadcast back-to-source processing method in any of the above method embodiments.

[0110] Figure 4 A schematic diagram of the structure of a computing device according to an embodiment of the present application is shown. The specific embodiment of the present application does not limit the specific implementation of the computing device.

[0111] like Figure 4 As shown, the computing device may include: a processor (processor) 402 , a communications interface (Communications Interface) 404 , a memory (memory) 406 , and a communication bus 408 .

[0112] The processor 402, the communication interface 404, and the memory 406 communicate with each other via the communication bus 408. The communication interface 404 is used to communicate with other devices such as a client or other server network elements. The processor 402 is used to execute the program 410, which can specifically execute the relevant steps in the above-mentioned embodiment of the live broadcast back-source processing method for a computing device.

[0113] Specifically, the program 410 may include program codes, which include computer operation instructions.

[0114] The processor 402 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the computing device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0115] The memory 406 is used to store the program 410. The memory 406 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0116] The program 410 can be specifically used to enable the processor 402 to execute the live broadcast source return processing method in any of the above method embodiments. The specific implementation of each step in the program 410 can refer to the corresponding descriptions in the corresponding steps and units in the above live broadcast source return processing embodiments, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the above-mentioned method embodiments, which will not be repeated here.

[0117] The algorithm and display provided herein are not inherently related to any specific computer, virtual system or other equipment. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious to construct the structure required for this type of system. In addition, the present application embodiment is not directed to any specific programming language yet. It should be understood that various programming languages ​​can be utilized to realize the content of the present application embodiment described herein, and the above description of specific languages ​​is to disclose the best mode of implementation of the present application embodiment.

[0118] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0119] Similarly, it should be understood that in order to streamline the present disclosure and help understand one or more of the various inventive aspects, in the above description of the exemplary embodiments of the present application, the various features of the embodiments of the present application are sometimes grouped together into a single embodiment, figure, or description thereof. However, the disclosed method should not be interpreted as reflecting the following intention: the claimed embodiments of the present application require more features than the features clearly stated in each claim. More specifically, as reflected in the claims below, the inventive aspects are less than all the features of the single embodiment disclosed above. Therefore, the claims following the specific embodiment are hereby explicitly incorporated into the specific embodiment, wherein each claim itself serves as a separate embodiment of the embodiment of the present application.

[0120] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0121] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the embodiments of the present application and to form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.

[0122] The various component embodiments of the embodiments of the present application can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all functions of some or all components according to the embodiments of the present application. The embodiments of the present application can also be implemented as a device or apparatus program (e.g., computer program and computer program product) for executing part or all of the methods described herein. Such a program implementing the embodiments of the present application can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0123] It should be noted that the above embodiments illustrate rather than limit the embodiments of the present application, and that those skilled in the art may design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets should not be constructed as a limitation to the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of multiple such elements. The embodiments of the present application may be implemented by means of hardware including several different elements and by means of appropriately programmed computers. In a unit claim that lists several devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names.

Claims

1. A live broadcast source return processing method, comprising: Receive a back-to-source query request for a target live stream sent by a CDN node at any level in the live back-to-source path; According to the back-to-source query request, query whether there is a current back-to-source node that is executing the back-to-source task of the target live stream in the CDN cluster to which the CDN node belongs; If there are multiple current back-to-source nodes and they meet the preset back-to-source switching start conditions, the hash ring corresponding to the CDN cluster is reconstructed according to the available CDN nodes in the CDN cluster, and the target back-to-source node is determined from the CDN cluster based on the hash ring, and the back-to-source link of the current back-to-source node is switched to the target back-to-source node.

2. The method according to claim 1, further comprising: Receive the flow information of the back-to-source tasks performed by the CDN nodes at all levels in the live back-to-source path.

3. According to the method of claim 2, querying whether there is a current back-to-source node that is executing the back-to-source task of the target live stream in the CDN cluster to which the CDN node belongs according to the back-to-source query request further comprises: Inquiring whether there is target stream information corresponding to the stream identifier of the target live stream and in a stream pulling state in the stream information reported by each CDN node in the CDN cluster; If so, the CDN node that reports the target stream information is used as the current back-to-source node that is executing the back-to-source task of the target live stream.

4. The method according to any one of claims 1 to 3, wherein transferring the back-to-source link of the current back-to-source node to the target back-to-source node further comprises: A back-to-source forwarding command including the address of the target back-to-source node is sent to the CDN cluster, and a back-to-source link of the target back-to-source node is established, so that the CDN cluster can change the back-to-source link for the target live stream to the address of the target back-to-source node, and disconnect the back-to-source links of other back-to-source nodes in the current back-to-source node except the target back-to-source node.

5. The method according to any one of claims 1 to 4, further comprising: If the current back-to-source node does not exist, determining a target back-to-source node from the CDN cluster according to the hash ring corresponding to the CDN cluster; Determine whether the CDN node is the target back-to-origin node; If the CDN node is the target back-to-source node, determining whether there is a next-level CDN node after the CDN node in the live back-to-source path; If there is a CDN node at the next level of the CDN node, determine the next level target back-to-origin node from the CDN cluster at the next level according to the hash ring corresponding to the CDN cluster at the next level and the flow information corresponding to the CDN cluster at the next level, and send the address of the next level target back-to-origin node to the CDN node; If there is no CDN node at the next level of the CDN node, sending the address of the source station to the CDN node; If the CDN node is not the target back-to-origin node, the address of the target back-to-origin node is sent to the CDN node.

6. The method according to any one of claims 1 to 5, further comprising: Detecting whether the next-level return-to-source links of different CDN clusters at any level in the live broadcast return-to-source path for the target live broadcast stream correspond to different CDN nodes in the same CDN cluster at the next level; If it corresponds to different CDN nodes in the same CDN cluster of the next level and meets the preset back-to-source switching start conditions, the hash ring corresponding to the CDN cluster will be reconstructed according to the available CDN nodes in the CDN cluster of the next level, and the target back-to-source node of the next level will be determined from the CDN cluster based on the hash ring, and the next-level back-to-source link of the target live stream of the different CDN clusters at any level will be switched to the target back-to-source node of the next level.

7. According to the method according to any one of claims 1 to 6, the preset back-to-source switching start condition comprises: Start time conditions and return path number conditions.

8. A live broadcast back-to-source processing device, comprising: A receiving module, adapted to receive a back-to-source query request for a target live stream sent by a CDN node at any level in a live back-to-source path; A query module, adapted to query whether there is a current back-to-source node that is executing the back-to-source task of the target live stream in the CDN cluster to which the CDN node belongs according to the back-to-source query request; The switching module is suitable for reconstructing the hash ring corresponding to the CDN cluster according to the available CDN nodes in the CDN cluster if the number of the current back-to-source nodes is multiple and meets the preset back-to-source switching start condition, and determining the target back-to-source node from the CDN cluster based on the hash ring, and switching the back-to-source link of the current back-to-source node to the target back-to-source node.

9. A computing device comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the live broadcast source return processing method according to any one of claims 1 to 7.

10. A computer storage medium, wherein at least one executable instruction is stored in the storage medium, and the executable instruction enables a processor to perform operations corresponding to the live broadcast source return processing method as described in any one of claims 1-7.

11. A computer program product, comprising at least one executable instruction, wherein the executable instruction enables a processor to perform operations corresponding to the live broadcast source return processing method as described in any one of claims 1 to 7.