Live broadcast service hot restart processing method and device, equipment, medium and program product

By using port mapping rules in the load balancing service to forward client requests and data streams, the problem that existing clients cannot pull streams after a hot restart of the live broadcast service is solved, ensuring the stability and latency performance of the live broadcast service.

CN118764656AActive Publication Date: 2024-10-11BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410802393.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2024-10-11
Estimated Expiration
2044-06-20

AI Technical Summary

Technical Problem

After the existing live broadcast service is hot restarted, the existing client cannot correctly pull the live data stream due to the creation of incremental work processes, which in turn affects the stability and latency performance of the live broadcast service.

Method used

By applying port mapping rules in the load balancing service, the negotiation request of the incremental client is forwarded to the new UDP port of the incremental worker process, and the keep-alive request of the existing client is forwarded to the old UDP port of the existing worker process to ensure that the existing clients The client continues to use the old port and the old UDP port to communicate, thereby avoiding consistent hash positioning errors caused by changes in the number of processes.

Benefits of technology

It is realized that after the live broadcast service is hot restarted, the existing clients can still obtain the live broadcast data stream normally, maintaining the stability and delay performance of the live broadcast service.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118764656A_ABST
    Figure CN118764656A_ABST
Patent Text Reader

Abstract

The invention provides a live broadcast service hot restart processing method and device, equipment, a medium and a program product, and relates to the technical field of data transmission, hot restart, consistent hashing and live broadcast stream pulling. The method comprises the following steps: receiving a first negotiation request initiated by an incremental client to a first port; according to a preset port mapping rule, a first negotiation request received from the first port is forwarded to a first user datagram protocol UDP port of any incremental working process in a survival state, and a live broadcast data stream received from the incremental working process is returned to the incremental client; and forwarding the keep-alive request received from the second port to the second UDP port of the matched stock working process according to the port mapping rule, and returning the live broadcast data stream received from the stock working process to the corresponding stock client. By applying the method, the problem that the stock client cannot continuously acquire the live broadcast data stream due to the fact that the live broadcast service is subjected to hot restart can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of communication technology, specifically to the field of data transmission, hot restart, consistent hashing, and live streaming technology, and in particular to a live streaming service hot restart processing method, device, electronic device, computer-readable storage medium, and computer program product. Background Art

[0002] Low-latency live broadcast is a live broadcast function that can reduce the live broadcast delay to a few seconds. To achieve this low-latency live broadcast, UDP (User Datagram Protocol, whose main characteristics are connectionless, no guarantee of reliable transmission and message-oriented) port is used for communication service.

[0003] To ensure that the client can continuously obtain the live data stream, even if the live service needs to be updated or upgraded, a hot restart is usually used to not stop or interrupt the running worker process for live streaming.

[0004] That is, the working process that already existed before the hot restart will not be destroyed due to the hot restart operation, but will remain for a period of time to continue returning the live data stream to the existing clients.

[0005] However, after the existing live broadcast service is hot restarted, an incremental work process will be created. As a result, due to the coexistence of existing work processes and incremental work processes, the consistent hashing algorithm cannot accurately connect the existing clients to the original matching work processes, which in turn causes the existing clients to be unable to correctly pull the live broadcast data stream after the hot restart. Summary of the invention

[0006] The embodiments of the present disclosure provide a live broadcast service hot restart processing method, device, electronic device, computer-readable storage medium and computer program product.

[0007] In a first aspect, an embodiment of the present disclosure proposes a live broadcast service hot restart processing method, which is applied to a load balancing service, including: receiving a first negotiation request initiated by an incremental client to a first port; wherein the incremental client is a client that initiates a live broadcast request after the live broadcast service is hot restarted, and the live broadcast service creates multiple incremental work processes after the hot restart, and the first negotiation request is used to negotiate a session traversal method of network address translation; according to a preset port mapping rule, forwarding the first negotiation request received from the first port to a first User Datagram Protocol UDP port of any incremental work process in a surviving state, and returning the live broadcast data stream received from the incremental work process to the incremental client; wherein the port mapping rule records the mapping relationship between different ports of the load balancing service and different UDP ports of the work process; according to the port mapping rule, forwarding the keep-alive request received from the second port to the second UDP port of the matching stock work process, and returning the live broadcast data stream received from the stock work process to the corresponding stock client; wherein the keep-alive request is initiated by the stock client, the stock client is a client that existed before the hot restart, and the stock work process is a work process that provides the live broadcast data stream to the corresponding stock client before the hot restart.

[0008] In the second aspect, the disclosed embodiment proposes a live broadcast service hot restart processing device, which is applied to a load balancing service, including: a first request receiving unit, configured to receive a first negotiation request initiated by an incremental client to a first port; wherein the incremental client is a client that initiates a live broadcast request after the live broadcast service is hot restarted, and the live broadcast service creates multiple incremental work processes after the hot restart, and the first negotiation request is used to negotiate a session traversal method of network address translation; a first negotiation request forwarding and live broadcast data stream returning unit, configured to forward the first negotiation request received from the first port to the first User Datagram Protocol UDP port of any incremental work process in a surviving state according to a preset port mapping rule. , and returns the live data stream received from the incremental work process to the incremental client; wherein the port mapping rule records the mapping relationship between different ports of the load balancing service and different UDP ports of the work process; the keep-alive request forwarding and live data stream returning unit is configured to forward the keep-alive request received from the second port to the second UDP port of the matching existing work process according to the port mapping rule, and return the live data stream received from the existing work process to the corresponding existing client; wherein the keep-alive request is initiated by the existing client, the existing client is a client that exists before the hot restart, and the existing work process is a work process that provides the live data stream to the corresponding existing client before the hot restart.

[0009] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that when the at least one processor executes, the live broadcast service hot restart processing method described in the first aspect can be implemented.

[0010] In a fourth aspect, an embodiment of the present disclosure provides a non-transitory computer-readable storage medium storing computer instructions, which are used to enable a computer to implement the live broadcast service hot restart processing method described in the first aspect when executed.

[0011] In a fifth aspect, an embodiment of the present disclosure provides a computer program product comprising a computer program, which, when executed by a processor, can implement the steps of the live broadcast service hot restart processing method as described in the first aspect.

