A method and system for scheduling streaming media in online transcoding

By automatically allocating streaming media servers and monitoring their status through an online transcoding system, the problems of uneven load and downtime of streaming media servers were solved, achieving load balancing and improved user experience.

CN115914188BActive Publication Date: 2026-08-04SHANGHAI WONDERTEK SOFTWARE CORP LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI WONDERTEK SOFTWARE CORP LTD
Filing Date
2022-12-15
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

Existing online audio and video transcoding systems suffer from problems such as uneven streaming media server load, inability to automatically switch over after a crash, and the need to manually input the streaming address, resulting in cumbersome operation and poor user experience.

Method used

By automatically filling in the pull stream address and creating new transcoding tasks, the streaming media service periodically reports the load status. The scheduling service allocates streaming media servers to the cluster service based on the overall resource consumption and load status, automatically establishes the mapping relationship between the push stream address and the pull stream address, and monitors the server status to automatically switch over the failed server.

Benefits of technology

It achieves automatic load balancing of streaming media servers, reducing manual operation, improving user experience, and automatically switching when the server crashes, thereby improving resource utilization and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115914188B_ABST
    Figure CN115914188B_ABST
Patent Text Reader

Abstract

The present application relates to audio and video transcoding technical field, provide a kind of online transcoding in streaming media scheduling method, comprising: S1: in the task configuration file corresponding to transcode task Automatic filling pull stream address;S2: streaming media service regularly reports the load condition of streaming media server to scheduling service;S3: when transcode task executes, scheduling service comprehensively resource consumption and load condition is assigned a streaming media server for cluster service;S4: cluster service is automatically spliced into push stream address to the streaming media server of distribution, and the mapping relationship of push stream address and pull stream address is established;S5: transcode service according to push stream address to corresponding streaming media server push stream;S6: player requests pull stream address, and cluster service according to the mapping relationship of pull stream address and push stream address, the request of player is forwarded to the streaming media server corresponding to push stream address.Solve the problem that streaming media machine load is not balanced, down machine cannot be automatically switched, need to manually input push stream address.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of audio and video transcoding, and more particularly to a streaming media scheduling method and system in online transcoding. Background Technology

[0002] For online audio and video transcoding systems, after transcoding is completed, the audio and video are generally pushed through a streaming media server. When users access audio and video through a player, they access the streaming media server to obtain the audio and video for viewing.

[0003] Typically, an online audio / video transcoding system is configured with multiple streaming media servers. In current technology, this is done by manually assigning a streaming media server to the output of each transcoding task. The specific steps include:

[0004] (1) Prepare a server cluster for the streaming media server;

[0005] (2) Manually enter the push address of the selected streaming media server on the transcoding task page. The format is: "ip:port / xxx / xxx", where ip and port are the IP and port corresponding to the streaming media server.

[0006] (3) The player directly accesses the streaming address.

[0007] Although the player can generally access the stream normally using the above methods, the following problems still exist:

[0008] (1) The streaming address needs to be manually entered on the transcoding task page, which is cumbersome. Furthermore, if the streaming media server corresponding to the current streaming address has a problem, there is no way to automatically and dynamically adjust the streaming media server.

[0009] (2) Since the streaming media server selected for each transcoding task cannot be changed after manual setting, it is easy to cause an imbalance in the load between streaming media servers.

[0010] (3) If the streaming media server corresponding to the transcoding task crashes, the push address needs to be manually modified and switched to another streaming media server. This operation is cumbersome and users will not be able to access it normally for a period of time, resulting in a poor user experience. Summary of the Invention

[0011] To address the aforementioned problems, the present invention aims to provide a streaming media scheduling method and system for online transcoding, solving the problems of uneven streaming media machine load, inability to automatically switch when a machine crashes, and the need for manual input of the push stream address in the prior art.

[0012] The above-mentioned objective of this invention is achieved through the following technical solutions:

[0013] A streaming media scheduling method in online transcoding includes the following steps:

[0014] S1: Create a new transcoding task and automatically fill the streaming address into the task configuration file corresponding to the transcoding task;

[0015] S2: The streaming media service periodically reports the load status of all streaming media servers included in the streaming media service to the scheduling service;

