A media streaming service architecture and a media streaming origin processing method

By creating a new worker process and allocating a port during the hot update of the streaming service, the problem of the old worker process failing to make origin requests is solved, and the downstream users are unaware of the origin request during the hot update of the streaming service.

CN114168877BActive Publication Date: 2025-10-31WUHAN DOUYU NETWORK TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111222807.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-20
Publication Date
2025-10-31
Estimated Expiration
2041-10-20

AI Technical Summary

Technical Problem

In the hot update process of streaming media services, existing technologies cause the listening port of the old worker process to be closed, resulting in the failure of the back-to-origin request, which cannot meet the needs of self-built origin servers.

Method used

Create a new worker process and assign it a push stream port and a back-to-origin port. Configure the push stream port of the new worker process to start listening to receive new push stream requests, while the back-to-origin port of the old worker process continues to receive old back-to-origin requests. The push stream port of the old worker process closes its listening and rejects new push stream requests, and exits the old worker process after there is no more pull stream.

Benefits of technology

To ensure that the source port of the old worker process remains in listening state during hot update, downstream users are unaware of the source flow process, and to avoid situations where the flow in the old worker process cannot be returned to the source.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114168877B_ABST
    Figure CN114168877B_ABST
Patent Text Reader

Abstract

This invention discloses a method and apparatus for controlling hot updates of media streaming services. The method includes: creating a new worker process and assigning a push port and a back-to-origin port to the new worker process; each new worker process corresponds one-to-one with an existing running worker process; configuring the push port of the new worker process to listen for new push requests and configuring the back-to-origin port of the new worker process to receive new back-to-origin requests; configuring the back-to-origin port of the existing worker process to continue receiving existing back-to-origin requests and configuring the push port of the existing worker process to close its listening to reject new push requests; configuring the existing worker process to exit after no more streaming is available. Through these steps, this invention ensures that after a hot update of the streaming service, the back-to-origin port of the existing worker process remains in a listening state, capable of listening for existing back-to-origin requests. Therefore, streams from both the new and existing worker processes can be back-to-origin, preventing back-to-origin failures.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of server technology, and in particular to a streaming service architecture and a streaming back-to-origin processing method. Background Technology

[0002] During service updates, media stream interruptions can negatively impact user experience and downstream business. To ensure stream availability during updates, hot updates of the receiving stream service are necessary. Currently, the hot update solution in the streaming media field generally uses Nginx (a server software). Specifically, Nginx hot updates are implemented through multiple processes. During a hot update, the master process closes the listening port of the old worker processes, then starts a new worker process and configures its listening port. At this time, the old stream on the old worker processes is unaffected, and the new stream is pushed to the listening port of the new worker process; thus, the old stream is not interrupted during or after the update, and the switch between the old and new processes is completed.

[0003] In this hot update scheme, although the hot update process does not affect the existing push and pull streams of the old worker process, the listening port of the old worker process has been closed, which will cause the stream on the old worker process to be unable to be returned to the origin, resulting in the failure of the return to the origin request on the old worker process.

[0004] Therefore, the current hot update process and the problem that the old work process cannot be returned to the source after the update make it difficult to meet the needs of self-built source servers. Summary of the Invention

[0005] In view of the above problems, the present invention proposes a media streaming service hot update control method and device, which can ensure that the source port of the old working process is still in the listening state during and after the hot update of the streaming service, and can listen for old source requests. Thus, the streams in both the new and old working processes can be returned to the source, and there will be no situation where the streams in the old working process cannot be returned to the source, so that downstream users are unaware of the hot update process.

[0006] In a first aspect, this application provides the following technical solution through an embodiment:

[0007] A method for controlling hot updates of a media streaming service includes:

[0008] Create a new worker process and assign a push stream port and a back-to-origin port to the new worker process; wherein, the new worker process corresponds one-to-one with the existing worker process; configure the push stream port of the new worker process to start listening to receive new push stream requests, and configure the back-to-origin port of the new worker process to receive new back-to-origin requests; configure the back-to-origin port of the existing worker process to continue receiving existing back-to-origin requests, and configure the push stream port of the existing worker process to stop listening to reject new push stream requests; configure the existing worker process to exit after there is no more streaming.