[0012] The live broadcast service hot restart processing solution provided by the present invention controls the load balancing service to receive the first negotiation request sent by the incremental client after the hot restart through the new port, and forwards the first negotiation request received through the new port to the new UDP port of the incremental work process through the preset port mapping rule, so as to distinguish it from the old port used by the existing client to send the keep-alive request to the load balancing service before the hot restart. Similarly, the load balancing service will also forward the keep-alive request received through the old port to the old UDP port of the existing work process through the port mapping rule, that is, the new and old clients communicate with the different UDP ports of the new and old work processes through different ports of the load balancing service, so that the existing client will not perceive the incremental work process based on the new port and the new UDP port communication, but will continue to locate the original communication with the existing work process using the old port and the old UDP port to communicate. Therefore, the process positioning operation will not cause the inability to locate the error through the consistent hash due to the change in the number of processes, thereby ensuring that the existing client can still continue to obtain the live data stream after the live broadcast service is hot restarted.

[0013] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Other features, objects and advantages of the present disclosure will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:

[0015] Figure 1 is an exemplary system architecture in which the present disclosure may be applied;

[0016] Figure 2 A schematic diagram of a process in which a client communicates with a worker in a live broadcast service through a load balancing service in a related technology to pull a live broadcast data stream;

[0017] Figure 3 A flowchart of a live broadcast service hot restart processing method provided by an embodiment of the present disclosure;

[0018] Figure 4 A flow chart of a communication process between an existing client and a load balancing server and an existing working process before a live broadcast service hot restart is provided in an embodiment of the present disclosure;

[0019] Figure 5-1 A method different from the embodiment of the present disclosure is provided Figure 2 A flow chart of a new communication solution between the client, load balancing service, and worker processes in the live broadcast service;

[0020] Figure 5-2 A method provided in the embodiment of the present disclosure Figure 5-1 A schematic diagram comparing the communication mode between the incremental client and the load balancing service and the incremental work process after the live broadcast service is hot restarted with the communication mode between the stock client and the load balancing service and the stock work process;

[0021] Figure 6 A flow chart of an incremental client communicating with an existing work process through a load balancing service provided in an embodiment of the present disclosure;

[0022] Figure 7 A flowchart of another incremental client communicating with an incremental work process through a load balancing service provided in an embodiment of the present disclosure;

[0023] Figure 8 A structural block diagram of a live broadcast service hot restart processing device provided in an embodiment of the present disclosure;

[0024] Fig. 9 A schematic diagram of the structure of an electronic device suitable for executing a live broadcast service hot restart processing method provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0025] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description. It should be noted that the embodiments in the present disclosure and the features in the embodiments may be combined with each other without conflict.

[0026] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0027] Figure 1 An exemplary system architecture 100 is shown to which an embodiment of the live service hot restart processing method, apparatus, electronic device, and computer-readable storage medium disclosed in the present invention can be applied.

[0028] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a load balancing server 104, live servers 105, 106, and a live source server 107. The live servers 105 and 106 may respectively create multiple work processes (see Figure 1 The network is used as a medium to provide a communication link between any two of the terminal devices 101, 102, 103 and the load balancing server 104, the live broadcast server 105, 106 and the live broadcast source server 107. The network may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0029] The user can use the terminal devices 101, 102, 103 to interact with the live source server 107 through the load balancing server 104 via the live servers 105, 106 to receive live data streams or send messages and control information, etc. The terminal devices 101, 102, 103 and the load balancing server 104, the live servers 105, 106 and the live source server 107 can be installed with various applications for realizing information communication between the two, such as live viewing applications, on-demand applications, instant messaging applications, etc.

[0030] Terminal devices 101, 102, 103, load balancing server 104, live broadcast servers 105, 106, and live broadcast source server 107 can all be hardware or software. When terminal devices 101, 102, 103 are hardware, they can be various electronic devices with display screens, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, etc.; when terminal devices 101, 102, 103 are software, they can be installed in the electronic devices listed above, which can be implemented as multiple software or software modules, or as a single software or software module, which is not specifically limited here. When load balancing server 104, live broadcast servers 105, 106, and live broadcast source server 107 are hardware, they can be implemented as a distributed server cluster composed of multiple servers, or as a single server; when the server is software, it can be implemented as multiple software or software modules, or as a single software or software module, which is not specifically limited here.

[0031] The load balancing server 104 can provide various services through various built-in applications. Taking the live viewing application that can provide live broadcast services as an example, the load balancing server 104 can achieve the following effects when running the live viewing application: first, receive a first negotiation request initiated by an incremental client to a first port. The incremental client is a client that initiates a live broadcast request after the live broadcast service is hot restarted. The live broadcast service creates multiple incremental work processes after the hot restart. The first negotiation request is used to negotiate the session traversal method of network address translation; then, according to the preset port mapping rule, the first negotiation request received from the first port is forwarded to the first user of any incremental work process in a surviving state. Datagram Protocol UDP port, and returns the live data stream received from the incremental work process to the incremental client, and the port mapping rule records the mapping relationship between different ports of the load balancing service and different UDP ports of the work process; at the same time, according to the port mapping rule, the keep-alive request received from the second port is forwarded to the second UDP port of the matching existing work process, and the live data stream received from the existing work process is returned to the corresponding existing client, the keep-alive request is initiated by the existing client, the existing client is the client that exists before the hot restart, and the existing work process is the work process that provides the live data stream to the corresponding existing client before the hot restart.

[0032] The live broadcast service hot restart processing method provided in the subsequent embodiments of the present disclosure is executed by the load balancing server 104 that load balances requests initiated by a large number of clients. Accordingly, the live broadcast service hot restart processing device can generally also be set in the load balancing server 104.

[0033] It should be understood that Figure 1The number of terminal devices, load balancing servers, live servers, work processes, and live source servers in the embodiment is only for illustration. According to the implementation requirements, there can be any number of terminal devices, load balancing servers, live servers, work processes, and live source servers.

[0034] To understand the solution provided by this application for hot restart of live broadcast service, please first refer to Figure 2 , Figure 2 This is a flow chart of the client communicating with the working process in the live broadcast service through the load balancing service in the related technology to pull the live broadcast data stream:

[0035] First, the client sends an SDP packet to port 1052 of the load balancing service.

[0036] Among them, SDP is the full name of Session Description Protocol, which is used in this disclosure to describe the data packets that describe the playback information in low-latency live broadcast, including offer and answer. The offer is sent by the playback end to the server end and is used to record the audio and video format or analysis protocol supported by the playback end. The answer is returned by the server end to the client end and is used to record whether the audio and video data corresponding to the audio and video format or analysis protocol supported by the client can be provided.

[0037] ①: Port 1052 of the load balancing service forwards the SDP packet to any surviving working process in the live broadcast service (i.e. Figure 2 Working process in 1);