[0016] S3: When the transcoding task starts to execute, the scheduling service allocates a streaming media server to the cluster service by comprehensively considering the resource consumption of the transcoding task and the load of the streaming media server;

[0017] S4: The cluster service automatically concatenates the allocated streaming media server into a push address, establishes a mapping relationship between the push address and the pull address, and sends the push address to the transcoding service.

[0018] S5: The transcoding service pushes the stream to the corresponding streaming media server according to the streaming address;

[0019] S6: The player requests the pull stream address, and the cluster service forwards the player's request to the streaming media server corresponding to the push stream address according to the mapping relationship between the pull stream address and the push stream address.

[0020] Further, in step S1, the automatically filled pull address has the following format:

[0021] ${cluster IP}:${cluster port} / ${outPutType} / ${taskName}, where the cluster IP and cluster port are the IP address and port number of the cluster service, outPutType is the output type, and taskName is the full name of the current transcoding task.

[0022] Furthermore, in step S2, the load information of all the streaming media services included in the streaming media service includes parameter information such as CPU, memory, IO, network port traffic, and CPU temperature.

[0023] Further, in step S4, the cluster service automatically concatenates the allocated streaming media server data into the push address, the push address format including:

[0024] ${streaming IP}:${streaming port} / ${output directory} / ${output name}, where the streaming IP and the streaming port are the assigned IP address and port number of the streaming media server.

[0025] Further, in step S5, the transcoding service specifically includes:

[0026] Receive the push address and transcoding parameters sent by the cluster service;

[0027] The transcoding command is executed according to the transcoding parameters, and the stream is pushed to the assigned streaming media server after the transcoding is completed.

[0028] Furthermore, streaming media scheduling methods in online transcoding also include:

[0029] The scheduling service monitors the running status of the streaming media server. When it detects that the currently allocated streaming media server has crashed, the scheduling service notifies the cluster service of the crash status of the streaming media server, and re-allocates a new streaming media server to the cluster service based on the resource consumption of the transcoding task and the load of the streaming media server.

[0030] The cluster service updates the push address and re-establishes the mapping relationship between the push address and the pull address, while sending the new push address to the transcoding service.

[0031] The transcoding service pushes the stream to the corresponding streaming media server according to the new push address. When the player requests the pull address, the player request is forwarded to the streaming media server corresponding to the new push address according to the new mapping relationship.

[0032] Furthermore, the scheduling service monitors the operating status of the streaming media server, specifically by:

[0033] A heartbeat is set for the streaming media server. If a heartbeat loss exceeding the preset heartbeat loss limit is detected within a preset time interval, and the heartbeats of a preset proportion of the streaming media servers within the streaming media service are normal, then it is determined that the currently allocated streaming media server is down.

[0034] An online transcoding streaming media scheduling system for executing the online transcoding streaming media scheduling method as described above includes:

[0035] The transcoding task creation module is used to create new transcoding tasks and automatically fills the pull stream address into the task configuration file corresponding to the transcoding task.

[0036] The load reporting module is used to provide the streaming media service with periodic reports on the load status of all streaming media servers included in the streaming media service to the scheduling service.

[0037] A streaming media service allocation module is used to allocate a streaming media server to the cluster service when the transcoding task starts to execute, based on the resource consumption of the transcoding task and the load of the streaming media server.

[0038] The push stream address setting module is used to provide the cluster service with an automatic way to concatenate the allocated streaming media server into a push stream address, establish a mapping relationship between the push stream address and the pull stream address, and send the push stream address to the transcoding service.

[0039] A transcoding service push module is used to provide the transcoding service with the ability to push the stream to the corresponding streaming media server according to the push address;

[0040] The player request module is used to provide the player with a request for the pull stream address. The cluster service forwards the player's request to the streaming media server corresponding to the push stream address according to the mapping relationship between the pull stream address and the push stream address.

[0041] A computer device includes a memory and one or more processors, the memory storing computer code that, when executed by the one or more processors, causes the one or more processors to perform the method described above.

[0042] A computer-readable storage medium storing computer code that, when executed, performs the method described above.

[0043] Compared with the prior art, the present invention has at least one of the following beneficial effects:

[0044] (1) A streaming media scheduling method in online transcoding is provided, comprising the following steps: S1: Create a new transcoding task and automatically fill the pull stream address in the task configuration file corresponding to the transcoding task; S2: The streaming media service periodically reports the load status of all streaming media servers included in the streaming media service to the scheduling service; S3: When the transcoding task starts execution, the scheduling service allocates a streaming media server to the cluster service based on the resource consumption of the transcoding task and the load status of the streaming media server; S4: The cluster service automatically concatenates the allocated streaming media server into a push stream address and establishes a mapping relationship between the push stream address and the pull stream address, and sends the push stream address to the transcoding service; S5: The transcoding service pushes the stream to the corresponding streaming media server according to the push stream address; S6: The player requests the pull stream address, and the cluster service forwards the player's request to the streaming media server corresponding to the push stream address according to the mapping relationship between the pull stream address and the push stream address. Using the above technical solution, users do not need to manually select and fill in specific push stream addresses; the push stream address is automatically generated by the server, making the operation more convenient. Meanwhile, the scheduling service will automatically allocate streaming media servers based on load balancing, resulting in higher resource utilization.

[0045] (2) The scheduling service monitors the operating status of the streaming media server. When the currently assigned streaming media server is detected to be down, the scheduling service notifies the cluster service of the downtime status of the streaming media server, and re-allocates a new streaming media server to the cluster service based on the resource consumption of the transcoding task and the load of the streaming media server. By adopting the above technical solution, server downtime can be automatically monitored, and a new streaming media server can be automatically switched after a downtime, improving the user experience. Attached Figure Description

[0046] Figure 1 This is an overall flowchart of the streaming media scheduling method in online transcoding in the first embodiment of the present invention;

[0047] Figure 2 This is a flowchart illustrating the normal operation of the streaming media server in the first embodiment of the present invention;

[0048] Figure 3 This is a flowchart of the abnormal handling after the streaming media server crashes in the first embodiment of the present invention;

[0049] Figure 4 This is an overall structural diagram of the streaming media scheduling system in online transcoding in the second embodiment of the present invention. Detailed Implementation

[0050] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0051] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this specification means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0052] The main idea of ​​this invention is that the output address (pull address) of the transcoding task is automatically filled by the page, and the push stream is automatically allocated to a streaming media server by the system according to the load. When the allocated streaming media server crashes, it automatically switches to another streaming media server.

[0053] Key innovations include:

[0054] (1) The page automatically fills in the streaming address, eliminating the need for manual input by the user;

[0055] (2) Based on the load of the streaming media server, automatically allocate a streaming media server for the transcoding task to push the stream;

[0056] (3) Automatically monitor the operating status of the streaming media server. When the streaming media server is detected to be down, automatically switch to another normally operating streaming media server.

[0057] The following is an illustration through specific examples:

[0058] First Embodiment

[0059] like Figure 1 and Figure 2 As shown, this embodiment provides a streaming media scheduling method in online transcoding. The method specifically includes four services: cluster service, transcoding service, streaming media service, and scheduling service, and includes the following steps:

[0060] S1: Create a new transcoding task and automatically fill the streaming address into the task configuration file corresponding to the transcoding task.

[0061] Specifically, the format of the automatically filled pull stream address is: ${cluster ip}:${cluster port} / ${outPutType} / ${taskName}, where the cluster ip and cluster port are the IP address and port number of the cluster service, outPutType is the output type (HTTP_TS, HTTP-FLV, HLS, etc.), and taskName is the full name of the current transcoding task. The pull stream addresses of different transcoding tasks only differ in type and name, and all of them are known data.

[0062] S2: The streaming media service periodically reports the load status of all streaming media servers included in the streaming media service to the scheduling service.

[0063] Specifically, the load status of the streaming media server can be reported to the scheduling service at a preset time interval. For example, the preset time interval can be configured to be 10 seconds, and the load data of the streaming media server can be reported to the scheduling service once every 10 seconds.

[0064] The load information includes parameters such as CPU, memory, I / O, network port traffic, and CPU temperature.

[0065] S3: When the transcoding task starts to execute, the scheduling service allocates a streaming media server to the cluster service based on the resource consumption of the transcoding task and the load of the streaming media server.

[0066] Specifically, when transcoding begins, the scheduling service will allocate the most suitable streaming media server to the cluster service based on the load and task resource consumption according to the algorithm.