[0009] Optionally, before creating the new worker process, the process further includes:

[0010] The old working process is configured to upload streaming information weekly according to a preset period; the streaming information is stored in a preset storage space; after creating a new working process, the process further includes: configuring the new working process to upload streaming information weekly according to a preset period; and storing the streaming information in a preset storage space.

[0011] Optionally, after the origin port of the new worker process or the old worker process receives a new origin request, the following steps are taken:

[0012] Obtain the stream identification information from the new origin request; locate the storage space based on the stream identification information to obtain the target address; send the target address to the downstream service corresponding to the new origin request so that the downstream service pulls the stream based on the target address.

[0013] Optionally, after creating the new worker process, the method further includes:

[0014] Configure a management port for the new working process.

[0015] Optionally, the management port is an HTTP protocol port.

[0016] Optionally, allocating push and return ports for the new worker process includes:

[0017] Obtain unused first and second port numbers; the first and second port numbers are different; based on the unused first and second port numbers, allocate push and return ports to the new working process respectively.

[0018] Optionally, after creating the new worker process, the method further includes:

[0019] Configure the communication mode of the new working process as socket communication.

[0020] Optionally, after creating the new worker process, the method further includes:

[0021] Configure the new working process to upload process status information at a preset period; determine whether the new working process is abnormal based on the process status information and the timestamp of uploading the process status information;

[0022] If so, then execute the corresponding preset operation according to the type of exception.

[0023] Secondly, based on the same inventive concept, this application provides the following technical solution through an embodiment:

[0024] A media streaming service hot update control device, comprising:

[0025] A creation module is used to create new worker processes and assign push and origin ports to them; wherein, each new worker process corresponds one-to-one with an existing running worker process; a first configuration module is used to configure the push port of the new worker process to listen for new push requests and to configure the origin port of the new worker process to receive new origin requests; a second configuration module is used to configure the origin port of the existing worker process to continue receiving existing origin requests and to configure the push port of the existing worker process to close its listening to reject new push requests; a third configuration module is used to configure the existing worker process to exit after there is no more pull stream.

[0026] Thirdly, based on the same inventive concept, this application provides the following technical solution through an embodiment:

[0027] A computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the steps of the method described in any of the first aspects above.

[0028] This invention provides a method and apparatus for controlling hot updates of media streaming services. The method involves creating a new working process during a hot update of the streaming service and assigning a management port, a push port, and a back-to-origin port to the new working process. Each new working process corresponds one-to-one with an existing running working process. The method then configures the push port of the new working process to listen for new push requests and its back-to-origin port to receive new back-to-origin requests. The back-to-origin port of the existing working process is configured to continue receiving old back-to-origin requests, and its push port is configured to close its listening to reject new push requests. Finally, the existing working process is configured to exit after no push or pull requests are received. Through these steps, this invention ensures that during a hot update of the streaming service, the back-to-origin port of the existing working process remains in a listening state, listening for old back-to-origin requests, and all new back-to-origin requests are listened to by the back-to-origin port of the new working process. This guarantees that when downstream users perform back-to-origin requests, streams from both the new and existing working processes can be retrieved, preventing situations where streams from the existing working process cannot be retrieved, and ensuring a seamless experience for downstream users.

[0029] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0030] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:

[0031] Figure 1 A flowchart of a media streaming service hot update control method provided in the first embodiment of the present invention is shown;

[0032] Figure 2 This diagram illustrates the port working state of the old working process before creating a new working process during a hot update of the media streaming service in the first embodiment of the present invention.

[0033] Figure 3 This diagram illustrates the port working states of the new and old working processes after a new working process is created during a hot update of the media streaming service in the first embodiment of the present invention.

[0034] Figure 4 This diagram illustrates the port working status of the new working process after the old working process is shut down during a hot update of the media streaming service in the first embodiment of the present invention.