[0038] ②: Work process 1 pulls the media playback information (including audio and video format and parsing protocol) of the requested live video from the live source server according to the received SDP packet, and generates an answer;

[0039] ③: Worker process 1 stores the media playback information contained in the answer in the form of key-value pairs in other surviving work processes (i.e. Figure 2 Working process in 3);

[0040] ④Worker process 1 returns the answer to port 1052 of the load balancing service, and then returns it to the client through port 1052. This completes the first phase of negotiation interaction. That is, the object of negotiation interaction in this phase is: the format or parsing protocol of the audio and video data, to ensure that the audio and video data returned subsequently is supported and playable by the client;

[0041] The client then initiates an ICE negotiation request to port 1052 of the load balancing service.

[0042] Among them, the full name of ICE is Interactive Connectivity Establishment, which literally means interactive connection establishment in Chinese. The interaction at this stage mainly focuses on the negotiation interaction based on the Stun (Session traversal utilities for NAT, where NAT's full name is Network Address Translation, and its Chinese name is Network Address Translation). This protocol is a protocol for handling NAT transmission, that is, simply using UDP to penetrate NAT. It is a lightweight protocol and a complete NAT penetration solution based on UDP. It is mainly used as a tool to serve other protocols. It allows clients behind NAT (or multiple NATs) to find out their public network addresses, find out what type of NAT they are behind, and the internet port that NAT is bound to a local port. This information is used to establish UDP communication between two hosts behind NAT routers at the same time. The purpose is to find the information needed for the outside world to connect to the internal address. The purpose of STUN is to traverse NAT. STUN is a typical client / server model. The client sends a request and the server responds. STUN is a Client / Server protocol and also a Request / Response protocol.

[0043] ⑤ The 1052 port of the load balancing service forwards the Stun request (Stun protocol request packet) in the ICE negotiation request to any surviving working process in the live broadcast service (i.e. Figure 2 Working process in 4);

[0044] ⑥Worker process 4 obtains relevant KV information from worker process 3 that originally stores the media playback information of the requested live video;

[0045] ⑦Worker process 4 pulls the requested live data stream from the live source server;

[0046] ⑧Worker process 4 returns the pulled live data stream and KV information to port 1052 of the load balancing service, so that the load balancing service returns the data received at port 1052 to the client. At this point, a data packet constituting the live data stream can be sent to the client segment. In the subsequent process, the client will continue to send a keep-alive request through port 1052 of the load balancing service (used to inform the load balancing service and worker process 4 that the client is still requesting to obtain subsequent live data), so that the latest live data stream will continue to be returned when the load balancing service and worker process 4 confirm that the client has not disconnected.

[0047] Different from the first phase negotiation interaction based on SDP packets in steps ①-④, the second phase negotiation interaction is a Stun protocol negotiation interaction mainly performed through ICE negotiation requests.

[0048] pass Figure 2 It can be seen from the above interaction steps described in the flowchart shown that when the existing client uses the live broadcast service, the two-stage negotiation interaction uses the same port of the load balancing service (i.e., port 1052 in the above example) and the same port of different work processes (i.e., port 7070 in the above example). Therefore, under this scheme, once the live broadcast service is hot restarted and multiple new work processes are created, when both the old and new work processes use port 7070 to communicate with the old and new clients through port 1052 of the load balancing service, the change in the number of work processes will cause the original scheme of using consistent hashing to accurately locate the originally used work process to be destroyed, that is, the originally used work process cannot be accurately located through consistent hashing, which means that the work process that receives the keep-alive request from the old client cannot understand the request, and of course cannot return the latest live broadcast data stream it needs to the old client, which causes the old client to be unable to continue to obtain the live broadcast data stream normally due to the hot restart operation of the live broadcast service.

[0049] In passing Figure 2 After the flow diagram of the existing scheme and the above principle explanation, please refer to Figure 3 , Figure 3 A flowchart of a live broadcast service hot restart processing method provided in an embodiment of the present disclosure is provided, in order to solve the defects of the prior art through the following steps included in process 300:

[0050] Step 301: receiving a first negotiation request initiated by an incremental client to a first port;

[0051] This step is intended to be performed by the execution subject of the live broadcast service hot restart processing method (for example Figure 1 The load balancing server 104 shown receives a first negotiation request initiated by an incremental client to a first port. The incremental client is a client that initiates a live broadcast request after the live broadcast service is hot restarted. It is also used to distinguish existing clients that have initiated live broadcast requests before the live broadcast service is hot restarted. The live broadcast service will create multiple incremental work processes after the hot restart. The incremental work process is also used to distinguish existing work processes that have been connected to existing clients before the live broadcast service is hot restarted. The first negotiation request is used to negotiate the session traversal method of network address translation, that is, the ICE negotiation request mentioned in the above embodiment.

[0052] That is, this step is based on the fact that the live broadcast service has been hot restarted, and multiple incremental work processes have been created through the hot restart to connect to the live broadcast data acquisition request initiated by the incremental client. Among them, the number of the incremental work processes is consistent with the number of the stock work processes.

[0053] Among them, the live broadcast service can be divided into ordinary live broadcast service, low-latency live broadcast service and ultra-low-latency live broadcast service according to delay and stability. Among them, the delay of the low-latency live broadcast service is generally 1-2 seconds, and the delay of the ultra-low-latency live broadcast service can generally be shortened to less than 1 second. The live broadcast service targeted by the solution provided by the present disclosure can be a low-latency live broadcast service that uses UDP to reduce the delay to no more than a first preset time length. Specifically, the first negotiation request will also adaptively be a request for negotiation interaction for a session traversing the STUN protocol based on UDP for network address translation.

[0054] Step 302: forwarding the first negotiation request received from the first port to the first User Datagram Protocol UDP port of any incremental work process in a live state according to a preset port mapping rule, and returning the live data stream received from the incremental work process to the incremental client;

[0055] Based on step 301, this step aims to forward the first negotiation request received from the first port to the first User Datagram Protocol UDP port of any surviving incremental work process according to the preset port mapping rules, and return the live data stream received from the incremental work process to the incremental client.

[0056] Among them, the port mapping rule records the mapping relationship between different ports of the load balancing service and different UDP ports of the working process. A specific mapping relationship shown in this step is: the first port of the load balancing service corresponds to the first UDP port of the incremental working process, that is, the load balancing service will forward all information received through the first port to the first UDP port of the incremental working process, and the incremental working process will also process the information received through the first UDP port accordingly, and return the corresponding response information to the first port of the load balancing service.

[0057] Step 303: According to the port mapping rule, the keep-alive request received from the second port is forwarded to the second UDP port of the matching existing working process, and the live data stream received from the existing working process is returned to the corresponding existing client.

[0058] Based on step 301, this step aims to forward the keep-alive request received from the second port to the second UDP port of the matching existing work process according to the port mapping rules, and return the live data stream received from the existing work process to the corresponding existing client.

[0059] The keep-alive request is initiated by an existing client, the existing client is a client that existed before the hot restart, and the existing working process is a working process that provides live data streams to the corresponding existing client before the hot restart.

[0060] Different from the specific mapping relationship shown in step 302, this step also shows another specific mapping relationship, namely: the second port of the load balancing service corresponds to the second UDP port of the existing working process, that is, the load balancing service will forward the information received through the second port to the second UDP port of the existing working process, and the existing working process will also process the information received through the second UDP port accordingly, and return the corresponding response information to the second port of the load balancing service.

[0061] That is to say, even after the live broadcast service is hot restarted, the existing client still communicates with the second UDP port of the existing work process through the second port of the load balancing service to continue to obtain the live data stream. At the same time, the incremental client communicates with the first UDP port of the incremental work process through the first port of the load balancing service to obtain the live data stream. That is, the existing client and the incremental client independently realize the communication between the load balancing service and the work process based on different port mapping relationships, thereby respectively obtaining the live data stream from the live source server.

[0062] The live broadcast service hot restart processing method provided by the embodiment of the present disclosure controls the load balancing service to receive the first negotiation request sent by the incremental client after the hot restart through the new port, and forwards the first negotiation request received through the new port to the new UDP port of the incremental work process through the preset port mapping rule, so as to distinguish it from the old port used by the existing client to send the keep-alive request to the load balancing service before the hot restart. Similarly, the load balancing service will also forward the keep-alive request received through the old port to the old UDP port of the existing work process through the port mapping rule, that is, the new and old clients communicate with the different UDP ports of the new and old work processes through different ports of the load balancing service, so that the existing client will not perceive the incremental work process based on the new port and the new UDP port communication, but will continue to locate the original communication with the existing work process using the old port and the old UDP port to communicate. Therefore, the process positioning operation will not cause the inability to locate the error through the consistent hash due to the change in the number of processes, thereby ensuring that the existing client can still continue to obtain the live data stream after the live broadcast service is hot restarted.

[0063] Based on the above embodiments, please also refer to Figure 4 , Figure 4A flowchart of a communication process between an existing client and a load balancing server and an existing working process before a live broadcast service hot restart is provided in an embodiment of the present disclosure, wherein process 400 includes the following steps:

[0064] Step 401: receiving a second negotiation request initiated by an existing client to a third port;

[0065] The second negotiation request is used to negotiate whether the actual audio and video format used by the live data stream is the audio and video format supported by the client, which is the first-stage negotiation interaction request initiated based on the SDP packet mentioned in the above embodiment, and the request includes an offer part.

[0066] Step 402: according to the port mapping rule, send the second negotiation request to the third UDP port of any surviving working process in the surviving state;

[0067] Step 403: receiving a second negotiation response returned by the existing working process to which the second negotiation request is sent;

[0068] The second negotiation response includes an answer part.

[0069] Step 404: Return the second negotiation response with the second port attached to the existing client;

[0070] The second port is used to instruct the existing client to use the second port as the destination port for initiating the first negotiation request.

[0071] Step 405: receiving a first negotiation request initiated by an existing client to a second port;

[0072] The first negotiation request is used to negotiate a session traversal method of network address translation, for example, an ICE negotiation request, and specifically performs negotiation interaction based on the Stun protocol.

[0073] Step 406: forwarding the first negotiation request received from the second port to the second UDP port of any existing working process in a live state according to the port mapping rule;

[0074] Step 407: receiving the live data stream returned by the existing working process to which the first negotiation request is sent;

[0075] Step 408: Return the live data stream to the corresponding existing client.

[0076] The existing client sends the keep-alive request once every second preset time interval after first receiving the live data stream. The second preset time interval is used to distinguish it from the first preset time interval mentioned in the above embodiment in name, but the two may be the same or different in specific time interval values.

[0077] That is, this embodiment describes the steps 401 to 408. Figure 3 Before the steps provided in the embodiment shown, the existing client first obtains the live data stream through which interactive steps. The above process is actually Figure 2 All the steps mentioned in the illustrated embodiment have already appeared and will not be described again here.

[0078] Furthermore, when the time interval from the last keep-alive request to the last keep-alive request exceeds the third preset time, the corresponding existing work process can be destroyed, that is, when the third preset time is exceeded, it can be determined that the existing client has actively disconnected the live broadcast access and no longer needs to transmit the live broadcast data stream. Furthermore, when the last existing work process is destroyed, the second port can be used as a backup destination port for receiving the first negotiation request initiated after the next hot restart, for subsequent use.

[0079] For example, if the live broadcast service is hot restarted again, the target destination port as the destination port of the first negotiation request initiated by the incremental client can be selected from the port pool that records all the backup destination ports according to the preset selection rule. The preset selection rule includes any of the following: sequential selection (e.g., a certain numbering order, such as an ascending numbering order), random selection, remainder selection, and polling selection.

[0080] exist Figure 2 The corresponding embodiment has described the communication method of the prior art. Figure 3 While the embodiments have described the steps of the new communication method provided by the present disclosure, the present disclosure further provides Figure 5-1 and Figure 5-2 A more comprehensive description of the new communication methods provided is provided:

[0081] First reference Figure 5-1 , Figure 5-1 A method different from the embodiment of the present disclosure is provided Figure 2 Flowchart of the new communication solution between the client, load balancing service, and worker processes in the live broadcast service. Figure 2 The process diagram shown shows that:

[0082] Figure 5-1 During the first phase of negotiation and interaction between the client and the live streaming service's work process through the load balancing service, Figure 2 They are exactly the same, that is, they also communicate with the working process's port 7070 through the load balancing service's port 1052.

[0083] But the difference is: in the second phase of negotiation interaction and obtaining live data stream, Figure 5-1 A solution is provided for the client to communicate with the port 7080 of the working process through the port 1053 of the load balancing service. That is, under the new communication mode, in the second stage of interaction between the client and the live broadcast service, a request is initiated to another port of the load balancing service, and the load balancing service forwards the request received from the other port to another UDP port of the working process under the preset port mapping rules, thereby realizing the separation of port usage in the first stage of negotiation interaction and the second stage of negotiation interaction.

[0084] Next reference Figure 5-2 , Figure 5-2 A method provided in the embodiment of the present disclosure Figure 5-1 Based on the comparison diagram of the communication mode between the incremental client and the load balancing service and the incremental work process after the hot restart of the live broadcast service and the communication mode between the existing client and the load balancing service and the existing work process, it can be seen that:

[0085] At this time, because the live broadcast service has performed a hot restart, there will be two parts, namely, one part is a live broadcast service composed of multiple existing work processes, which is mainly used to serve existing clients, and the other part is a live broadcast service composed of multiple incremental work processes, which is dedicated to serving incremental clients.

[0086] That is, by default, incremental clients can Figure 5-1 The complete communication process shown in the figure obtains the live data stream from the live source server through the incremental client. However, unlike the communication method used by the existing client before the hot restart, the already occupied load balancing port 1053 and the existing working process port 7080, the incremental client can further use the load balancing service port 1052 and the incremental working process port 7070 to complete the first phase of negotiation interaction, and in the second phase of negotiation interaction, the unoccupied load balancing service port 1054 and the incremental working process port 7081 are used instead, so that the port combination used by the existing client is different from the port combination used by the incremental client, and thus, when the number of working processes under the port combination used by the client in each state does not change, the keep-alive request initiated by the existing client (corresponding to the keep-alive request initiated by the existing client) will not be destroyed due to the destruction of the consistent hash. Figure 5-2 ⑨) in the above is determined to be in the wrong working process, making it impossible for the existing client to obtain the latest live data stream normally (corresponding to Figure 5-2 The problem of ⑩) in the above problem appears again.

[0087] On the basis of any of the above embodiments, considering that after the live broadcast service is hot restarted, multiple incremental work processes are usually gradually created over a period of time, that is, different incremental work processes are created at different times. Therefore, when the incremental work process has not been completely created and the load balancing service also needs to spend time to detect whether the incremental work process is alive, the present disclosure further adopts Figure 6 A flowchart of an incremental client communicating with an existing worker process through a load balancing service is provided to try to avoid problems that may be caused by the above situation, including the following steps:

[0088] Step 601: In response to the load balancing service not completing the liveness detection operation on all incremental work processes, receiving a second negotiation request initiated by the incremental client to the third port;

[0089] The second negotiation request is used to negotiate whether the actual audio and video format used by the live data stream is an audio and video format supported by the client;

[0090] Step 602: according to the port mapping rule, send the second negotiation request to the third UDP port of any existing working process in the surviving state;

[0091] Step 603: receiving a second negotiation response returned by the existing working process to which the second negotiation request is sent;

[0092] Step 604: Return the second negotiation response with the first port attached to it to the incremental client.

[0093] The first port is used to instruct the incremental client to use the first port as the destination port for initiating the first negotiation request.

[0094] That is, before the load balancing service completes the detection operation on all incremental work processes, the present invention forwards the second negotiation request (i.e., the first phase negotiation interaction based on the SDP packet) initiated by the received incremental client to the third port (e.g., port 1052 of the load balancing service mentioned in the above example) to the third UDP port of any surviving existing work process (e.g., port 7070 mentioned in the above example), and then completes the first phase of negotiation interaction processing through the existing work process, which mainly includes completing the confirmation of whether the audio and video format or the parsing protocol is supported and the storage of media playback information.

[0095] That is, considering that the incremental work process is not yet completely available under the current circumstances, the first phase of negotiation interaction required by the incremental client in this embodiment is completed by using the existing work process that is confirmed to be available.

[0096] Correspondingly, Figure 7Another flowchart of an incremental client communicating with an incremental work process through a load balancing service is shown, wherein the flow 700 includes the following steps:

[0097] Step 701: In response to the load balancing service having completed the detection operation on all incremental work processes, receiving a second negotiation request initiated by the incremental client to the third port;

[0098] The second negotiation request is used to negotiate whether the actual audio and video format used by the live data stream is an audio and video format supported by the client;

[0099] Step 702: according to the port mapping rule, send the second negotiation request to the third UDP port of any incremental working process in a surviving state;

[0100] Step 703: receiving a second negotiation response returned by the incremental work process to which the second negotiation request is sent;

[0101] Step 704: Return the second negotiation response with the first port attached to it to the incremental client.

[0102] The first port is used to instruct the incremental client to use the first port as the destination port for initiating the first negotiation request.

[0103] Different from Figure 6 The embodiment shown is based on the load balancing service having completed the detection of all incremental work processes, that is, all incremental work processes have been created, and the load balancing service has also completed the detection of all incremental work processes, so it can be determined that all incremental work processes are in an available state. Therefore, in this case, the embodiment can normally use the incremental work process to complete the first phase of the negotiation interaction process with the incremental client.

[0104] On the basis of the above embodiment, the media playback information of the live stream contained in the second negotiation response (such as the KV information mentioned in the above embodiment) can also be stored in any surviving working process and the preset second storage cluster, so that when the incremental process is not completely created and the corresponding media playback information cannot be obtained from the working process through the first protocol request, the corresponding media playback information can also be obtained from the second storage cluster.

[0105] Further references Figure 8 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a live broadcast service hot restart processing device. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0106] like Figure 8 As shown, the live broadcast service hot restart processing device 800 of this embodiment may include: a first request receiving unit 801, a first negotiation request forwarding and live broadcast data stream return unit 802, and a keep-alive request forwarding and live broadcast data stream return unit 803. Among them, the first request receiving unit 801 is configured to receive a first negotiation request initiated by an incremental client to the first port, and the incremental client is: a client that initiates a live broadcast request after the live broadcast service is hot restarted. The live broadcast service creates multiple incremental work processes after the hot restart. The first negotiation request is used to negotiate the session traversal method of network address translation; the first negotiation request forwarding and live broadcast data stream return unit 802 is configured to: forward the first negotiation request received from the first port to the first User Datagram Protocol UDP port of any incremental work process in a surviving state according to the preset port mapping rules, and forward the live broadcast data stream received from the incremental work process. The data stream is returned to the incremental client, and the port mapping rules record the mapping relationship between different ports of the load balancing service and different UDP ports of the working process; the keep-alive request forwarding and live data stream returning unit 803 is configured to: according to the port mapping rules, forward the keep-alive request received from the second port to the second UDP port of the matching existing working process, and return the live data stream received from the existing working process to the corresponding existing client, the keep-alive request is initiated by the existing client, the existing client is the client that exists before the hot restart, and the existing working process is the working process that provides the live data stream to the corresponding existing client before the hot restart.