[0067] S4: The cluster service automatically concatenates the allocated streaming media server into a push address, establishes a mapping relationship between the push address and the pull address, and sends the push address to the transcoding service.

[0068] Specifically, the streaming address format includes: ${streaming IP}:${streaming port} / ${output directory} / ${output name}, where the streaming IP and the streaming port are the IP address and port number of the assigned streaming server.

[0069] S5: The transcoding service pushes the stream to the corresponding streaming media server according to the push address, specifically by: receiving the push address and transcoding parameters issued by the cluster service; executing the transcoding command according to the transcoding parameters; and pushing the stream to the assigned streaming media server after the transcoding is completed.

[0070] S6: The player requests the pull stream address, and the cluster service forwards the player's request to the streaming media server corresponding to the push stream address according to the mapping relationship between the pull stream address and the push stream address.

[0071] The above is the execution flow when the streaming media server is functioning normally. Figure 3 As shown, the present invention also includes a switching process when the streaming media server crashes, specifically:

[0072] The scheduling service monitors the operating status of the streaming media server. When it detects that the currently assigned streaming media server has crashed, the scheduling service notifies the cluster service of the crash status and re-allocates a new streaming media server to the cluster service based on the resource consumption of the transcoding task and the load of the streaming media server. The cluster service updates the push address and re-establishes the mapping relationship between the push address and the pull address, and sends the new push address to the transcoding service. The transcoding service pushes the stream to the corresponding streaming media server according to the new push address. When the player requests the pull address, the request is forwarded to the streaming media server corresponding to the new push address according to the new mapping relationship. The above switching process is completed automatically, with an interruption time of no more than 3 seconds. When a user accesses audio and video through a player, the request is automatically forwarded to the new streaming media server used for pushing, and the user is unaware of this process.

[0073] The scheduling service monitors the operating status of the streaming media server. Specifically, it sets a heartbeat for the streaming media server. If a heartbeat loss exceeding a preset limit is detected within a preset time interval, and a preset proportion of the streaming media servers within the streaming media service have normal heartbeats, then the currently assigned streaming media server is determined to be down. For example, if there are 3 heartbeat losses within 30 seconds, and more than 2 / 3 of the streaming media servers have normal heartbeats, then the service is determined to be offline.

[0074] Second Embodiment

[0075] like Figure 4 As shown, this embodiment provides an online transcoding streaming media scheduling system for executing the online transcoding streaming media scheduling method as described in the first embodiment, comprising:

[0076] Transcoding Task Creation Module 1 is used to create new transcoding tasks and automatically fill the pull stream address in the task configuration file corresponding to the transcoding task.

[0077] Load reporting module 2 is used to provide the streaming media service with periodic reports on the load status of all streaming media servers included in the streaming media service to the scheduling service;

[0078] The streaming media service allocation module 3 is used to allocate a streaming media server to the cluster service when the transcoding task starts to be executed, based on the resource consumption of the transcoding task and the load of the streaming media server.

[0079] The push stream address setting module 4 is used to provide the cluster service with an automatic concatenation of the allocated streaming media server into a push stream address, and to establish a mapping relationship between the push stream address and the pull stream address, while sending the push stream address to the transcoding service.

[0080] Transcoding service push module 5 is used to provide the transcoding service with the ability to push the stream to the corresponding streaming media server according to the push address;

[0081] The player request module 6 is used to provide the player with a request for the pull stream address. The cluster service forwards the player's request to the streaming media server corresponding to the push stream address according to the mapping relationship between the pull stream address and the push stream address.

[0082] A computer-readable storage medium stores computer code that, when executed, performs the methods described above. Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. This program can be stored in a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), a magnetic disk, or an optical disk, etc.

[0083] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should also be considered within the scope of protection of the present invention.

