CDN (Content Delivery Network) back-to-source link tracking method and device of multi-process live broadcast architecture
By building back-source logs and state machine records, CDN back-source links are generated, which solves the problem of back-source link tracking in the multi-process live broadcast architecture, and achieves a clear understanding of the back-source process and problem positioning.
Patent Information
- Application Number
- CN202411841443.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-03-18
AI Technical Summary
In the CDN return link of the multi-process live broadcast architecture, there are return links across processes and nodes, which makes it difficult to track and locate the return process.
By building the process's return source log and state machine records, the process of return source requests is tracked, including process return source, cluster return source, and remote return source status, and generate a return source link.
It realizes clear tracking and positioning of the CDN return link, and can promptly discover errors and problems in the return process, improving the reliability and efficiency of the system.
Smart Images

Figure CN119653125A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of live broadcast technology, and in particular to a CDN back-to-source link tracking method and device for a multi-process live broadcast architecture. Background Art
[0002] During live broadcast, the client obtains the required content, such as live audio and video data, by accessing the nearest available CDN node. The CDN system can adopt a distributed architecture, and the services of the CDN node can be divided into different components to implement different functions, including the gateway layer, cache layer, and back-to-source layer. The gateway layer is used to carry user traffic and authentication, the cache layer is used to cache the audio and video data returned to the source, and the back-to-source layer is used to initiate back-to-source requests to other upper-layer clusters. In order to reduce the cost of back-to-source, the downstream CDN nodes usually choose to converge back to the source. For the same audio and video data (such as a live stream or a shard request), the CDN will select a process of a CDN node in the cluster to initiate a back-to-source request, converge multiple user requests into one path, and reduce the cost of back-to-source. When there are multiple CDN nodes in a cluster and multiple processes in a CDN node, the back-to-source process may involve cross-process and cross-node situations of the back-to-source link. Therefore, a CDN back-to-source link tracking method for a multi-process live broadcast architecture is needed to facilitate the tracking of the CDN back-to-source link and the timely location of problems in the back-to-source process. Summary of the invention
[0003] In view of the above problems, an embodiment of the present application is proposed to provide a CDN back-to-source link tracking method and device for a multi-process live broadcast architecture that overcomes the above problems or at least partially solves the above problems.
[0004] According to a first aspect of an embodiment of the present application, a CDN back-to-source link tracking method for a multi-process live broadcast architecture is provided, which includes:
[0005] According to the client's back-to-source request, determine the first process of the first back-to-source layer assigned to the back-to-source request, and build a back-to-source log of the first process;
[0006] If the first process does not return the audio and video data corresponding to the return-to-source request, construct a state machine record of the first process, and store the state machine record of the first process in the return-to-source log of the first process;
[0007] The first process performs source retrieval processing according to the source retrieval request. According to the source retrieval process in the source retrieval processing, the first process performs source retrieval processing, cross-process source retrieval processing, or cross-node retrieval processing in the cluster, builds source retrieval logs of other processes after cross-process or cross-node in the cluster, sets the state machine record of the first process and the state machine record of other processes, and stores the state machine record of each process in the source retrieval log of each process;
[0008] After the return to the source is completed, each return to the source log is disassembled and reorganized, and the return to the source link of the return to the source process is generated based on the return to the source order of each process.
[0009] Optionally, the back-to-source log includes: the audio and video data identifier of the back-to-source request, the process identifier, the request identifier, and the state machine record array;
[0010] The state machine record array includes at least one state machine record; the state machine record includes the state machine state; the state machine state includes the initial state, process back-to-source, cluster back-to-source, remote back-to-source, back-to-source table state, stream pulling success and / or stream pulling failure.
[0011] Optionally, if the first process does not return the audio and video data corresponding to the return-to-source request, constructing a state machine record of the first process and storing the state machine record of the first process in the return-to-source log of the first process further includes:
[0012] Determine whether the first process performs source retrieval for the audio and video data corresponding to the source retrieval request according to the source retrieval information of the first process;
[0013] If yes, the first process returns the audio and video data corresponding to the source request;
[0014] If not, a state machine record in which the state machine state is the initial state is stored in the back-to-source log of the first process.
[0015] Optionally, the first process performs source tracing processing according to the source tracing request, and according to the source tracing flow in the source tracing processing, the first process performs source tracing processing, cross-process source tracing processing, or cross-node tracing processing in the cluster, constructs source tracing logs of other processes after cross-process or cross-node in the cluster, sets the state machine record of the first process and the state machine record of other processes, and stores the state machine record of each process in the source tracing log of each process, further comprising:
[0016] The first source return control of the first source return layer determines the source return process according to the audio and video data of the source return request based on the first preset algorithm; the source return process is one of the multiple processes of the first source return layer;
[0017] If the back-to-source process is the first process, multiple state machine records are constructed, in which the state machine states are process back-to-source and the state machine states are cluster back-to-source, and the multiple state machine records are stored in the back-to-source log of the first process;
[0018] If the return-to-source process is not the first process, the first process sends a return-to-source request to the return-to-source process, builds a return-to-source log of the return-to-source process, and stores a state machine record in which the state machine state is the initial state in the return-to-source log of the return-to-source process;
[0019] If the source return process returns the audio and video data corresponding to the source return request, the audio and video data corresponding to the source return request is returned, multiple state machine records are constructed, and the state machine status is process source return and the state machine status is successful source return. The multiple state machine records are stored in the source return log of the source return process; the state machine record with the state machine status of successful source return is stored in the source return log of the first process;
[0020] If the retrieval process does not return the audio and video data corresponding to the retrieval request, a state machine record indicating that the state machine state is cluster retrieval is stored in the retrieval log of the retrieval process.
[0021] Optionally, the first process performs source tracing processing according to the source tracing request, and according to the source tracing flow in the source tracing processing, the first process performs source tracing processing, cross-process source tracing processing, or cross-node tracing processing in the cluster, constructs source tracing logs of other processes after cross-process or cross-node in the cluster, sets the state machine record of the first process and the state machine record of other processes, and stores the state machine record of each process in the source tracing log of each process, further comprising:
[0022] The first back-to-source control determines a back-to-source node in the cluster based on the audio and video data of the back-to-source request and based on the second preset algorithm; the back-to-source node is one of the multiple nodes in the cluster where the first back-to-source layer is located;
[0023] If the return-to-source node is a node of the first return-to-source layer, a state machine record with a state machine state of remote return to the source is stored in the return-to-source log of the return-to-source process in the first return-to-source layer; the return-to-source address is obtained by the first return-to-source control of the first return-to-source layer to obtain and return audio and video data according to the return-to-source address. After successful acquisition, a state machine record with a state machine state of successful streaming is stored in the return-to-source log of each process that receives the return-to-source request in the first return-to-source layer; if the acquisition fails according to the return-to-source address and the number of failures is less than the preset number of times, a state machine record with a state machine state of the return-to-source table is stored in the return-to-source log of the return-to-source process in the first return-to-source layer, and the pre-configured address is obtained by the first return-to-source control, and audio and video data are obtained and returned according to the pre-configured address. After successful acquisition, a state machine record with a state machine state of successful streaming is stored in the return-to-source log of each process that receives the return-to-source request in the first return-to-source layer;
[0024] If the return-to-source node is not a node of the first return-to-source layer, the first process sends a return-to-source request to the second return-to-source layer of the return-to-source node, and constructs a return-to-source log of the second return-to-source layer; if there is a process in the second return-to-source layer that returns the audio and video data corresponding to the return-to-source request, the process identifier in the return-to-source log of the second return-to-source layer is recorded, and multiple state machine records are constructed, where the state machine state is the initial state, the state machine state is process return to the source, and the state machine state is successful in pulling the stream, and the multiple state machine records are stored in the return-to-source log of the second return-to-source layer; the audio and video data corresponding to the return-to-source request are returned to the first return-to-source layer to return the audio and video data, and based on the return-to-source request, a state machine record where the state machine state is successful in pulling the stream is stored in the return-to-source log of each process in the first return-to-source layer that receives the return-to-source request;
[0025] If there is no process in the second source return layer for returning the audio and video data corresponding to the return request, the second source return layer initiates a return request to the second source return control, and the second source return control determines the second process in the second source return layer for returning, builds a source return log for the second process, builds multiple state machine records with the state machine state being the initial state, the state machine state being process return, the state machine state being cluster return, and the state machine state being remote return, and stores the multiple state machine records in the source return log of the second process; the second source return control obtains the source return address to obtain and return the audio and video data according to the source return address, and stores the records in the source return log of the second process after the acquisition is successful. A state machine record with a state machine status of successful streaming is stored; if the acquisition fails according to the back-to-source address and the number of failures is less than the preset number of times, a state machine record with a state machine status of the back-to-source table is stored in the back-to-source log of the second process, and the pre-configured address is obtained by the second back-to-source control query, and the audio and video data is obtained and returned according to the pre-configured address. After successful acquisition, a state machine record with a state machine status of successful streaming is stored in the back-to-source log of the second process; the audio and video data are returned to the first back-to-source layer to return the audio and video data, and based on the back-to-source request, a state machine record with a state machine status of successful streaming is stored in the back-to-source log of each process that receives the back-to-source request in the first back-to-source layer.
[0026] Optionally, the first process performs source tracing processing according to the source tracing request, and according to the source tracing flow in the source tracing processing, the first process performs source tracing processing, cross-process source tracing processing, or cross-node tracing processing in the cluster, constructs source tracing logs of other processes after cross-process or cross-node in the cluster, sets the state machine record of the first process and the state machine record of other processes, and stores the state machine record of each process in the source tracing log of each process, further comprising:
[0027] The first process performs back-to-source processing according to the back-to-source request. If the back-to-source fails, a state machine record with a state machine state of failed stream pulling is stored in each constructed back-to-source log.
[0028] Optionally, the state machine record also includes recording time, back-to-source information and / or failure information;
[0029] The method also includes:
[0030] When building the back-to-source log, the recorded request identifier establishes its association with the back-to-source request;
[0031] After the return to source is completed, each return to source log is disassembled and reorganized, and the return to source link of the return to source process is generated based on the return to source sequence of each process, which further includes:
[0032] After the return to the source is completed, each return to the source log is classified according to the audio and video data identifier, process identifier and / or request identifier to obtain the return to the source log of each process;
[0033] For the source return log of any process, the state machine states of each state machine record are arranged according to the order of the recording time of each state machine record in the state machine record array to obtain the source return state information of the process during the source return process; the source return state information includes the source return state chain, source return information and / or failure information;
[0034] According to the back-to-source logs of each process, the back-to-source order of each process is determined; the back-to-source order is obtained according to the earliest recorded time of the process; the earliest recorded time of the process is obtained by comparing the recorded time of each state machine in the state machine record array of the process;
[0035] According to the return-to-source order of each process, the return-to-source status information of each process is arranged to obtain the return-to-source link of the return-to-source process.
[0036] Optionally, the back-to-source request includes a long link back-to-source request and a short link back-to-source request;
[0037] Long link back-to-source requests use the stream dimension to determine the state machine record of the back-to-source log;
[0038] The short link back-to-source request determines the state machine record of the back-to-source log in the shard dimension.
[0039] According to a second aspect of an embodiment of the present application, a CDN back-to-source link tracking device of a multi-process live broadcast architecture is provided, which includes:
[0040] A back-to-source allocation module, adapted to determine, according to a back-to-source request from a client, a first process of a first back-to-source layer allocated by the back-to-source request, and construct a back-to-source log of the first process;
[0041] an initial state machine module, adapted to construct a state machine record of the first process if the first process does not return the audio and video data corresponding to the return-to-source request, and store the state machine record of the first process in the return-to-source log of the first process;
[0042] The back-to-source process module is adapted to perform back-to-source processing by the first process according to the back-to-source request, and according to the back-to-source flow in the back-to-source processing process, the first process performs back-to-source processing, cross-process back-to-source processing, or cross-node back-to-source processing in the cluster, builds back-to-source logs of other processes after cross-process or cross-node in the cluster, sets the state machine record of the first process and the state machine record of other processes, and stores the state machine record of each process in the back-to-source log of each process;
[0043] The back-to-source link module is suitable for disassembling and reorganizing each back-to-source log after the back-to-source is completed, and generating a back-to-source link for the back-to-source process based on the back-to-source sequence of each process.
[0044] According to a third aspect of an embodiment of the present application, there is provided 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;
[0045] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the CDN back-to-source link tracking method of the above-mentioned multi-process live broadcast architecture.
[0046] According to a fourth aspect of an embodiment 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 CDN back-to-source link tracking method of the multi-process live broadcast architecture described above.
[0047] According to a fifth aspect of an embodiment of the present application, a computer program product is provided, comprising at least one executable instruction, wherein the executable instruction enables a processor to perform operations corresponding to the CDN back-to-source link tracking method of the multi-process live broadcast architecture described above.
[0048] According to the CDN back-to-source link tracking method and device of the multi-process live broadcast architecture provided by the present application, according to the back-to-source request, based on the back-to-source processing process, the back-to-source processing process including different nodes and different processes is stored as a state machine record and a back-to-source log. After the back-to-source is completed, the back-to-source log can be disassembled and reorganized to obtain the back-to-source link including the back-to-source process of each node and each process, so that the back-to-source link can be clearly understood and the problems occurring in the back-to-source processing process can be located.
[0049] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means 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 present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] 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 for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0051] Figure 1 A flowchart of a CDN back-to-source link tracking method for a multi-process live broadcast architecture according to an embodiment of the present application is shown;
[0052] Figure 2 A schematic diagram of the distributed architecture of each node service in a CDN cluster is shown;
[0053] Figure 3 A schematic diagram of the back-to-source process is shown;
[0054] Figure 4 A schematic diagram of state machine state changes is shown;
[0055] Figure 5 A flowchart of a CDN back-to-source link tracking method for a multi-process live broadcast architecture according to another embodiment of the present application is shown;
[0056] Figure 6 A schematic diagram of the structure of a CDN back-to-source link tracking device for a multi-process live broadcast architecture according to an embodiment of the present application is shown;
[0057] Figure 7 A schematic diagram of the structure of a computing device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0058] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.
[0059] First, the terms involved in one or more embodiments of the present application are explained.
[0060] CDN: Content Delivery Network, a new type of content service system based on IP network, through the strategic construction and deployment of widely distributed edge servers, supplemented by relevant load balancing and central platform scheduling strategies, it enables visiting users to access the available edge servers nearby and obtain the required content, thereby improving cache hit rate and response speed. CDN distribution system generally adopts a tree-like structure, relying 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, so as to provide services to users.
[0061] Streaming: Collect audio and video data from the client, encode and encapsulate them using a transmission protocol, and then transmit them to the server. The server is the source station in the CDN architecture.
[0062] Pulling stream: The process in which the client pulls the live media stream to the local computer through the specified source address.
[0063] Back-to-origin: refers to the process by which the client obtains the audio and video information of the requested stream from the CDN.
[0064] Cluster: A collection of many CDNs deployed in the same region.
[0065] FLV protocol: It is the abbreviation of FLASH VIDEO. FLV streaming media format is a video format developed with the launch of Flash MX. The files it forms are extremely small and load very quickly, making 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.
[0066] HLSv7 protocol: It is a real-time streaming protocol based on HLS and fmp4. It divides the live stream into small HTTP-based file segments, each of which contains a short length of playable content, and the client only needs to download a part of the segments at a time. The advantage of this protocol is that it uses the standard HTTP protocol to transmit data and realizes adaptive bit rate.
[0067] Figure 1 A flowchart of a CDN back-to-source link tracking method for a multi-process live broadcast architecture according to an embodiment of the present application is shown. Figure 1 As shown, the method comprises the following steps:
[0068] Step S101: According to a back-to-source request from a client, a first process of a first back-to-source layer assigned to the back-to-source request is determined, and a back-to-source log of the first process is constructed.
[0069] In response to a large number of user requests, CDN adopts a multi-process model to solve the problem of large number of users and large number of back-to-source requests. That is, a CDN node can contain multiple processes to respond to a large number of client back-to-source requests based on multiple processes. CDN adopts a distributed architecture, and the services in the CDN node are divided into different layers, such as the gateway layer, cache layer, and back-to-source layer. Figure 2 As shown in the figure, a single CDN cluster contains two CDN nodes, cdn1 and cdn2, for example. cdn1 contains gateway layer 1, cache layer 1, back-to-source layer 1 and corresponding back-to-source control 1, and cdn2 contains gateway layer 2, cache layer 2, back-to-source layer 2 and corresponding back-to-source control 2. User user can send back-to-source requests in the form of long link requests (flv) or short link requests (hlsv7). Taking a user's long link request to cdn2 as an example, after receiving the request, gateway layer 2 searches for cache layer 2. If the corresponding data cache is not found, it requests back-to-source layer 2. Back-to-source control 2 will choose to converge back to the source, choose back to the source within the cluster, and initiate a back-to-source request to the process of back to source layer 1 of cdn1. The back-to-source requests of many users can be converged into one path, and a CDN node in the cluster will go back to the next node to return to the source, thereby reducing the back-to-source cost.
[0070] When there are multiple processes in a CDN node, according to the client's back-to-source request, the process assigned to the back-to-source request can be determined first. For example, if the client's back-to-source request is sent to CDN node x, the first process of the first back-to-source layer assigned to the CDN node, after the process receives the back-to-source request, that is, the back-to-source starts, and a corresponding back-to-source log is built for the process, such as building a back-to-source log for the first process. The back-to-source log includes the audio and video data identifier of the back-to-source request, the process identifier, and the request identifier. Among them, the audio and video data identifier of the back-to-source request is the identifier of the stream data required for the back-to-source request, and the same audio and video data corresponds to only one audio and video data identifier. The process identifier is the identifier of the process that currently receives the back-to-source request. For example, after being assigned to the first process, the process identifier is process 1 of node x. Considering that a process may receive multiple back-to-source requests for the same audio and video data, multiple requests can be merged. The request identifier here can be a new request identifier. By establishing an association relationship between the request identifier and the back-to-source request, one request identifier can correspond to multiple back-to-source requests. The back-to-source log also includes a state machine record array, and the state machine record array contains at least one state machine record. At this time, since the source return process has not yet started, the state machine record can be temporarily not stored. Later, according to the specific source return process, the corresponding state machine record will be stored. The state machine record includes the state machine state, which can reflect different source return processes and facilitate timely location when problems occur.
[0071] Step S102: If the first process does not return the audio and video data corresponding to the return-to-source request, a state machine record of the first process is constructed, and the state machine record of the first process is stored in the return-to-source log of the first process.
[0072] When it is determined that the first process responds to the return-to-source request, it can be first determined based on the return-to-source information of the first process whether the first process is returning the audio and video data corresponding to the return-to-source request, that is, whether the first process is obtaining the audio and video data. If so, the first process can directly return the audio and video data corresponding to the return-to-source request without subsequent return-to-source processing. If not, it means that the first process of the node has not yet obtained the audio and video data, and a state machine record with the state machine state as the initial state is stored in the return-to-source log of the first process.
[0073] The state machine can adopt a go fsm state machine, and preset different state machine states corresponding to each back-to-source process. Figure 3 As shown, when the user pulls the stream, the process back to source process is performed first. If the process back to source is successful, the audio and video data can be returned. Otherwise, the cluster back to source process is performed. If the cluster back to source is successful, the audio and video data can be returned. Otherwise, the remote back to source process is performed. If the remote back to source is successful, the audio and video data can be returned. Otherwise, the back to source table process is performed. If the back to source table process is successful, the audio and video data can be returned. Otherwise, the back to source fails. Among them, the selection logic of each back to source address is completed by the back to source control component of the back to source layer, and the back to source address in the back to source table process can be pre-configured.
[0074] For the above back-to-source process, use the go fsm state machine to set different state machine states, such as Figure 4 As shown in the figure, the blue boxes represent different states. Init represents the initial state, local represents process back-to-source, cluster represents cluster back-to-source, remote represents remote back-to-source, and default represents the back-to-source table state. In any state from process back-to-source to back-to-source table state, a back-to-source request can be initiated to a certain address. alive indicates that the stream is pulled successfully, and end indicates that the stream is pulled failed. Each circle represents a different method. Alive indicates that the stream is pulled successfully, end indicates that the stream is pulled failed, next indicates the next state to be tried, skip indicates jumping from the current state, and reset indicates resetting the state machine state. The above is an example. The specific settings are based on the implementation situation and are not limited here.
[0075] The corresponding state machine state is determined through the state machine, and a state machine record in which the state machine state is the initial state is stored in the back-to-source log of the first process.
[0076] Step S103: The first process performs source tracing according to the source tracing request. According to the source tracing flow in the source tracing process, the first process performs source tracing, cross-process source tracing, or cross-node tracing in the cluster. A source tracing log of other processes after cross-process or cross-node tracing in the cluster is constructed, a state machine record of the first process and a state machine record of other processes are set, and the state machine record of each process is stored in the source tracing log of each process.
[0077] Since the first process is not currently streaming the audio and video data of the back-to-source request, when the first process receives the back-to-source request, it performs back-to-source processing according to the back-to-source request process. During the back-to-source processing, according to the back-to-source flow, the back-to-source control component corresponding to the first process can select and determine whether the first process performs the back-to-source processing, or selects other processes on the same node as the first process to perform cross-process back-to-source processing, or selects other nodes in the cluster where the node to which the first process belongs to perform cross-node back-to-source processing. The specific back-to-source processing needs to be performed according to the actual situation to obtain the audio and video data and return it to the client.
[0078] When the first process performs source return processing, cross-process source return processing, or cross-node source return processing within a cluster, after crossing processes or crossing nodes within a cluster, other processes will perform source return processing. Therefore, it is also necessary to build source return logs for other processes except the first process. The source return logs record the identifiers of other processes, the audio and video data identifiers of the source return request, and the request identifiers of other processes. When the first process and other processes perform source return processing, the state machines of the first process and other processes change according to the source return processing, etc. According to the state of the state machines involved, the state machine records of the first process and other processes are correspondingly constructed, and the state machine records of each process are stored in the source return log of each process.
[0079] Step S104: After the back-to-source process is completed, each back-to-source log is disassembled and reorganized, and a back-to-source link of the back-to-source process is generated based on the back-to-source sequence of each process.
[0080] After the return to the source is completed, that is, after the audio and video data is returned, the return to the source logs containing the audio and video data identifiers can be disassembled and reorganized. Specifically, the return to the source logs containing the audio and video data identifiers are classified according to the process identifier to obtain the return to the source logs of each process. The state machine record array in the return to the source log of each process can be arranged in the order of records to obtain the return to the source state chain of each process. For example, the state machine record array of the first process includes the state machine state of the initial state, the process state, and the successful stream pulling, and the return to the source state chain of the first process is the initial state-process state-successful stream pulling. In addition to the state machine state, the state machine record can also include access information, error information, etc., which together constitute the return to the source state information of each process in the return to the source process. According to the return to the source order of each process in the return to the source processing process, the return to the source state information of each process is combined to obtain the return to the source link of the return to the source process.
[0081] Further, the source return request includes a long link source return request and a short link source return request. For the long link source return request, the state machine record of the source return log is determined by the flow dimension, and the short link source return request is determined by the shard dimension. When the source return request is a long link request, the source return log in the source return process is determined according to the flow data of the long link request, and the corresponding state machine record is recorded. After the source return is completed, the source return link of the flow data is determined by the flow dimension; when the source return request is a short link request, the source return log in the source return process is determined according to a shard data of the short link request, and the corresponding state machine record is recorded. When the source return is completed, the source return link of the shard data is determined by the shard dimension. After the source return is completed, the corresponding source return log can be deleted or moved to other storage media. In this embodiment, the source return log is mainly used to obtain the source return link, which is convenient for clearly understanding the source return process according to the source return link, and it is also convenient to timely locate errors in the source return process, etc., or it can also be compared with other source return links to timely discover problems in the current source return link, etc.
[0082] According to the CDN back-to-source link tracking method of the multi-process live broadcast architecture provided by the present application, according to the back-to-source request, based on the back-to-source processing process, the back-to-source processing process including different nodes and different processes is stored as a state machine record and a back-to-source log. After the back-to-source is completed, the back-to-source log can be disassembled and reorganized to obtain the back-to-source link including the back-to-source process of each node and each process, so that the back-to-source link can be clearly understood and the problems occurring in the back-to-source processing process can be located.
[0083] Figure 5 A flowchart of a CDN back-to-source link tracking method for a multi-process live broadcast architecture according to an embodiment of the present application is shown. Figure 5 As shown, the method comprises the following steps:
[0084] Step S501: According to a back-to-source request from a client, a first process of a first back-to-source layer assigned to the back-to-source request is determined, and a back-to-source log of the first process is constructed.
[0085] In this embodiment, the audio and video data of the retrieval request is traced back to the source according to the client's retrieval request. For example, the client makes a retrieval request for the audio and video data 1 and sends it to the first retrieval layer of the first node. The first process of the first retrieval layer receives the retrieval request and constructs a retrieval log of the first process according to the retrieval request, including the audio and video data 1, the identifier of the first process, and the request identifier xxx.
[0086] Step S502: If the first process does not return the audio and video data corresponding to the return-to-source request, a state machine record of the first process is constructed, and a state machine record in which the state machine state is an initial state is stored in the return-to-source log of the first process.
[0087] After receiving the return-to-source request, the first process can determine whether the first process is returning the audio and video data corresponding to the return-to-source request according to the return-to-source information of the first process, such as by querying the return-to-source log, return-to-source record, CDN log and other information. If so, the first process can directly return the audio and video data corresponding to the client's return-to-source request without performing subsequent processing. If not, the first process needs to return the audio and video data according to the return-to-source request. The first process can first initiate a request to the first return-to-source control of the first return-to-source layer, and the first return-to-source control queries whether there is a state machine record of the audio and video data. If so, the state machine state is reset to the end state, and then the next operation is triggered to the initial state. Here, it is considered that the audio and video data obtained by the existing state machine record may be old data, which may be an intermediate state such as remote return to the source. At this time, the audio and video data may have been disconnected but the state machine state has not been updated. In order to ensure the acquisition of correct audio and video data, it is reset to the end state, and the next operation is triggered to the initial state, so that the client can be provided with correct audio and video data. If it does not exist, the state machine is initialized and a state machine record of the first process is constructed. The state machine state in the state machine record can be set to the initial state, and a state machine record in which the state machine state is the initial state is stored in the back-to-source log of the first process.
[0088] Step S503: The first process performs source tracing according to the source tracing request. According to the source tracing flow in the source tracing process, the first process performs source tracing, cross-process source tracing, or cross-node tracing in the cluster. A source tracing log of other processes after cross-process or cross-node tracing in the cluster is constructed, a state machine record of the first process and a state machine record of other processes are set, and the state machine record of each process is stored in the source tracing log of each process.
[0089] When the first process performs the back-to-source processing according to the back-to-source request, the process back-to-source process is performed first. Due to the multi-process mode, the first back-to-source control of the first back-to-source layer needs to first determine the back-to-source process based on the audio and video data of the back-to-source request based on the first preset algorithm. The first preset algorithm can use, for example, a consistent hashing algorithm to determine the back-to-source process based on the stream name of the audio and video data. The back-to-source process is one of the multiple processes in the first back-to-source layer.
[0090] If the calculated back-to-source process is the first process, the state machine state skips from the initial state to the process back-to-source. Since it has been determined that the first process is not acquiring audio and video data, the state machine state skips from the process back-to-source to the cluster back-to-source. Multiple state machine records are constructed, with the state machine state being the process back-to-source and the state machine state being the cluster back-to-source. The multiple state machine records are stored in the back-to-source log of the first process.
[0091] If the calculated back-to-source process is not the first process, the first process sends a back-to-source request to the back-to-source process, builds a back-to-source log for the back-to-source process, stores the audio and video data identifier, the back-to-source process identifier, and the request identifier of the back-to-source process, stores a state machine record with the state machine state as the initial state in the back-to-source log of the back-to-source process, and the state machine state skips from the initial state to the process back-to-source. Further, determine whether the back-to-source process performs back-to-source on the audio and video data corresponding to the back-to-source request. If so, return the audio and video data corresponding to the back-to-source request, and the state machine state changes from process back-to-source alive to successful stream pulling. Construct multiple state machine records with the state machine state of process back-to-source and the state machine state of successful back-to-source, and store multiple state machine records in the back-to-source log of the back-to-source process. At the same time, store a state machine record with the state machine state of successful back-to-source in the back-to-source log of the first process. If the back-to-source process does not perform back-to-source on the audio and video data corresponding to the back-to-source request, the state machine state skips from process back-to-source to cluster back-to-source, and stores a state machine record with the state machine state of cluster back-to-source in the back-to-source log of the back-to-source process. The state machine can set the corresponding state based on each process, or based on the back-to-source control. For each process, based on the back-to-source processing process in which the process participates, the corresponding state machine state is recorded in the state machine record and stored in the back-to-source log. The specific setting depends on the implementation situation and is not limited here.
[0092] If none of the processes in the first return source layer requests the audio and video data corresponding to the return source request, the cluster return source process is entered. The first return source control determines the return source node in the cluster based on the audio and video data of the return source request based on the second preset algorithm. The return source node is one of the multiple nodes in the cluster where the first return source layer is located. The second preset algorithm can use a consistent hashing algorithm, etc., to determine the return source node based on the stream name of the audio and video data, etc., which is set according to the implementation situation and is not limited here.
[0093] If the return-to-source node is a node of the first return-to-source layer, since the state machine of the first return-to-source layer has entered the cluster return-to-source, the audio and video data corresponding to the return-to-source request has not been returned to the source, and the state machine state is skipped from the cluster return-to-source to the remote return-to-source, and the state machine record with the state machine state of remote return-to-source is stored in the return-to-source log of the return-to-source process in the first return-to-source layer. At this time, the remote return-to-source process is entered, and the first return-to-source control of the first return-to-source layer obtains the return-to-source address to obtain and return the audio and video data according to the return-to-source address. For example, if the first return-to-source control obtains the return-to-source addresses a and b, the return-to-source process of the first return-to-source layer obtains the audio and video data according to the return-to-source addresses a and b. If the acquisition is successful, the audio and video data is returned, and the state machine state is changed from remote return-to-source alive to successful stream pulling, and the state machine record with the state machine state of successful stream pulling is stored in the return-to-source log of each process that receives the return-to-source request in the first return-to-source layer. If the acquisition fails according to the back-to-source address and the number of failures is less than the preset number, the back-to-source table process is entered, the state machine state is skipped from the remote back-to-source to the back-to-source table state, and a state machine record with the state machine state as the back-to-source table state is stored in the back-to-source log of the back-to-source process in the first back-to-source layer. The pre-configured address is obtained by the first back-to-source control query, and the audio and video data is obtained and returned according to the pre-configured address. After the acquisition is successful, the state machine state is changed from the back-to-source table state alive to the successful stream pulling, and the state machine record with the state machine state as the successful stream pulling is stored in the back-to-source log of each process that receives the back-to-source request in the first back-to-source layer.
[0094] If the return-to-source node is not a node of the first return-to-source layer, such as the node of the first return-to-source layer is cdn2 and the return-to-source node is cdn1, the first process of the first return-to-source layer sends a return-to-source request to the second return-to-source layer of the return-to-source node, builds a return-to-source log of the second return-to-source layer for the second return-to-source layer, and stores the audio and video data identifier, the corresponding request identifier, etc. Search is performed in the second return-to-source layer. If there is a process in the second return-to-source layer that returns the audio and video data corresponding to the return-to-source request, the return-to-source log of the second return-to-source layer is updated, and the process identifier in the return-to-source log of the second return-to-source layer is recorded. If the process that returns to the source is process 3, the identifier of process 3 is stored in the return-to-source log of the second return-to-source layer. The second return-to-source layer enters the process return-to-source flow, and its state machine starts from the initial state, skips to process return to source, and survives until the stream is pulled successfully. Multiple state machine records are built, with the state machine state being the initial state, the state machine state being process return to source, and the state machine state being the stream is pulled successfully, and multiple state machine records are stored in the return-to-source log of the second return-to-source layer. The corresponding audio and video data is returned to the first source layer to return the audio and video data to the client. After successfully obtaining the audio and video data, based on the source return request, the state machine of the first source return layer also comes alive to the successful stream pulling, and the state machine record with the state machine status of successful stream pulling is stored in the source return log of each process that receives the source return request in the first source return layer.
[0095] If there is no process in the second source return layer for returning the audio and video data corresponding to the return request, the second source return layer initiates a return request to the second source return control, asking the second source return control where to return. The processing of the second source return control is the same as the processing flow of the first source return layer receiving the return request. The second source return control determines the second process in the second source return layer for returning to the source, builds the return log of the second process, and the state machine of the second source return layer executes from the initial state, process return to the source, and cluster return to the source, skips to the remote return, and builds multiple state machine records with the state machine state being the initial state, the state machine state being the process return to the source, the state machine state being the cluster return to the source, and the state machine state being the remote return to the source, and stores the multiple state machine records in the return log of the second process. Enter the remote source return process, and the second source return control obtains the source return address to obtain and return audio and video data according to the source return address. For example, if the second source return control obtains the source return address a and b, the second process obtains the audio and video data according to the source return address a and b. If the acquisition is successful, the audio and video data is returned, and the state machine state is changed from remote source alive to successful stream pulling, and the state machine record with the state machine state of successful stream pulling is stored in the source return log of the second process. If the acquisition fails according to the source return address and the number of failures is less than the preset number, enter the source return table process, and the state machine state is skipped from remote source return to source return table state, and the state machine record with the state machine state of the source return table state is stored in the source return log of the second process. The second source return control queries to obtain the pre-configured address, and obtains and returns the audio and video data according to the pre-configured address. After the acquisition is successful, the state machine state is changed from the source return table state alive to successful stream pulling, and the state machine record with the state machine state of successful stream pulling is stored in the source return log of the second process. After the second process obtains the audio and video data, it also needs to return the audio and video data to the first source layer, and the first source layer returns the audio and video data to the client. Based on the source return request, the state machine of the first source layer also comes alive until the stream is pulled successfully, and the state machine record with the state machine status of successful stream pulling is stored in the source return log of each process that receives the source return request in the first source layer.
[0096] Furthermore, during the retrieval process, if the retrieval fails, that is, the retrieval table process fails to successfully obtain the audio and video data, the state machine of the first retrieval layer and the state machine of the second retrieval layer skip to the failure of pulling the stream, and the state machine record with the state machine status of the failed stream is stored in each of the retrieval logs constructed above.
[0097] Furthermore, during the retrieval process, the state machine record includes not only the state machine state, but also the recording time, retrieval information, failure information, etc. The recording time is the timestamp when it is stored, and the retrieval information includes various information in the retrieval process, such as fmt.Sprintf("%s: / / %s:%d?%s(otype%v)", Schema, Host, Port, Param, Type), which can display a complete retrieval path through printing (Sprintf), including Host access address, Port port, Param parameter, Type retrieval type (such as process retrieval, cluster retrieval), etc. Failure information can include the failed access address, port, parameters, connection information, failure reason, number of retries, etc., which is convenient for locating the retrieval failure. The above is an example, which is set according to the implementation situation and is not limited here.
[0098] Step S504: After the back-to-source operation is completed, each back-to-source log is classified according to the audio and video data identifier, the process identifier and / or the request identifier to obtain the back-to-source log of each process corresponding to the audio and video data identifier.
[0099] After the retrieval is completed, the retrieval logs containing the audio and video data of this retrieval can be obtained according to the audio and video data identifier and the request identifier, and then the obtained retrieval logs are classified according to the process identifier to obtain the retrieval logs of each process that retrievals the audio and video data identifier.
[0100] Here, when constructing the back-to-source log and recording the request identifier, since the request identifier may merge multiple back-to-source requests, it is also necessary to establish an association between the request identifier and the back-to-source request. This is convenient for determining the request identifier in the back-to-source log based on the corresponding back-to-source request when disassembling and reassembling the back-to-source log, and then obtaining each back-to-source log containing the audio and video data of this back-to-source based on the audio and video data identifier and the request identifier.
[0101] Step S505: for the source return log of any process, the state machine states of each state machine record are arranged according to the order of the recording time of each state machine record in the state machine record array to obtain the source return state information of the process in the source return process.
[0102] For any process classified back-to-source log, the state machine records in the state machine record array in the back-to-source log can be combined, such as arranging the state machine states of each state machine record in the order of the recording time of the state machine record to obtain the back-to-source state chain. Combined with the back-to-source information and failure information in the state machine record, the back-to-source state information of the process is obtained, and the back-to-source state information includes the back-to-source state chain, back-to-source information, and failure information.
[0103] Step S506: Determine the order of returning to the source of each process according to the return-to-source log of each process.
[0104] For the back-to-source logs of each process, the earliest recorded time of each process can be obtained by comparing the recorded time of each state machine record in the state machine record array of the process. For example, the recorded time in the state machine record in the back-to-source log of the first process includes 20:03:19.000, 20:03:19.003..., and by comparing the recorded time, it can be obtained that the earliest recorded time of the first process includes 20:03:19.000. Sort the processes in the order of the earliest recorded time to obtain the back-to-source order of the processes.
[0105] Step S507 , arranging the back-to-source status information of each process according to the back-to-source sequence of each process, and obtaining the back-to-source link of the back-to-source process.
[0106] Arrange the back-to-source status information of each process according to the back-to-source order of each process. For example, the back-to-source link of a back-to-source request in the cluster is: process 1 of node 2-> process 3 of node 2-> process 1 of node 1-> process 3 of node 1-> remote back-to-source success. The IP of node 1 is 1.1.1.1, and the IP of node 2 is 1.1.1.2. Here, each node corresponds to a specific device.
[0107] The return link of the return process is as follows:
[0108] (1) Process 1 of node 2:
[0109] Hostname:m2 --Node 2
[0110] Stream: live_1 -- audio and video data 1
[0111] insID:01 --Process 1
[0112] ClientID:aabbccdd--Request ID
[0113] states:init->local->alive--Back to source state chain
[0114] msg:--Back to source information
[0115] 20:03:20trying ttype [local] taddr [http: / / 127.0.0.1:703? a=1&b=2] -- Trying to access process 3 of current node 2
[0116] 20:03:20 success ftype [local] faddr [http: / / 127.0.0.1:703? a=1&b=2] -- Access to process 3 of node 2 succeeded
[0117] (2) Process 3 of node 2:
[0118] Hostname:m2 --Node 2
[0119] Stream: live_1 -- audio and video data 1
[0120] insID:03 --Process 3
[0121] ClientID:xxyyzz12--Request ID
[0122] states:init->local->cluster->alive--Back to source state chain
[0123] msg:
[0124] 20:03:20trying ttype [cluster] taddr [http: / / 1.1.1.1:80?a=1&b=2] -- trying to access process 1 on node 1
[0125] 20:03:20 success ftype [cluster] faddr [http: / / 1.1.1.1:80? a=1&b=2] -- Access to process 1 of node 1 succeeded
[0126] (3) Process 1 of Node 1:
[0127] Hostname:m1 --Node 1
[0128] Stream: live_1 -- audio and video data 1
[0129] insID:01 --Process 1
[0130] ClientID:aassddff--Request ID
[0131] states:init->local->alive--Back to source state chain
[0132] msg:--Back to source information
[0133] 20:03:20trying ttype [local] taddr [http: / / 127.0.0.1:703? a=1&b=2] -- trying to access process 3 of current node 1
[0134] 20:03:20 success ftype [local] faddr [http: / / 127.0.0.1:703? a=1&b=2] -- Access to process 3 of node 1 succeeded
[0135] (4) Process 3 of node 1:
[0136] Hostname:m1 --Node 1
[0137] Stream: live_1 -- audio and video data 1
[0138] insID:03 --Process 3
[0139] ClientID:aassddff--Request ID
[0140] states:init->local->cluster->remote->alive--Back to source state chain
[0141] msg:--Back to source information
[0142] 20:03:20trying ttype[remote]taddr[http: / / 2.2.2.2:80?a=1&b=2]--try to access port 80 of 2.2.2.2 to obtain audio and video data
[0143] 20:03:20success ftype[remote]faddr[http: / / 2.2.2.2:80?a=1&b=2]-successfully obtained audio and video data
[0144] Based on the above back-to-source link, we can know that the audio and video data requested by process 1 of node 2 converges to process 3 of node 2, and is back-sourced by node 1 in the same cluster. The request of process 1 of node 1 converges to process 3. It is calculated that node 3 performs remote back-to-source operation and successfully obtains the back-to-source address by accessing 2.2.2.2:80 to obtain the audio and video data. Based on the back-to-source link, we can clearly understand how each process of each node in the cluster returns to the source.
[0145] When back-to-origin fails, the following information can be displayed. For example, if access to 3.3.3.3:80 fails, the reason for the failure is: timeout:
[0146] 20:03:19.trying ttype[remote]taddr[http: / / 3.3.3.3:80? a=1b=2]result[code:504,detail:connect failed,retried 0.:connect:tcp:connect 3.3.3.3:80to=1000ms]
[0147] 20:03:20.101failure reason[timeout]
[0148] The above is an example for explanation. The specific settings will be based on the implementation situation and are not limited here.
[0149] According to the CDN source return link tracking method for the multi-process live broadcast architecture provided by this application, according to the source return processing process of the source return request, a source return log is constructed for different nodes and processes of the cluster involved, and based on the change of the state machine state, a corresponding state machine record is generated and stored in the source return log. After the source return is completed, the source return log is disassembled and reorganized according to the process to obtain the source return link of each node and process in the source return process, which can be printed or displayed, so as to facilitate the understanding of the source return link and the location of the location problem.
[0150] Figure 6 The structure diagram of the CDN back-to-source link tracking device of the multi-process live broadcast architecture provided by an embodiment of the present application is shown. Figure 6 As shown, the device comprises:
[0151] The back-to-source allocation module 610 is adapted to determine, according to the back-to-source request of the client, a first process of the first back-to-source layer allocated by the back-to-source request, and construct a back-to-source log of the first process;
[0152] The initial state machine module 620 is adapted to construct a state machine record of the first process if the first process does not return the audio and video data corresponding to the return-to-source request, and store the state machine record of the first process in the return-to-source log of the first process;
[0153] The back-to-source process module 630 is adapted to perform back-to-source processing by the first process according to the back-to-source request, and according to the back-to-source flow in the back-to-source processing process, perform back-to-source processing by the first process, cross-process back-to-source processing, or cross-node back-to-source processing in the cluster, build back-to-source logs of other processes after cross-process or cross-node in the cluster, set state machine records of the first process and state machine records of other processes, and store the state machine records of each process in the back-to-source log of each process;
[0154] The back-to-source link module 640 is adapted to disassemble and reorganize each back-to-source log after the back-to-source operation is completed, and generate a back-to-source link of the back-to-source process based on the back-to-source sequence of each process.
[0155] Optionally, the back-to-source log includes: the audio and video data identifier of the back-to-source request, the process identifier, the request identifier, and the state machine record array;
[0156] The state machine record array includes at least one state machine record; the state machine record includes the state machine state; the state machine state includes the initial state, process back-to-source, cluster back-to-source, remote back-to-source, back-to-source table state, stream pulling success and / or stream pulling failure.
[0157] Optionally, the initial state machine module 620 is further adapted to:
[0158] Determine whether the first process performs source retrieval for the audio and video data corresponding to the source retrieval request according to the source retrieval information of the first process;
[0159] If yes, the first process returns the audio and video data corresponding to the source request;
[0160] If not, a state machine record in which the state machine state is the initial state is stored in the back-to-source log of the first process.
[0161] Optionally, the back-to-source process module 630 is further adapted to:
[0162] The first source return control of the first source return layer determines the source return process according to the audio and video data of the source return request based on the first preset algorithm; the source return process is one of the multiple processes of the first source return layer;
[0163] If the back-to-source process is the first process, multiple state machine records are constructed, in which the state machine states are process back-to-source and the state machine states are cluster back-to-source, and the multiple state machine records are stored in the back-to-source log of the first process;
[0164] If the return-to-source process is not the first process, the first process sends a return-to-source request to the return-to-source process, builds a return-to-source log of the return-to-source process, and stores a state machine record in which the state machine state is the initial state in the return-to-source log of the return-to-source process;
[0165] If the source return process returns the audio and video data corresponding to the source return request, the audio and video data corresponding to the source return request is returned, multiple state machine records are constructed, and the state machine status is process source return and the state machine status is successful source return. The multiple state machine records are stored in the source return log of the source return process; the state machine record with the state machine status of successful source return is stored in the source return log of the first process;
[0166] If the retrieval process does not return the audio and video data corresponding to the retrieval request, a state machine record indicating that the state machine state is cluster retrieval is stored in the retrieval log of the retrieval process.
[0167] Optionally, the back-to-source process module 630 is further adapted to:
[0168] The first back-to-source control determines a back-to-source node in the cluster based on the audio and video data of the back-to-source request and based on the second preset algorithm; the back-to-source node is one of the multiple nodes in the cluster where the first back-to-source layer is located;
[0169] If the return-to-source node is a node of the first return-to-source layer, a state machine record with a state machine state of remote return to the source is stored in the return-to-source log of the return-to-source process in the first return-to-source layer; the return-to-source address is obtained by the first return-to-source control of the first return-to-source layer to obtain and return audio and video data according to the return-to-source address. After successful acquisition, a state machine record with a state machine state of successful streaming is stored in the return-to-source log of each process that receives the return-to-source request in the first return-to-source layer; if the acquisition fails according to the return-to-source address and the number of failures is less than the preset number of times, a state machine record with a state machine state of the return-to-source table is stored in the return-to-source log of the return-to-source process in the first return-to-source layer, and the pre-configured address is obtained by the first return-to-source control, and audio and video data are obtained and returned according to the pre-configured address. After successful acquisition, a state machine record with a state machine state of successful streaming is stored in the return-to-source log of each process that receives the return-to-source request in the first return-to-source layer;
[0170] If the return-to-source node is not a node of the first return-to-source layer, the first process sends a return-to-source request to the second return-to-source layer of the return-to-source node, and constructs a return-to-source log of the second return-to-source layer; if there is a process in the second return-to-source layer that returns the audio and video data corresponding to the return-to-source request, the process identifier in the return-to-source log of the second return-to-source layer is recorded, and multiple state machine records are constructed, where the state machine state is the initial state, the state machine state is process return to the source, and the state machine state is successful in pulling the stream, and the multiple state machine records are stored in the return-to-source log of the second return-to-source layer; the audio and video data corresponding to the return-to-source request are returned to the first return-to-source layer to return the audio and video data, and based on the return-to-source request, a state machine record where the state machine state is successful in pulling the stream is stored in the return-to-source log of each process in the first return-to-source layer that receives the return-to-source request;
[0171] If there is no process in the second source return layer for returning the audio and video data corresponding to the return request, the second source return layer initiates a return request to the second source return control, and the second source return control determines the second process in the second source return layer for returning, builds a source return log for the second process, builds multiple state machine records with the state machine state being the initial state, the state machine state being process return, the state machine state being cluster return, and the state machine state being remote return, and stores the multiple state machine records in the source return log of the second process; the second source return control obtains the source return address to obtain and return the audio and video data according to the source return address, and stores the records in the source return log of the second process after the acquisition is successful. A state machine record with a state machine status of successful streaming is stored; if the acquisition fails according to the back-to-source address and the number of failures is less than the preset number of times, a state machine record with a state machine status of the back-to-source table is stored in the back-to-source log of the second process, and the pre-configured address is obtained by the second back-to-source control query, and the audio and video data is obtained and returned according to the pre-configured address. After successful acquisition, a state machine record with a state machine status of successful streaming is stored in the back-to-source log of the second process; the audio and video data are returned to the first back-to-source layer to return the audio and video data, and based on the back-to-source request, a state machine record with a state machine status of successful streaming is stored in the back-to-source log of each process that receives the back-to-source request in the first back-to-source layer.
[0172] Optionally, the back-to-source process module 630 is further adapted to:
[0173] The first process performs back-to-source processing according to the back-to-source request. If the back-to-source fails, a state machine record with a state machine state of failed stream pulling is stored in each constructed back-to-source log.
[0174] Optionally, the state machine record also includes recording time, back-to-source information and / or failure information;
[0175] The apparatus further includes: an association module 650, adapted to establish an association relationship between the recorded request identifier and the back-to-source request when constructing the back-to-source log;
[0176] The back-to-source link module 640 is further adapted to:
[0177] After the return to the source is completed, each return to the source log is classified according to the audio and video data identifier, process identifier and / or request identifier to obtain the return to the source log of each process;
[0178] For the source return log of any process, the state machine states of each state machine record are arranged according to the order of the recording time of each state machine record in the state machine record array to obtain the source return state information of the process during the source return process; the source return state information includes the source return state chain, source return information and / or failure information;
[0179] According to the back-to-source logs of each process, the back-to-source order of each process is determined; the back-to-source order is obtained according to the earliest recorded time of the process; the earliest recorded time of the process is obtained by comparing the recorded time of each state machine in the state machine record array of the process;
[0180] According to the return-to-source order of each process, the return-to-source status information of each process is arranged to obtain the return-to-source link of the return-to-source process.
[0181] Optionally, the back-to-source request includes a long link back-to-source request and a short link back-to-source request;
[0182] Long link back-to-source requests use the stream dimension to determine the state machine record of the back-to-source log;
[0183] The short link back-to-source request determines the state machine record of the back-to-source log in the shard dimension.
[0184] The description of each module above refers to the corresponding description in the method embodiment and will not be repeated here.
[0185] According to the CDN back-to-source link tracking device of the multi-process live broadcast architecture provided by the present application, according to the back-to-source request, based on the back-to-source processing process, the back-to-source processing process including different nodes and different processes is stored as a state machine record and a back-to-source log. After the back-to-source is completed, the back-to-source log can be disassembled and reorganized to obtain the back-to-source link including the back-to-source process of each node and each process, so that the back-to-source link can be clearly understood and the problems occurring in the back-to-source processing process can be located.
[0186] The present application also provides a non-volatile computer storage medium, which stores at least one executable instruction, and the executable instruction can execute the operations corresponding to the CDN back-to-source link tracking method of the multi-process live broadcast architecture in any of the above method embodiments.
[0187] The present application also provides a computer program product, which includes at least one executable instruction or computer program, which enables a processor to perform operations corresponding to the CDN back-to-source link tracking method of the multi-process live broadcast architecture in any of the above-mentioned method embodiments.
[0188] Figure 7 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.
[0189] like Figure 7 As shown, the computing device may include: a processor (processor) 702 , a communications interface (Communications Interface) 704 , a memory (memory) 706 , and a communication bus 708 .
[0190] in:
[0191] The processor 702 , the communication interface 704 , and the memory 706 communicate with each other via a communication bus 708 .
[0192] The communication interface 704 is used to communicate with other devices such as clients or other servers.
[0193] Processor 702 is used to execute program 710, and specifically can execute the relevant steps in the CDN back-to-source link tracking method embodiment of the above-mentioned multi-process live broadcast architecture.
[0194] Specifically, the program 710 may include program codes, which include computer operation instructions.
[0195] The processor 702 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement 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.
[0196] The memory 706 is used to store the program 710. The memory 706 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.
[0197] Program 710 can be specifically used to enable processor 702 to execute the CDN source return link tracking method of the multi-process live broadcast architecture in any of the above-mentioned method embodiments. The specific implementation of each step in program 710 can refer to the corresponding descriptions in the corresponding steps and units in the above-mentioned CDN source return link tracking embodiment of the multi-process live broadcast architecture, which will not be repeated here. Technical personnel in the relevant field 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 aforementioned method embodiment, which will not be repeated here.
[0198] The algorithm or display provided here is not inherently related to any specific computer, virtual system or other device. Various general systems can also be used together with the teaching based on this. According to the above description, it is obvious to construct the structure required for this type of system. In addition, the application is not directed to any specific programming language either. It should be understood that various programming languages can be utilized to realize the content of the application described here, and the above description of specific languages is to disclose the preferred embodiment of the application.
[0199] 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.
[0200] Similarly, it should be understood that in order to streamline the present application 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 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 application requires 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 expressly incorporated into the specific embodiment, wherein each claim itself serves as a separate embodiment of the present application.
[0201] 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.
[0202] In addition, those skilled in the art will appreciate that, although some embodiments 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 present application and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.
[0203] The various component 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 of the present application. The present application can also be implemented as a device or apparatus program (e.g., computer program and computer program product) for executing a part or all of the methods described herein. Such a program implementing 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.
[0204] It should be noted that the above embodiments illustrate the present application rather than limit 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 shall not be constructed as a limitation on 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 present application may be implemented by means of hardware including several different elements and by means of a suitably programmed computer. 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. The steps in the above embodiments, unless otherwise specified, should not be understood as limitations on the order of execution.
Claims
1. A CDN back-to-source link tracking method for a multi-process live broadcast architecture, comprising: According to the back-to-source request of the client, determine the first process of the first back-to-source layer assigned by the back-to-source request, and build a back-to-source log of the first process; If the first process does not return the audio and video data corresponding to the return-to-source request, construct a state machine record of the first process, and store the state machine record of the first process in a return-to-source log of the first process; The first process performs source tracing processing according to the source tracing request, and according to the source tracing flow in the source tracing processing, performs source tracing processing by the first process, cross-process source tracing processing, or cross-node tracing processing in the cluster, builds source tracing logs of other processes after cross-process or cross-node in the cluster, sets the state machine record of the first process and the state machine record of the other processes, and stores the state machine record of each process in the source tracing log of each process; After the return to the source is completed, each return to the source log is disassembled and reorganized, and the return to the source link of the return to the source process is generated based on the return to the source order of each process.
2. The method according to claim 1, wherein: The back-to-source log includes: the audio and video data identifier of the back-to-source request, the process identifier, the request identifier, and the state machine record array; The state machine record array includes at least one state machine record; the state machine record includes a state machine state; the state machine state includes an initial state, process back-to-source, cluster back-to-source, remote back-to-source, back-to-source table state, stream pulling success and / or stream pulling failure.
3. The method according to claim 2, wherein: If the first process does not return the audio and video data corresponding to the return-to-source request, constructing a state machine record of the first process, and storing the state machine record of the first process in the return-to-source log of the first process further includes: Determining, according to the return-to-source information of the first process, whether the first process returns the audio and video data corresponding to the return-to-source request to the source; If yes, the first process returns the audio and video data corresponding to the return-to-source request; If not, a state machine record in which the state machine state is the initial state is stored in the source return log of the first process.
4. The method according to any one of claims 1 to 3, wherein: The first process performs source return processing according to the source return request, performs source return processing by the first process, performs cross-process source return processing, or performs source return processing across nodes in a cluster according to the source return process in the source return processing process, builds source return logs of other processes after cross-process or cross-node in a cluster, sets the state machine record of the first process and the state machine record of the other processes, and stores the state machine record of each process in the source return log of each process further includes: The first source return control of the first source return layer determines a source return process based on the audio and video data of the source return request and based on a first preset algorithm; the source return process is one of the multiple processes of the first source return layer; If the back-to-source process is the first process, construct multiple state machine records whose state machine states are process back-to-source and cluster back-to-source, and store the multiple state machine records in the back-to-source log of the first process; If the back-to-source process is not the first process, the first process sends a back-to-source request to the back-to-source process, builds a back-to-source log for the back-to-source process, and stores a state machine record in which the state of the state machine is the initial state in the back-to-source log of the back-to-source process; If the source return process returns the audio and video data corresponding to the source return request, the audio and video data corresponding to the source return request is returned, multiple state machine records are constructed, and the state machine states are process source return and successful source return, and the multiple state machine records are stored in the source return log of the source return process; the state machine record with the state machine state of successful source return is stored in the source return log of the first process; If the retrieval process does not perform retrieval on the audio and video data corresponding to the retrieval request, a state machine record in which the state machine state is cluster retrieval is stored in the retrieval log of the retrieval process.
5. The method according to claim 4, wherein: The first process performs source return processing according to the source return request, performs source return processing by the first process, performs cross-process source return processing, or performs source return processing across nodes in a cluster according to the source return process in the source return processing process, builds source return logs of other processes after cross-process or cross-node in a cluster, sets the state machine record of the first process and the state machine record of the other processes, and stores the state machine record of each process in the source return log of each process further includes: The first back-to-source control determines a back-to-source node in the cluster based on the audio and video data of the back-to-source request and based on a second preset algorithm; the back-to-source node is one of the multiple nodes in the cluster where the first back-to-source layer is located; If the return-to-source node is a node of the first return-to-source layer, a state machine record with a state machine state of remote return to the source is stored in the return-to-source log of the return-to-source process in the first return-to-source layer; the return-to-source address is acquired by the first return-to-source control of the first return-to-source layer to acquire and return audio and video data according to the return-to-source address. After successful acquisition, a state machine record with a state machine state of successful stream pulling is stored in the return-to-source log of each process that receives the return-to-source request in the first return-to-source layer; if acquisition fails according to the return-to-source address and the number of failures is less than a preset number, a state machine record with a state machine state of the return-to-source table is stored in the return-to-source log of the return-to-source process in the first return-to-source layer, the pre-configured address is queried by the first return-to-source control, audio and video data is acquired and returned according to the pre-configured address, and after successful acquisition, a state machine record with a state machine state of successful stream pulling is stored in the return-to-source log of each process that receives the return-to-source request in the first return-to-source layer; If the return-to-source node is not a node of the first return-to-source layer, the first process sends a return-to-source request to the second return-to-source layer of the return-to-source node, and constructs a return-to-source log of the second return-to-source layer; if there is a process in the second return-to-source layer that returns the audio and video data corresponding to the return-to-source request, the process identifier in the return-to-source log of the second return-to-source layer is recorded, and multiple state machine records are constructed, in which the state machine state is the initial state, the state machine state is process return to the source, and the state machine state is successful in pulling the stream, and the multiple state machine records are stored in the return-to-source log of the second return-to-source layer; the audio and video data corresponding to the return-to-source request are returned to the first return-to-source layer to return the audio and video data, and based on the return-to-source request, a state machine record in which the state machine state is successful in pulling the stream is stored in the return-to-source log of each process in the first return-to-source layer that receives the return-to-source request; If there is no process in the second source return layer for returning the audio and video data corresponding to the source return request, the second source return layer initiates a source return request to the second source return control, the second source return control determines the second process in the second source return layer for returning the data, builds a source return log for the second process, builds multiple state machine records with the state machine state being the initial state, the state machine state being process source return, the state machine state being cluster source return, and the state machine state being remote source return, and stores the multiple state machine records in the source return log of the second process; the second source return control obtains the source return address to obtain and return the audio and video data according to the source return address, and after successful acquisition, stores the source return log of the second process. A state machine record with a state machine status of successful streaming is stored in the state machine log; if the acquisition fails according to the return-to-source address and the number of failures is less than the preset number of times, a state machine record with a state machine status of the return-to-source table is stored in the return-to-source log of the second process, and the preconfigured address is obtained by the second return-to-source control query, and the audio and video data are obtained and returned according to the preconfigured address. After successful acquisition, a state machine record with a state machine status of successful streaming is stored in the return-to-source log of the second process; the audio and video data are returned to the first return-to-source layer to return the audio and video data, and based on the return-to-source request, a state machine record with a state machine status of successful streaming is stored in the return-to-source log of each process that receives the return-to-source request in the first return-to-source layer.
6. The method according to any one of claims 1 to 5, wherein: The first process performs source return processing according to the source return request, performs source return processing by the first process, performs cross-process source return processing, or performs source return processing across nodes in a cluster according to the source return process in the source return processing process, builds source return logs of other processes after cross-process or cross-node in a cluster, sets the state machine record of the first process and the state machine record of the other processes, and stores the state machine record of each process in the source return log of each process further includes: The first process performs back-to-source processing according to the back-to-source request. If the back-to-source fails, a state machine record in which the state machine state is a stream pulling failure is stored in each constructed back-to-source log.
7. The method according to any one of claims 2 to 6, wherein: The state machine record also includes recording time, back-to-source information and / or failure information; The method further comprises: When constructing the back-to-source log, the recorded request identifier establishes its association with the back-to-source request; After the return to source is completed, each return to source log is disassembled and reorganized, and the return to source link of the return to source process is generated based on the return to source sequence of each process, further including: After the return to the source is completed, each return to the source log is classified according to the audio and video data identifier, process identifier and / or request identifier to obtain the return to the source log of each process; For the source return log of any process, the state machine states of each state machine record are arranged according to the order of the recording time of each state machine record in the state machine record array to obtain the source return state information of the process during the source return process; the source return state information includes the source return state chain, source return information and / or failure information; According to the source return log of each process, the source return order of each process is determined; the source return order is obtained according to the earliest recorded time of the process; the earliest recorded time of the process is obtained by comparing the recorded time of each state machine in the state machine record array of the process; According to the return-to-source order of each process, the return-to-source status information of each process is arranged to obtain the return-to-source link of the return-to-source process.
8. The method according to any one of claims 1 to 7, wherein: The back-to-source request includes a long link back-to-source request and a short link back-to-source request; The long link back-to-source request determines the state machine record of the back-to-source log in the stream dimension; The short link back-to-source request determines the state machine record of the back-to-source log in the shard dimension.
9. A CDN back-to-source link tracking device for a multi-process live broadcast architecture, comprising: A back-to-source allocation module, adapted to determine, according to a back-to-source request of a client, a first process of a first back-to-source layer allocated by the back-to-source request, and construct a back-to-source log of the first process; an initial state machine module, adapted to construct a state machine record of the first process if the first process does not return the audio and video data corresponding to the return-to-source request, and store the state machine record of the first process in a return-to-source log of the first process; a source return process module, adapted for the first process to perform source return processing according to the source return request, and according to the source return process in the source return processing process, perform source return processing by the first process, cross-process source return processing, or cross-node source return processing in the cluster, build a source return log of other processes after cross-process or cross-node in the cluster, set the state machine record of the first process and the state machine record of the other processes, and store the state machine record of each process in the source return log of each process; The back-to-source link module is suitable for disassembling and reorganizing each back-to-source log after the back-to-source is completed, and generating a back-to-source link for the back-to-source process based on the back-to-source sequence of each process.
10. 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 operations corresponding to the CDN back-to-source link tracking method of the multi-process live broadcast architecture as described in any one of claims 1-8.
11. A computer storage medium, wherein at least one executable instruction is stored in the storage medium, and wherein the executable instruction enables a processor to execute operations corresponding to the CDN back-to-source link tracking method of a multi-process live broadcast architecture as described in any one of claims 1-8.
12. A computer program product, comprising at least one executable instruction, wherein the executable instruction enables a processor to perform operations corresponding to the CDN back-to-source link tracking method of a multi-process live broadcast architecture as described in any one of claims 1-8.