[0035] Figure 5 A schematic diagram of a media streaming service hot update control device provided in the second embodiment of the present invention is shown. Detailed Implementation

[0036] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0037] This invention provides a media streaming service hot update control method applicable to hot updates of streaming services on live video servers. During normal operation of the video server, the streaming service includes at least two processes: a worker process and a management process (master process). There can be one or more worker processes, and the management process manages these worker processes. The worker processes may contain streaming from downstream servers or users, as well as streaming from other users. During hot updates, the creation and switching of new and old worker processes are involved. During this switching process, the streaming or pushing of data needs to be uninterrupted to ensure a seamless experience for users and meet the requirements of self-built origin servers. While existing technologies can complete hot updates, they often result in failure to retrieve data from the old worker processes after the update. Therefore, this invention proposes a media streaming service hot update control method to smoothly control the switching of new and old worker processes, ensuring a seamless experience for downstream users and meeting the requirements of self-built origin servers. This method can be executed by the management process or by other modules or processes of the video server, without limitation.

[0038] First Embodiment

[0039] Please see Figure 1 , Figure 1 This invention illustrates a media streaming service hot update control method according to a first embodiment. In this embodiment, the method is described using an example where it is executed by a management process. Specifically, the method includes the following steps:

[0040] Step S10: Create a new worker process and assign a push port and a return port to the new worker process; wherein, the new worker process corresponds one-to-one with the old worker process that is currently running.

[0041] In step S10, before the process hot update, the worker processes running in the streaming service are recorded as the old worker processes. When a process hot update is required, a new worker process is created first. When creating a new worker process, it is necessary to allocate corresponding push and return ports, as well as management ports, to the new worker process; similarly, the old worker process also includes management ports, push ports, and return ports.

[0042] The management port is used for communication and interaction between the new worker process and the management process. For example, the worker process reports its current status information to the management process through the management port, and the management process can issue operation commands to the new worker process through the management port, such as exiting the process, closing the port, etc. For example, this management port can be configured by configuring the port for the HTTP (Hypertext Transfer Protocol) protocol.

[0043] The push stream port is used to monitor user push stream information and accept user push streams. For example, this push stream port can be implemented using the RTMP (Real Time Messaging Protocol) protocol.

[0044] The origin port is used to listen for origin-following information from downstream users or servers to enable origin-following downstream. For example, this push streaming port can be implemented using the RTMP protocol port.

[0045] Compared to existing technologies, the push port in this embodiment no longer listens for origin requests. Instead, a separate origin port is allocated to listen for origin requests, achieving port separation. Thus, when a new worker process is created and the push port of the old worker process is closed, the old stream in the old worker process can still listen for new origin requests through the old worker process's origin port, ensuring normal origin requests for the old stream.

[0046] Furthermore, when configuring the push streaming port, the source port, and the management port, they should be configured according to certain rules. In this embodiment, the rules adopted are as follows:

[0047] First, obtain the unused first, second, and third port numbers; these three port numbers must be distinct. Then, based on the unused first and second port numbers, assign push, origin, and management ports to the new worker process. For example, the first port number could be 1935, which can be assigned to the push port of the new worker process; the second port number could be 1900x, such as 19001, 19002, 19003, etc., and any unused second port number can be assigned to the origin port of the new worker process; the third port number could be 1700x, such as 17001, 17002, 17003, etc., and any unused third port number can be assigned to the management port of the new worker process. In existing technology, the default port for the RTMP protocol is 1935. When only port 1935 is used for listening, after a new worker process is created, only port 1935 of the new worker process is processing the working state at any given time. In this embodiment, a separate port 1900x is configured for source listening, ensuring that the source port in each worker process is different and independent. This avoids the failure of new source requests for old flows in the old worker process after a new worker process is created.

[0048] Furthermore, in this embodiment, when creating a new worker process, or subsequently, the management port configured for the new worker process can be an HTTP interface. The HTTP interface serves as the interface for debugging the new worker process. When using the HTTP interface for debugging, developers can directly access and call the worker process through the HTTP interface to perform related debugging operations, without needing to go through the management process for forwarding, thus improving debugging efficiency and reducing computational resource overhead. In the prior art, during debugging, access to the management process is performed, and the management process forwards the requests to achieve debugging of the corresponding worker process.