[0084] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0085] It should be noted that the above embodiments can be freely combined as needed. The above description is only a preferred embodiment of the present invention. It should be pointed out that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A streaming media scheduling method in online transcoding, characterized in that, Includes the following steps: S1: Create a new transcoding task and automatically fill the streaming address into the task configuration file corresponding to the transcoding task; S2: The streaming media service periodically reports the load status of all streaming media servers included in the streaming media service to the scheduling service; S3: When the transcoding task starts to execute, the scheduling service allocates a streaming media server to the cluster service by comprehensively considering the resource consumption of the transcoding task and the load of the streaming media server. S4: The cluster service automatically concatenates the allocated streaming media server into a push address, establishes a mapping relationship between the push address and the pull address, and sends the push address to the transcoding service. S5: The transcoding service pushes the stream to the corresponding streaming media server according to the streaming address; S6: The player requests the pull stream address, and the cluster service forwards the player's request to the streaming media server corresponding to the push stream address according to the mapping relationship between the pull stream address and the push stream address.

2. The streaming media scheduling method in online transcoding according to claim 1, characterized in that, In step S1, the automatically filled pull address has the following format: ${cluster IP}:${cluster port} / ${outPutType} / ${taskName}, where the cluster IP and cluster port are the IP address and port number of the cluster service, outPutType is the output type, and taskName is the full name of the current transcoding task.

3. The streaming media scheduling method in online transcoding according to claim 1, characterized in that, In step S2, the load information of all streaming media services included in the streaming media service includes parameter information such as CPU, memory, IO, network port traffic, and CPU temperature.

4. The streaming media scheduling method in online transcoding according to claim 1, characterized in that, In step S4, the cluster service automatically concatenates the allocated streaming media server data into the push address, the push address format including: ${streaming IP}:${streaming port} / ${output directory} / ${output name}, where the streaming IP and the streaming port are the assigned IP address and port number of the streaming media server.

5. The streaming media scheduling method in online transcoding according to claim 1, characterized in that, In step S5, the transcoding service specifically includes: Receive the push address and transcoding parameters sent by the cluster service; The transcoding command is executed according to the transcoding parameters, and the stream is pushed to the assigned streaming media server after the transcoding is completed.

6. The streaming media scheduling method in online transcoding according to claim 1, characterized in that, Also includes: The scheduling service monitors the running status of the streaming media server. When it detects that the currently allocated streaming media server has crashed, the scheduling service notifies the cluster service of the crash status of the streaming media server, and re-allocates a new streaming media server to the cluster service based on the resource consumption of the transcoding task and the load of the streaming media server. The cluster service updates the push address and re-establishes the mapping relationship between the push address and the pull address, while sending the new push address to the transcoding service. The transcoding service pushes the stream to the corresponding streaming media server according to the new push address. When the player requests the pull address, the player request is forwarded to the streaming media server corresponding to the new push address according to the new mapping relationship.

7. The streaming media scheduling method in online transcoding according to claim 6, characterized in that, The scheduling service monitors the operating status of the streaming media server, specifically as follows: A heartbeat is set for the streaming media server. If a heartbeat loss exceeding the preset heartbeat loss limit is detected within a preset time interval, and the heartbeats of a preset proportion of the streaming media servers within the streaming media service are normal, then it is determined that the currently allocated streaming media server is down.

8. A streaming media scheduling system for executing the streaming media scheduling method in online transcoding as described in claims 1-7, characterized in that, include: The transcoding task creation module is used to create new transcoding tasks and automatically fills the pull stream address into the task configuration file corresponding to the transcoding task. The load reporting module is used to provide the streaming media service with periodic reports on the load status of all streaming media servers included in the streaming media service to the scheduling service. A streaming media service allocation module is used to allocate a streaming media server to the cluster service when the transcoding task starts to execute, based on the resource consumption of the transcoding task and the load of the streaming media server. The push stream address setting module is used to provide the cluster service with an automatic way to concatenate the allocated streaming media server into a push stream address, establish a mapping relationship between the push stream address and the pull stream address, and send the push stream address to the transcoding service. A transcoding service push module is used to provide the transcoding service with the ability to push the stream to the corresponding streaming media server according to the push address; The player request module is used to provide the player with a request for the pull stream address. The cluster service forwards the player's request to the streaming media server corresponding to the push stream address according to the mapping relationship between the pull stream address and the push stream address.

9. A computer device comprising a memory and one or more processors, the memory storing computer code that, when executed by the one or more processors, causes the one or more processors to perform the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing computer code, wherein when the computer code is executed, the method of any one of claims 1 to 7 is performed.