[0107] In this embodiment, in the live service hot restart processing device 800, the specific processing of the first request receiving unit 801, the first negotiation request forwarding and live data stream return unit 802, and the keep-alive request forwarding and live data stream return unit 803 and the technical effects thereof can be referred to respectively. Figure 2 The relevant descriptions of steps 201 - 203 in the corresponding embodiment are not repeated here.

[0108] In some optional implementations of this embodiment, the live broadcast service is a low-latency live broadcast service that uses UDP to reduce the delay to no more than a first preset duration, and the first negotiation request is a request for negotiation interaction for a session traversing the STUN protocol for network address translation based on UDP.

[0109] In some optional implementations of this embodiment, the live broadcast service hot restart processing device 800 further includes:

[0110] A second request receiving unit is configured to receive a first negotiation request initiated by the existing client to the second port before performing the hot restart;

[0111] The first forwarding unit is configured to forward the first negotiation request received from the second port to the second UDP port of any existing working process in a surviving state according to the port mapping rule;

[0112] A first data stream receiving unit is configured to receive a live data stream returned by the stock work process to which the first negotiation request is sent;

[0113] The first data stream returning unit is configured to return the live data stream to the corresponding existing client; wherein the existing client will send a keep-alive request once every second preset time interval after first receiving the live data stream.