[0049] Furthermore, it can be configured to use socket communication when communicating with new worker processes via the HTTP interface. Compared to existing technologies that use message queues for interaction, HTTP interface communication is based on sockets, and the information during communication is text-based, which is easy for developers to understand and improves debugging efficiency; in existing technologies, communication uses binary messages, which developers cannot directly understand.

[0050] Step S20: Configure the push port of the new worker process to start listening to receive new push requests, and configure the return port of the new worker process to receive new return requests.

[0051] Step S30: Configure the old worker process's origin port to continue receiving old origin requests, and configure the old worker process's push stream port to close listening to refuse to receive new push stream requests.

[0052] In steps S20-S30, a new push request refers to a push request initiated after a new worker process is created. A new back-to-origin request refers to a request to back-to-origin a stream in a new worker process. An old back-to-origin request refers to a request to back-to-origin a stream in an old worker process.

[0053] When the push stream port in the new worker process starts listening, the push stream port in the old worker process closes, ensuring that new push stream requests are heard by the new worker process. This ensures that subsequent new push streams are completely transferred to the new worker process. Similarly, when the origin pull port in the new worker process starts listening, the old worker process will reject new origin pull requests and continue accepting old ones. The origin pull port in the old worker process will listen for old origin pull requests corresponding to streams in the old worker process, and the origin pull port in the new worker process will listen for new origin pull requests corresponding to streams in the new worker process, thus enabling origin pulls for new streams in the new worker process. This ensures that origin pulls for streams can be performed correctly in both the new and old worker processes.

[0054] Furthermore, to ensure the execution of the origin retrieval process, a global caching design is implemented in this embodiment. Specifically, after creating a new worker process, the following is also included:

[0055] The new worker process is configured to upload streaming information at a preset period; then, the streaming information is stored in a preset storage space, which can be cached. Similarly, streaming information in the old worker process will also be uploaded at a preset period and stored in the preset storage space; thus ensuring that all streaming information is cached, achieving global caching. The preset period can be 0.5s, 1s, 2s, 10s, etc., without limitation. Streaming information includes, but is not limited to: streaming identification information, such as streaming ID (IdentityDocument); streaming URL (Uniform Resource Locator) address; streaming status information, such as streaming disconnection in the new or old worker process, and streaming creation.

[0056] Once the origin port of a new or old worker process receives a new origin request, the specific steps for executing the origin request are as follows:

[0057] Step S101: Obtain the stream identification information from the new origin request;

[0058] Step S102: Locate the storage space based on the stream identification information to obtain the target address;

[0059] Step S103: Send the target address to the downstream service corresponding to the new origin request, so that the downstream service pulls the stream based on the target address.

[0060] In steps S101-S103, the new origin pull request carries the stream identification information, such as the stream ID, that needs to be pulled back to the origin. Then, based on this identification information, the URL address of the target stream can be found in the corresponding cache location; the downstream service can then pull the stream through this URL address to achieve origin pull.

[0061] Furthermore, after creating a new worker process, it can be configured to upload process status information at a preset period; similarly, before creating a new worker process, it can be configured to upload process status information at a preset period for existing worker processes. Then, based on the process status information and the timestamp of uploading that information (i.e., the heartbeat timestamp), it is determined whether the worker process corresponding to that status information is abnormal. If it is confirmed that the worker process corresponding to that status information is abnormal, then the corresponding preset operation is executed according to the type of abnormality. For example:

[0062] If a worker process is in the initialization state and its heartbeat timestamp has expired, it indicates an abnormal startup of the corresponding worker process; a new worker process needs to be restarted as the current worker process. If a worker process is in the working state and its heartbeat timestamp has expired, it indicates an abnormal worker process; the corresponding stream information of the worker process needs to be cleaned up, and a new worker process needs to be started to replace the current worker process. If a worker process is in the graceful exit state and its heartbeat timestamp has expired, it indicates that the corresponding worker process has exited; in this case, simply clean up the corresponding stream information.