[0114] In some optional implementations of this embodiment, the live broadcast service hot restart processing device 800 further includes:

[0115] The third request receiving unit is configured to receive a second negotiation request initiated by the existing client to the third port before receiving the first negotiation request initiated by the existing client to the second port; wherein the second negotiation request is used to negotiate whether the actual audio and video format used by the live data stream is the audio and video format supported by the client;

[0116] The second forwarding unit is configured to send the second negotiation request to a third UDP port of any surviving working process in a surviving state according to the port mapping rule;

[0117] A first response receiving unit is configured to receive a second negotiation response returned by the existing working process to which the second negotiation request is sent;

[0118] The first response returning unit is configured to return a second negotiation response with a second port attached to the existing client; wherein the second port is used to instruct the existing client to use the second port as a destination port for initiating the first negotiation request.

[0119] In some optional implementations of this embodiment, the live broadcast service hot restart processing device 800 further includes:

[0120] A destroying unit, configured to destroy the corresponding existing working process in response to a time interval from receiving a last keep-alive request exceeding a second preset time length;

[0121] The standby destination port reserve unit is configured to use the second port as a standby destination port for receiving the first negotiation request initiated after the next hot restart in response to the last existing working process being destroyed.

[0122] In some optional implementations of this embodiment, the live broadcast service hot restart processing device 800 further includes:

[0123] The destination port selection unit is configured to select a target destination port as the destination port of the first negotiation request initiated by the incremental client from a port pool recording all backup destination ports according to a preset selection rule in response to the live broadcast service being hot restarted again.

[0124] In some optional implementations of this embodiment, the preset selection rule includes any of the following:

[0125] Sequential selection, random selection, remainder selection, and round-robin selection.

[0126] In some optional implementations of this embodiment, the live broadcast service hot restart processing device 800 further includes:

[0127] The fourth request receiving unit is configured to receive a second negotiation request initiated by the incremental client to the third port in response to the load balancing service not completing the live detection operation on all incremental work processes before receiving the first negotiation request initiated by the incremental client to the first port; wherein the second negotiation request is used to negotiate whether the actual audio and video format used by the live data stream is the audio and video format supported by the client;

[0128] The third forwarding unit is configured to send the second negotiation request to a third UDP port of any existing working process in a surviving state according to the port mapping rule;

[0129] A second response receiving unit, configured to receive a second negotiation response returned by the existing working process to which the second negotiation request is sent;

[0130] The second response returning unit is configured to return the second negotiation response with the first port attached to it to the incremental client; wherein the first port is used to instruct the incremental client to use the first port as the destination port for initiating the first negotiation request.

[0131] In some optional implementations of this embodiment, the live broadcast service hot restart processing device 800 further includes:

[0132] The fifth request receiving unit is configured to receive a second negotiation request initiated by the incremental client to the third port in response to the load balancing service having completed the live detection operation on all incremental work processes before receiving the first negotiation request initiated by the incremental client to the first port; wherein the second negotiation request is used to negotiate whether the actual audio and video format used by the live data stream is the audio and video format supported by the client;

[0133] A fourth forwarding unit is configured to send the second negotiation request to a third UDP port of any incremental working process in a surviving state according to a port mapping rule;

[0134] A third response receiving unit is configured to receive a second negotiation response returned by the incremental work process to which the second negotiation request is sent;

[0135] The third response returning unit is configured to return the second negotiation response with the first port attached to it to the incremental client; wherein the first port is used to instruct the incremental client to use the first port as a destination port for initiating the first negotiation request.

[0136] In some optional implementations of this embodiment, the number of incremental work processes is consistent with the number of existing work processes.

[0137] In some optional implementations of this embodiment, the live broadcast service hot restart processing device 800 further includes:

[0138] The redundant storage unit is configured to store the media playback information of the live stream contained in the second negotiation response in any working process in a surviving state and a preset second storage cluster respectively.

[0139] In some optional implementations of this embodiment, the live broadcast service hot restart processing device 800 further includes:

[0140] The media play request acquisition unit is configured to acquire corresponding media play information from the second storage cluster in response to the incremental process not being completely created and failing to acquire corresponding media play information from the working process through the first protocol request.

[0141] This embodiment exists as an apparatus embodiment corresponding to the above-mentioned method embodiment. The live broadcast service hot restart processing apparatus provided by this embodiment controls the load balancing service to receive the first negotiation request sent by the incremental client after the hot restart through the new port, and forwards the first negotiation request received through the new port to the new UDP port of the incremental work process through the preset port mapping rule, thereby distinguishing it from the old port used by the existing client to send the keep-alive request to the load balancing service before the hot restart. Similarly, the load balancing service will also forward the keep-alive request received through the old port to the old UDP port of the existing work process through the port mapping rule, that is, the new and old clients communicate with the different UDP ports of the new and old work processes through different ports of the load balancing service, so that the existing client will not perceive the incremental work process based on the new port and the new UDP port communication, but will continue to locate the original communication with the existing work process using the old port and the old UDP port to communicate. Therefore, the process positioning operation will not cause the inability to locate the error through the consistent hash due to the change in the number of processes, thereby ensuring that the existing client can still continue to obtain the live data stream after the live broadcast service is hot restarted.

[0142] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the live broadcast service hot restart processing method described in any of the above embodiments can be implemented when the at least one processor executes.

[0143] According to an embodiment of the present disclosure, the present disclosure also provides a readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to implement the live broadcast service hot restart processing method described in any of the above embodiments when executed.

[0144] According to an embodiment of the present disclosure, the present disclosure also provides a computer program product, which, when executed by a processor, can implement the live broadcast service hot restart processing method described in any of the above embodiments.

[0145] Fig. 9 A schematic block diagram of an example electronic device 900 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0146] like Fig. 9 As shown, the device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the device 900 can also be stored. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0147] A number of components in the device 900 are connected to the I / O interface 905, including: an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0148] The computing unit 901 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 901 performs the various methods and processes described above, such as a live service hot restart processing method. For example, in some embodiments, the live service hot restart processing method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of the live service hot restart processing method described above may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to perform the live service hot restart processing method by any other appropriate means (e.g., by means of firmware).

[0149] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0150] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0151] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0152] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0153] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0154] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and virtual private servers (VPS) services.

[0155] According to the technical solution of the embodiment of the present disclosure, the load balancing service is controlled to receive the first negotiation request sent by the incremental client after the hot restart through the new port, and the first negotiation request received through the new port is forwarded to the new UDP port of the incremental work process through the preset port mapping rule, so as to distinguish it from the old port used by the existing client to send the keep-alive request to the load balancing service before the hot restart. Similarly, the load balancing service will also forward the keep-alive request received through the old port to the old UDP port of the existing work process through the port mapping rule, that is, the new and old clients communicate with the different UDP ports of the new and old work processes through different ports of the load balancing service, so that the existing client will not perceive the incremental work process based on the new port and the new UDP port communication, but will continue to locate the original communication in the existing work process that communicates using the old port and the old UDP port. Therefore, the process positioning operation will not cause the inability to locate the error through the consistent hash due to the change in the number of processes, thereby ensuring that the existing client can still continue to obtain the live data stream after the live service is hot restarted.

[0156] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0157] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A live broadcast service hot restart processing method, wherein: Applied to load balancing services, including: Receive a first negotiation request initiated by an incremental client to a first port; wherein the incremental client is a client that initiates a live broadcast request after a hot restart of a live broadcast service, the live broadcast service creates multiple incremental work processes after the hot restart, and the first negotiation request is used to negotiate a session traversal method of network address translation; According to the preset port mapping rules, the first negotiation request received from the first port is forwarded to the first User Datagram Protocol UDP port of any incremental work process in a live state, and the live data stream received from the incremental work process is returned to the incremental client; wherein the port mapping rules record the mapping relationship between different ports of the load balancing service and different UDP ports of the work process; According to the port mapping rule, the keep-alive request received from the second port is forwarded to the second UDP port of the matching existing work process, and the live data stream received from the existing work process is returned to the corresponding existing client; wherein, the keep-alive request is initiated by the existing client, the existing client is a client that exists before the hot restart, and the existing work process is a work process that provides the live data stream to the corresponding existing client before the hot restart.

2. The method according to claim 1, wherein: The live broadcast service is a low-latency live broadcast service that uses UDP to reduce the delay to no more than a first preset duration, and the first negotiation request is a request for negotiation interaction for a session traversing the STUN protocol based on UDP for network address translation.

3. The method according to claim 1, wherein: Before performing the hot restart, the method further includes: Receiving a first negotiation request initiated by the existing client to the second port; According to the port mapping rule, forwarding the first negotiation request received from the second port to the second UDP port of any existing working process in a surviving state; Receiving a live data stream returned by the existing working process to which the first negotiation request is sent; The live data stream is returned to the corresponding existing client; wherein the existing client sends the keep-alive request once every second preset time interval after first receiving the live data stream.

4. The method according to claim 3, wherein: Before receiving a first negotiation request initiated by the existing client to the second port, the method further includes: Receiving a second negotiation request initiated by the existing client to the third port; wherein the second negotiation request is used to negotiate whether the actual audio and video format used by the live data stream is the audio and video format supported by the client; According to the port mapping rule, sending the second negotiation request to the third UDP port of any surviving working process in a surviving state; Receiving a second negotiation response returned by the existing working process to which the second negotiation request is sent; A second negotiation response with the second port attached is returned to the existing client; wherein the second port is used to instruct the existing client to use the second port as a destination port for initiating the first negotiation request.

5. The method according to claim 1, further comprising: In response to a time interval from receiving the last keep-alive request exceeding a second preset time length, destroying the corresponding existing work process; In response to the last of the existing working processes being destroyed, the second port is used as a standby destination port for receiving the first negotiation request initiated after the next hot restart.

6. The method according to claim 5, further comprising: In response to the live broadcast service performing the hot restart again, according to a preset selection rule, a target destination port is selected as the destination port of the first negotiation request initiated by the incremental client from a port pool recording all the backup destination ports.

7. The method according to claim 6, wherein: The preset selection rule includes any of the following: Sequential selection, random selection, remainder selection, and round-robin selection.

8. The method according to claim 1, wherein: Before receiving a first negotiation request initiated by the incremental client to the first port, the method further includes: In response to the load balancing service not completing the live detection operation on all the incremental work processes, receiving a second negotiation request initiated by the incremental client to the third port; wherein the second negotiation request is used to negotiate whether the actual audio and video format used by the live data stream is the audio and video format supported by the client; According to the port mapping rule, sending the second negotiation request to the third UDP port of any existing working process in a surviving state; Receiving a second negotiation response returned by the existing working process to which the second negotiation request is sent; A second negotiation response with the first port attached is returned to the incremental client; wherein the first port is used to instruct the incremental client to use the first port as a destination port for initiating the first negotiation request.

9. The method according to claim 1, wherein: Before receiving a first negotiation request initiated by the incremental client to the first port, the method further includes: In response to the load balancing service having completed the detection operation on all the incremental work processes, receiving a second negotiation request initiated by the incremental client to the third port; wherein the second negotiation request is used to negotiate whether the actual audio and video format used by the live data stream is the audio and video format supported by the client; According to the port mapping rule, sending the second negotiation request to the third UDP port of any incremental working process in a surviving state; Receiving a second negotiation response returned by the incremental work process to which the second negotiation request is sent; A second negotiation response with the first port attached is returned to the incremental client; wherein the first port is used to instruct the incremental client to use the first port as a destination port for initiating the first negotiation request.

10. The method according to claim 1, wherein: The number of the incremental work processes is consistent with the number of the existing work processes.