[0063] Step S40: Configure the old working process to exit after no more streaming is available.

[0064] In step S40, after the new working process is created, both newly generated push and pull streams reside within it. At this time, the streams in the old working process will gradually decrease until there are no more pull streams, at which point it can exit. Ultimately, the entire hot update process achieves a seamless switch between the new and old working processes, without affecting the normal use by downstream users.

[0065] It should be noted that the execution order of steps S20-S40 is not restricted in this embodiment.

[0066] Please see Figure 2 , Figure 3 and Figure 4 ,exist Figures 2-4 The diagram illustrates the principle of switching the old worker process (work1) to the new worker process (work2) during a hot update using the media streaming service hot update control method described in the embodiment. When the old worker process (work1) is working normally, port 1935 listens for push streaming, and port 19001 listens for source pull streaming. Figure 2 As shown. During hot updates, a new worker process, work2, is created and configured with the corresponding port. At this time, both the old worker process work1 and the new worker process work2 exist simultaneously, as shown. Figure 3 As shown. The old worker process `work1` stops listening on port 1935, no longer accepting new streams, but maintaining the existing streams unaffected. At this time, port 1935 is on the new worker process `work2`. Port 19001 no longer accepts new origin requests, but remains listening, continuing to listen for existing origin requests for the old streams, ensuring the old streams' origin requests are unaffected. The new worker process `work2` receives new streams on port 1935 and new origin requests on port 19002. Thus, no new streams will be added to the old worker process `work1`. After the old streams have completely finished, the old worker process `work1` can be closed, leaving only the new worker process `work2`. Figure 4 As shown. Ultimately, this achieves transition control between the old and new work processes.

[0067] In summary, the media streaming service hot update control method provided in this embodiment creates a new worker process during a hot update of the streaming service, and assigns a management port, a push port, and a back-to-origin port to the new worker process. Each new worker process corresponds one-to-one with an existing running worker process. Then, the push port of the new worker process is configured to listen for new push requests, and its back-to-origin port is configured to receive new back-to-origin requests. The back-to-origin port of the old worker process is configured to continue receiving old back-to-origin requests, and its push port is configured to close its listening to reject new push requests. The old worker process is configured to exit after there is no push or pull streaming. These steps ensure that during and after the hot update of the streaming service, the back-to-origin port of the old worker process remains in a listening state, listening for old back-to-origin requests, and all new back-to-origin requests are listened to by the back-to-origin port of the new worker process. This ensures that when downstream users perform back-to-origin requests, streams from both the new and old worker processes can be retrieved, preventing situations where streams from the old worker process cannot be retrieved, and guaranteeing a seamless experience for downstream users.

[0068] Second Embodiment

[0069] Please see Figure 5 Based on the same inventive concept, a second embodiment of the present invention provides a media streaming service hot update control device 300. The media streaming service hot update control device 300 includes:

[0070] A creation module 301 is used to create a new worker process and allocate a push stream port and a back-to-origin port to the new worker process; wherein, the new worker process corresponds one-to-one with the running old worker process; a first configuration module 302 is used to configure the push stream port of the new worker process to open listening to receive new push stream requests, and to configure the back-to-origin port of the new worker process to receive new back-to-origin requests; a second configuration module 303 is used to configure the back-to-origin port of the old worker process to continue receiving old back-to-origin requests, and to configure the push stream port of the old worker process to close listening to reject new push stream requests; a third configuration module 304 is used to configure the old worker process to exit after there is no more pull stream.

[0071] As an optional implementation, it also includes: an upload module;

[0072] The system is configured to, before creating a new working process, upload streaming information to the old working process at a preset period; and store the streaming information in a preset storage space. It is also configured to, after creating a new working process, upload streaming information to the new working process at a preset period; and store the streaming information in a preset storage space.

[0073] As an optional implementation, it further includes: a back-to-origin module, used to, after the back-to-origin port of the new worker process or the old worker process receives a new back-to-origin request,

[0074] Obtain the stream identification information from the new origin request; locate the storage space based on the stream identification information to obtain the target address; send the target address to the downstream service corresponding to the new origin request so that the downstream service pulls the stream based on the target address.

[0075] As an optional implementation, the creation module 301 is also used to configure a management port for the new working process.

[0076] As an optional implementation, the management port is an HTTP protocol port.

[0077] As an optional implementation, the creation module 301 is specifically used for:

[0078] Obtain unused first and second port numbers; the first and second port numbers are different; based on the unused first and second port numbers, allocate push and return ports to the new working process respectively.

[0079] As an optional implementation, it further includes: a fourth configuration module, used to configure the communication mode of the new working process as socket communication after the new working process is created.

[0080] As an optional implementation, the sixth configuration module is configured, after the creation of the new working process, to upload process status information of the new working process according to a preset period; to determine whether the new working process is abnormal based on the process status information and the timestamp of uploading the process status information; if so, to perform the corresponding preset operation according to the type of abnormality.

[0081] It should be noted that the media streaming service hot update control device 300 provided in this embodiment of the invention has the same specific implementation and technical effects as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment.

[0082] Third Embodiment

[0083] Based on the same inventive concept, another embodiment of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods described in the first embodiment above.

[0084] It should be noted that the specific implementation of each step and the resulting technical effects in the computer-readable storage medium provided in the embodiments of the present invention are the same as those in the foregoing method embodiments. For the sake of brevity, any parts not mentioned in this embodiment can be referred to the corresponding content in the foregoing method embodiments.

[0085] The term "and / or" as used herein is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects are in an "or" relationship; the word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of multiple such elements. This invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims listing several means, several of these means can be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.

[0086] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0087] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0088] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0089] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0090] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0091] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A method for controlling hot updates of media streaming services, characterized in that, include: Create a new worker process and assign a push port and a return port to the new worker process; wherein, the new worker process corresponds one-to-one with the old worker process that is currently running; Configure the push port of the new worker process to start listening to receive new push requests, and configure the return port of the new worker process to receive new return requests; Configure the old worker process's origin port to continue receiving old origin requests, and configure the old worker process's push stream port to close its listening to refuse to receive new push stream requests; Configure the old worker process to exit after no more streaming is available; The allocation of push and return ports for the new working process includes: Obtain the unused first and second port numbers; the first port number and the second port number are different. Based on the unused first port number and second port number, a push port and a return port are assigned to the new working process, respectively.

2. The method according to claim 1, characterized in that, Before creating the new worker process, the following is also included: Configure the old working process to upload streaming information according to a preset cycle; Store the stream information to a preset storage space; After creating the new worker process, the following is also included: The new working process is configured to upload streaming information according to a preset cycle; Store the stream information to a preset storage space.

3. The method according to claim 2, characterized in that, When the origin port of the new worker process or the old worker process receives a new origin request, it includes: Obtain the stream identification information from the new origin request; The target address is obtained by locating the storage space based on the stream identification information; The target address is sent to the downstream service corresponding to the new origin request, so that the downstream service pulls the stream based on the target address.

4. The method according to claim 1, characterized in that, After creating the new worker process, the following is also included: Configure a management port for the new working process.

5. The method according to claim 4, characterized in that, The management port is an HTTP protocol port.

6. The method according to claim 1, characterized in that, After creating the new worker process, the following is also included: Configure the communication mode of the new working process as socket communication.

7. The method according to claim 1, characterized in that, After creating the new worker process, the following is also included: The new working process is configured to upload process status information at a preset period. Based on the process status information and the timestamp of uploading the process status information, determine whether the new working process is abnormal; If so, then execute the corresponding preset operation according to the type of exception.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the method described in any one of claims 1-7.

Citation Information

Patent Citations

  • Merging back-source method and device for multiple processes of streaming media service

    CN105824707A

  • Data distribution system and method and computer readable storage medium

    CN109151491A