11. The method according to any one of claims 4, 8-9, further comprising: The media playback information of the live stream included in the second negotiation response is stored in any working process in a live state and a preset second storage cluster.

12. The method according to claim 11, wherein: Also includes: In response to the incremental process not being completely created and failing to obtain the corresponding media playback information from the working process through the first protocol request, the corresponding media playback information is obtained from the second storage cluster.

13. A live broadcast service hot restart processing device, wherein: Applied to load balancing services, including: A first request receiving unit is configured to receive a first negotiation request initiated by an incremental client to a first port; wherein the incremental client is a client that initiates a live broadcast request after a hot restart of the live broadcast service, the live broadcast service creates multiple incremental work processes after the hot restart, and the first negotiation request is used to negotiate a session traversal method of network address translation; The first negotiation request forwarding and live data stream returning unit is configured to forward the first negotiation request received from the first port to the first User Datagram Protocol UDP port of any incremental work process in a surviving state according to a preset port mapping rule, and return the live data stream received from the incremental work process to the incremental client; wherein the port mapping rule records the mapping relationship between different ports of the load balancing service and different UDP ports of the work process; The keep-alive request forwarding and live data stream returning unit is configured to forward the keep-alive request received from the second port to the second UDP port of the matching existing work process according to the port mapping rule, and return the live data stream received from the existing work process to the corresponding existing client; wherein, the keep-alive request is initiated by the existing client, the existing client is a client that exists before the hot restart, and the existing work process is a work process that provides the live data stream to the corresponding existing client before the hot restart.

14. The device according to claim 13, wherein: The live broadcast service is a low-latency live broadcast service that uses UDP to reduce the delay to no more than a first preset duration, and the first negotiation request is a request for negotiation interaction for a session traversing the STUN protocol based on UDP for network address translation.

15. The apparatus according to claim 13, further comprising: A second request receiving unit is configured to receive a first negotiation request initiated by the existing client to the second port before performing the hot restart; A first forwarding unit is configured to forward the first negotiation request received from the second port to a second UDP port of any existing working process in a surviving state according to the port mapping rule; A first data stream receiving unit is configured to receive a live data stream returned by the existing working process to which the first negotiation request is sent; The first data stream returning unit is configured to return the live data stream to the corresponding existing client; wherein the existing client will send the keep-alive request once every second preset time interval after first receiving the live data stream.

16. The apparatus according to claim 15, further comprising: A third request receiving unit is configured to receive a second negotiation request initiated by the existing client to the third port before receiving the first negotiation request initiated by the existing client to the second port; wherein the second negotiation request is used to negotiate whether the actual audio and video format used by the live data stream is the audio and video format supported by the client; A second forwarding unit is configured to send the second negotiation request to a third UDP port of any surviving working process in a surviving state according to the port mapping rule; A first response receiving unit is configured to receive a second negotiation response returned by the existing working process to which the second negotiation request is sent; The first response returning unit is configured to return a second negotiation response with the second port attached to the existing client; wherein the second port is used to instruct the existing client to use the second port as a destination port for initiating the first negotiation request.

17. The apparatus according to claim 13, further comprising: A destroying unit, configured to destroy the corresponding existing working process in response to a time interval from receiving the last keep-alive request exceeding a second preset time length; The standby destination port reserve unit is configured to use the second port as a standby destination port for receiving the first negotiation request initiated after the next hot restart in response to the last of the stock working processes being destroyed.

18. The apparatus according to claim 17, further comprising: The destination port selection unit is configured to select, in response to the live broadcast service performing the hot restart again, a target destination port as the destination port of the first negotiation request initiated by the incremental client from a port pool recording all the backup destination ports according to a preset selection rule.

19. The device according to claim 18, wherein: The preset selection rule includes any of the following: Sequential selection, random selection, remainder selection, and round-robin selection.

20. The apparatus of claim 13, further comprising: The fourth request receiving unit is configured to receive a second negotiation request initiated by the incremental client to the third port in response to the load balancing service not completing the live detection operation on all the incremental work processes before receiving the first negotiation request initiated by the incremental client to the first port; wherein the second negotiation request is used to negotiate whether the actual audio and video format used by the live data stream is the audio and video format supported by the client; A third forwarding unit is configured to send the second negotiation request to a third UDP port of any existing working process in a surviving state according to the port mapping rule; A second response receiving unit, configured to receive a second negotiation response returned by the existing working process to which the second negotiation request is sent; The second response returning unit is configured to return a second negotiation response with the first port attached to it to the incremental client; wherein the first port is used to instruct the incremental client to use the first port as a destination port for initiating the first negotiation request.

21. The apparatus according to claim 13, further comprising: The fifth request receiving unit is configured to receive a second negotiation request initiated by the incremental client to the third port in response to the load balancing service having completed the live detection operation on all the incremental work processes before receiving the first negotiation request initiated by the incremental client to the first port; wherein the second negotiation request is used to negotiate whether the actual audio and video format used by the live data stream is the audio and video format supported by the client; a fourth forwarding unit, configured to send the second negotiation request to a third UDP port of any incremental working process in a surviving state according to the port mapping rule; A third response receiving unit is configured to receive a second negotiation response returned by the incremental work process to which the second negotiation request is sent; The third response returning unit is configured to return the second negotiation response with the first port attached to it to the incremental client; wherein the first port is used to instruct the incremental client to use the first port as a destination port for initiating the first negotiation request.

22. The device according to claim 13, wherein: The number of the incremental work processes is consistent with the number of the existing work processes.

23. The device according to any one of claims 16, 20-21, further comprising: The redundant storage unit is configured to store the media playback information of the live stream contained in the second negotiation response in any working process in a surviving state and a preset second storage cluster respectively.

24. The device according to claim 23, wherein: Also includes: The media play request acquisition unit is configured to acquire corresponding media play information from the second storage cluster in response to the incremental process not being completely created and failing to acquire corresponding media play information from the working process through the first protocol request.

25. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the live broadcast service hot restart processing method described in any one of claims 1-12.

26. A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the live broadcast service hot restart processing method described in any one of claims 1-12.

27. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the steps of the live broadcast service hot restart processing method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • UDP (User Datagram Protocol) conversation multiplexing method and load balancing equipment

    CN102761608A

  • Data connection restarting method and device and data processing method and device in live broadcast service

    CN110858851A

  • Streaming data recovery method, server, storage medium and computer equipment

    CN112995697A

  • Media information negotiation method, apparatus and device, and storage medium

    CN117812436A

  • Method for an audio / video live broadcast in an html5-based browser

    US20180124140A1