Streaming method, device, medium and computing device

By starting container execution of streaming tasks on the serverless computing platform, the efficiency of large-scale streaming tasks execution in delayed live broadcast scenarios is solved, and server resources are dynamically adjusted, avoiding resource waste and bottlenecks.

CN116095349BActive Publication Date: 2025-02-07HANGZHOU NETEASE CLOUD MUSIC TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211609548.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-14
Publication Date
2025-02-07
Estimated Expiration
2042-12-14

AI Technical Summary

Technical Problem

In the delayed live broadcast scenario, how to efficiently implement large-scale streaming tasks, especially when server resources are insufficient or oversupply, avoid execution bottlenecks and resource waste of streaming tasks.

Method used

Using a serverless computing platform, by starting a container corresponding to the push streaming task, performing push streaming tasks in the container, converting static media files into streaming data, and sending streaming data to the central platform in the content distribution network, to Implement flow operation.

Benefits of technology

Through serverless computing technology, the push-through tasks are executed in the container, and server resources are dynamically adjusted according to the number of push-through tasks, and elastically expand and shrink capacity is performed, thereby improving the execution efficiency of push-through tasks and avoiding resource waste and bottlenecks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116095349B_ABST
    Figure CN116095349B_ABST
Patent Text Reader

Abstract

The embodiments of the present invention provide a streaming method, apparatus, medium and computing device, which are applied to a serverless computing platform; the method includes: obtaining a streaming task initiated by a client; wherein the streaming task includes a static media file to be streamed, and a network address of a content distribution network used for streaming; starting a first container corresponding to the streaming task; executing the streaming task in the first container, converting the static media file into streaming media data, and sending the streaming media data to a central platform in a content distribution network corresponding to the network address, so that the central platform performs a streaming operation based on the streaming media data. The present invention can increase or decrease server resources according to actual needs based on the number of streaming tasks executed, and elastically expand and shrink the container used to execute the streaming task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the technical field of cloud computing. More specifically, embodiments of the present invention relate to a streaming method, apparatus, medium, and computing device. Background Art

[0002] This section is intended to provide a background or context to embodiments of the invention that are recited in the claims. No description herein is admitted to be prior art by inclusion in this section.

[0003] In today's Internet society, live broadcasting has become an important information dissemination medium, carrying the information dissemination needs of various aspects such as e-commerce, entertainment, education, etc. Usually, the acquisition equipment set up on site first collects media data (such as video data, audio data, image data, etc.), and uploads the collected media data to the server through the network to achieve streaming of the collected media data. The server then publishes the received media data to a specific website, and users can download the media data through the client to access the website, so that they can watch the live broadcast used to display the media data.

[0004] In various common live broadcast scenarios, in addition to real-time live broadcast scenarios that display currently collected media data to users in real time, there are also delayed live broadcast scenarios that display pre-collected media data to users in the form of live broadcast at a specific subsequent moment. For example, a party can be held in advance before a festival and related videos can be recorded, and the video can be displayed to users in the form of live broadcast on the day of the festival. In actual applications, how to achieve streaming in delayed live broadcast scenarios has become a highly concerned issue. Summary of the invention

[0005] In this context, embodiments of the present invention are intended to provide a streaming method, apparatus, medium, and computing device.

[0006] In a first aspect of an embodiment of the present invention, a streaming method is provided, which is applied to a serverless computing platform; the method comprises:

[0007] Acquire a streaming task initiated by a client; wherein the streaming task includes a static media file to be streamed and a network address of a content distribution network used for streaming;

[0008] Starting a first container corresponding to the streaming task;

[0009] The streaming task is executed in the first container, the static media file is converted into streaming media data, and the streaming media data is sent to a central platform in a content distribution network corresponding to the network address, so that the central platform performs a streaming operation based on the streaming media data.

[0010] In a second aspect of the embodiments of the present invention, a streaming device is provided, which is applied to a serverless computing platform; the device comprises:

[0011] A task acquisition module, used to acquire a streaming task initiated by a client; wherein the streaming task includes a static media file to be streamed and a network address of a content distribution network used for streaming;

[0012] A container startup module, used to start the first container corresponding to the streaming task;

[0013] The first streaming module is used to execute the streaming task in the first container, convert the static media file into streaming media data, and send the streaming media data to a central platform in the content distribution network corresponding to the network address, so that the central platform performs the streaming operation based on the streaming media data.

[0014] In a third aspect of the embodiments of the present invention, a medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, any of the above streaming methods is implemented.

[0015] In a fourth aspect of the embodiments of the present invention, there is provided a computing device, comprising:

[0016] processor;

[0017] a memory for storing a processor executable program;

[0018] The processor implements any of the above streaming methods by running the executable program.

[0019] According to an embodiment of the present invention, when a serverless computing platform obtains a streaming task initiated by a client and includes a static media file to be streamed and a network address of a content distribution network used for streaming, it can start a container corresponding to the streaming task, execute the streaming task in the container, convert the static media file into streaming media data, and send the streaming media data to a central platform in the content distribution network corresponding to the network address, so that the central platform performs a streaming operation based on the streaming media data.

[0020] By adopting the above method, serverless computing technology is introduced to solve the problem of executing large-scale streaming tasks in delayed live broadcast scenarios, so that streaming tasks can be executed in containers managed by serverless computing platforms, so that server resources can be increased or decreased according to actual needs based on the number of streaming tasks executed, and the container used to execute streaming tasks can be elastically expanded or reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, in which:

[0022] Figure 1 A schematic diagram of a streaming scenario according to an embodiment of the present invention is schematically shown;

[0023] Figure 2 A flow chart of a streaming method according to an embodiment of the present invention is schematically shown;

[0024] Figure 3 A schematic diagram of a server architecture according to an embodiment of the present invention is schematically shown;

[0025] Figure 4 A schematic diagram of a medium according to an embodiment of the present invention is schematically shown;

[0026] Figure 5 A block diagram of a streaming device according to an embodiment of the present invention is schematically shown;

[0027] Figure 6 A schematic diagram of a computing device according to an embodiment of the present invention is schematically shown.

[0028] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION

[0029] The principles and spirit of the present invention will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present invention, and are not intended to limit the scope of the present invention in any way. On the contrary, these embodiments are provided to make the present invention more thorough and complete, and to fully convey the scope of the present invention to those skilled in the art.

[0030] Those skilled in the art know that the embodiments of the present invention can be implemented as a system, device, apparatus, method or computer program product. Therefore, the present invention can be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

[0031] According to an embodiment of the present invention, a streaming method, apparatus, medium and computing device are proposed.

[0032] It should be understood herein that any number of elements in the drawings is for illustration rather than limitation, and any naming is only for distinction rather than having any limiting meaning.

[0033] The principle and spirit of the present invention are explained in detail below with reference to several representative embodiments of the present invention. SUMMARY OF THE INVENTION

[0035] In a live broadcast scenario, streaming media technology is usually used to transmit media data. Streaming media technology refers to a technology that compresses a series of media data and transmits it in segments in the form of streams on the network to transmit media data in real time. In specific implementation, the collected media data can be compressed and encapsulated into multiple compressed data packets, and these multiple compressed data packets can be uploaded to the server in the order of packets; the client can download these multiple compressed data packets in real time, and there is no need to wait for all compressed data packets to be downloaded. It can decompress and display the downloaded compressed data packets while downloading subsequent compressed data packets. Among them, the packaged media data is usually called streaming media data, and the process of transmitting the packaged media data in the collection stage to the server is called the streaming process.

[0036] In the delayed live broadcast scenario, since the pre-collected media data is usually stored as a static media file, the static media file needs to be converted into streaming media data during the subsequent streaming so that the server can obtain the streaming media data, thereby displaying the static media file to the user in the form of a live broadcast.

[0037] In practical applications, static media files may include MP4 files, MPG files, MP3 files, etc.; converting static media files into streaming media files may be converting static media files into data in streaming media formats such as FLV, RM, and WMV.

[0038] In the related art, two methods are usually used to convert the static media file into streaming media data in the delayed live broadcast scenario, and the streaming media data is obtained by the server.

[0039] In one method, the user can use software tools such as OBS (Open Broadcaster Software) and FFmpeg installed on the client to first convert static media files stored locally on the client into streaming media data, and then upload the streaming media data to the server.

[0040] This method of manually pushing the stream with the help of software tools requires users to operate specific equipment to push the stream. It is highly dependent on users and is not universal.

[0041] In another way, static media files stored locally on the server can be converted into streaming media data directly through the streaming component on the server.

[0042] This method of pushing streams through streaming components on the server can free up manpower to a certain extent and perform large-scale streaming tasks with the help of the automation capabilities of the equipment.

[0043] It should be noted that services are generally divided into stateful services and stateless services. The difference between stateful and stateless services lies in whether the server needs to associate a context when running the service. When the server executes each task corresponding to a stateful service, it needs to store the task information of the task so that it can use the stored task information when executing other tasks; a stateful service has only one instance. The information required by the server when executing each task corresponding to a stateless service comes from the information contained in the task itself; although some information is also stored in the server, this information is either unrelated to the task itself or shared by all tasks; a stateless service can have one or more instances.

[0044] In actual applications, streaming services are stateful services. Therefore, for streaming services running on servers, if the number of concurrent streaming tasks is not fixed, it will be difficult to dynamically adjust the number of instances used to execute streaming tasks through elastic expansion and contraction, which will cause a bottleneck in the execution of large-scale streaming tasks when server resources are insufficient, and cause a waste of server resources when server resources are sufficient.

[0045] The present invention provides a technical solution for streaming, so as to optimize the streaming process in a delayed live broadcast scenario. In the technical solution, when a serverless computing platform obtains a streaming task initiated by a client and includes a static media file to be streamed and a network address of a content distribution network for streaming, the serverless computing platform starts a container corresponding to the streaming task, executes the streaming task in the container, converts the static media file into streaming media data, and sends the streaming media data to a central platform in the content distribution network corresponding to the network address, so that the central platform performs a streaming operation based on the streaming media data.

[0046] By adopting the above method, serverless computing technology is introduced to solve the problem of executing large-scale streaming tasks in delayed live broadcast scenarios, so that streaming tasks can be executed in containers managed by serverless computing platforms, so that server resources can be increased or decreased according to actual needs based on the number of streaming tasks executed, and the container used to execute streaming tasks can be elastically expanded or reduced.

[0047] After introducing the basic principles of the present invention, various non-limiting embodiments of the present invention are described in detail below.

[0048] Application Scenario Overview

[0049] The core of cloud computing technology is service-oriented technology. With the continuous development of cloud computing technology, from the initial infrastructure service technology (i.e., IaaS, Infrastructure as a Service) technology, platform service technology (i.e., PaaS, Platform as a Service, Platform as a Service) technology, software service technology (i.e., SaaS, Software as aService, Software as a Service) technology, more types of service-oriented technologies have gradually evolved, such as function as a service (i.e., FaaS, Functions as a Service) technology.

[0050] FaaS can be interpreted as function as a service, or it can be broadly understood as function as a service. When using FaaS, you only need to focus on the code logic, not the server resources. Therefore, FaaS is also closely related to Serverless (Serverless Computing).

[0051] Serverless technology provides a software system architecture that does not require the deployment, configuration, or management of server resources. The server resources required to run the code are all provided by the cloud platform. In practical applications, the Serverless architecture is generally considered to be a design that uses FaaS and PaaS to solve problems.

[0052] The operation of applications usually depends on the underlying operating system and related environment. In order to improve the deployment efficiency of applications and reduce the workload of users when deploying applications, it is usually necessary to focus on the application itself and reuse the underlying operating system and related environment. For example, after installing the operating system and related environment on a device and successfully deploying the application on the device, if the application needs to be ported to another device, it is hoped that the operating system and related environment do not need to be installed on the other device. In this case, container technology comes into being.

[0053] Container technology is a kernel-lightweight virtualization technology for the operating system layer. Common container technologies usually include Docker, Kubernetes, CoreOS, etc. Taking Docker as an example, Docker is an open source application container engine that allows the application files and the corresponding dependent files of the application to be packaged into a portable image, and the image can be published to any device running the Linux operating system or Windows operating system to achieve virtualization.

[0054] A container is a relatively independent operating environment. The container completely uses the sandbox mechanism, and there is no interface between them. In addition, the impact on the outside world should be minimized inside the container.

[0055] The container contains a complete operating environment. In addition to the application files contained in the application itself, the dependent files required to run the application can be packaged into the image. By packaging the application itself and its dependencies, the underlying operating system and related environment can be abstracted.

[0056] Containers have an independent file system. Because containers use system resources, there is no need to have kernel-related code or tools in an independent file system. As long as the set of files in the image is available, the container created based on the image can run.

[0057] Serverless technology and container technology allow users to develop applications for specific functions, which can be run in containers that are fully managed by the platform. The platform can be a serverless platform in the cloud.

[0058] refer to Figure 1 , Figure 1 A schematic diagram of a streaming scenario according to an embodiment of the present invention is schematically shown.

[0059] like Figure 1 As shown, in the above streaming scenario, it may include a server built based on cloud computing services, and at least one client (for example, client 1-N) accessing the server through any type of wired or wireless network.

[0060] The above-mentioned client may correspond to an APP installed by a user on a terminal device used by the user. Specifically, the terminal device may be a smart phone, tablet computer, laptop, PC (Personal Computer), PDA (Personal Digital Assistants), wearable device (e.g., smart glasses, smart watch, etc.), smart car device or game console and other electronic devices.

[0061] The server side may further include a serverless platform, which may provide containers to users. In this case, users may use the serverless platform in the server side through the client side in the form of SDK (Software Development Kit), command line tools, console, etc.

[0062] In addition, in the above streaming scenario, CDN (Content Delivery Network) may also be included, wherein the central device in the CDN establishes a network connection with the Serverless platform in the above server.

[0063] CDN is an intelligent virtual network built on the existing network. It relies on edge servers deployed in various places and uses the load balancing, content distribution, scheduling and other functional modules of the central platform to enable users to obtain the required content nearby, reduce network congestion, and improve user access response speed and hit rate.

[0064] When streaming a static media file that needs to be displayed to users in the form of live broadcast, the above-mentioned client can initiate a streaming task corresponding to the static media file to the serverless computing platform by sending a streaming request corresponding to the static media file to the above-mentioned serverless computing platform. The serverless computing platform can obtain the streaming request and respond to the streaming request, execute the streaming task based on the container managed by the serverless computing platform, convert the static media file into streaming media data, and distribute the above-mentioned streaming media data to multiple users through the above-mentioned content distribution network, thereby realizing the display of the above-mentioned static media file to multiple users in the form of live broadcast.

[0065] In a specific implementation, the client can initiate a streaming task corresponding to the static media file to the serverless computing platform in the form of SDK, command line tool, console, etc. Subsequently, the serverless computing platform can execute the streaming task and convert the static media file into streaming media data.

[0066] That is, the serverless computing platform can obtain the streaming task initiated by the client, wherein the streaming task can include the static media file to be streamed and the network address of the content distribution network used for streaming.

[0067] When the serverless computing platform obtains the streaming task, it can start a container (referred to as a first container) corresponding to the streaming task. The first container can run an application for streaming, so that the streaming task can be executed in the first container.

[0068] After starting the first container, the serverless computing platform can execute the streaming task in the first container. By executing the streaming task, the static media file can be converted into streaming media data, and the streaming media data can be sent to the central platform in the content distribution network corresponding to the network address. In this case, the central platform in the content distribution network can perform the streaming operation based on the streaming media data.

[0069] Exemplary Methods

[0070] Combine the following Figure 1 For application scenarios, refer to Figure 2 and Figure 3 To describe the method for streaming according to an exemplary embodiment of the present invention. It should be noted that the above application scenarios are only shown to facilitate understanding of the spirit and principles of the present invention, and the embodiments of the present invention are not limited in this regard. On the contrary, the embodiments of the present invention can be applied to any applicable scenario.

[0071] refer to Figure 2 , Figure 2 The figure is a flow chart of a streaming method according to an embodiment of the present invention.

[0072] The above streaming method can be applied to a serverless computing platform. The streaming method may include:

[0073] Step 201: Acquire a streaming task initiated by a client; wherein the streaming task includes a static media file to be streamed and a network address of a content distribution network used for streaming.

[0074] In this embodiment, when streaming a static media file that needs to be displayed to the user in the form of a live broadcast, the client can initiate a streaming task corresponding to the static media file to the serverless computing platform by sending a streaming request corresponding to the static media file to the above-mentioned serverless computing platform. Specifically, the client can initiate the streaming task to the serverless computing platform by sending the streaming request to the serverless computing platform in a manner such as SDK, command line tool, console, etc. Subsequently, the serverless computing platform can obtain the streaming request, respond to the streaming request, execute the streaming task, and convert the static media file into streaming media data.

[0075] That is, the serverless computing platform can obtain the streaming task initiated by the client, wherein the streaming task can include the static media file to be streamed and the network address of the content distribution network used for streaming.

[0076] Step 202: Start the first container corresponding to the streaming task.

[0077] In this embodiment, when the serverless computing platform obtains the streaming task, it can start a container (referred to as a first container) corresponding to the streaming task. An application for implementing streaming can be run in the first container, so that the streaming task can be executed in the first container.

[0078] In practical applications, the first container can be regarded as an instance for executing the streaming task.

[0079] Step 203: Execute the streaming task in the first container, convert the static media file into streaming media data, and send the streaming media data to a central platform in the content distribution network corresponding to the network address, so that the central platform performs a streaming operation based on the streaming media data.

[0080] In this embodiment, after starting the first container, the serverless computing platform can execute the streaming task in the first container. By executing the streaming task, the static media file can be converted into streaming media data, and the streaming media data can be sent to the central platform in the content distribution network corresponding to the network address. In this case, the central platform in the content distribution network can perform a streaming operation based on the streaming media data to distribute the streaming media data to multiple users, thereby realizing the display of the static media file to multiple users in the form of live broadcast.

[0081] In the above technical solution, when the serverless computing platform obtains a streaming task initiated by a client that includes a static media file to be streamed and a network address of a content distribution network used for streaming, it can start a container corresponding to the streaming task, execute the streaming task in the container, convert the static media file into streaming media data, and send the streaming media data to a central platform in the content distribution network corresponding to the network address, so that the central platform performs a streaming operation based on the streaming media data.

[0082] By adopting the above method, serverless computing technology is introduced to solve the problem of executing large-scale streaming tasks in delayed live broadcast scenarios, so that streaming tasks can be executed in containers managed by serverless computing platforms, so that server resources can be increased or decreased according to actual needs based on the number of streaming tasks executed, and the container used to execute streaming tasks can be elastically expanded or reduced.

[0083] refer to Figure 3 , Figure 3 It is a schematic diagram of a server architecture according to an embodiment of the present invention.

[0084] like Figure 3 As shown, in the above-mentioned server, in addition to the Serverless platform, a message queue (MQ) and a shared storage space may also be included.

[0085] The life cycle of a message in the above message queue can be divided into three stages: message production, message storage, and message consumption. Specifically, in the message production stage, the producer produces a message and sends it to the message queue; in the message storage stage, the message is stored in the topic of the message queue; in the message consumption stage, the consumer consumes the message in the message queue by subscribing to the topic.

[0086] Among them, the producer is an operating entity for generating messages; in this embodiment, the producer can be the above-mentioned client. The topic is a grouping container for message transmission and storage. The topic is composed of multiple queues. The storage and horizontal expansion of messages are actually achieved through the queues within the topic. The queue is the actual unit container for message transmission and storage. The message is the smallest transmission unit; the message is immutable and becomes immutable after the initial sending and storage. The consumer is an operating entity that consumes the message; in this embodiment, the consumer can be the above-mentioned serverless computing platform. The subscription relationship is the rule configuration of message filtering, retry, and consumption progress.

[0087] The above-mentioned shared storage space refers to the storage space shared by all containers in the above-mentioned serverless computing platform.

[0088] That is, all containers in the serverless computing platform can access the shared storage space.

[0089] In some embodiments, the user can configure the streaming task corresponding to the static media file through the client in the form of SDK, command line tool, console, etc., so that the client can generate a message corresponding to the streaming task and send the message to the message queue in the server. In this case, when the serverless computing platform obtains the streaming task, it can specifically obtain the message from the message queue and determine the streaming task based on the message.

[0090] That is, the client can generate a message corresponding to the streaming task and send the message to the message queue in the server, which stores the message. The serverless computing platform can consume the message stored in the message queue to obtain the message and determine the streaming task based on the message. In this way, the streaming task can be executed on the serverless computing platform with low latency, high concurrency, high availability and high reliability.

[0091] In some embodiments, the static media file to be streamed included in the streaming task may specifically be a storage address of the static media file.

[0092] That is, the streaming task may specifically include the storage address of the static media file to be streamed, and the network address of the content distribution network used for streaming.

[0093] In practical applications, the static files to be streamed can be stored in the above-mentioned shared storage space.

[0094] Correspondingly, when converting the static media file into streaming media data, the serverless computing platform can obtain the static media file corresponding to the storage address from the shared storage space and convert the static media file into streaming media data. In this way, it is possible to avoid directly including the static media file in the streaming task, thereby reducing the workload of the user configuring the streaming task through the client and improving the efficiency of the client initiating the streaming task to the serverless computing platform.

[0095] In some embodiments, a container for executing a streaming task may maintain a task identifier of the streaming task executed by the container.

[0096] That is, the first container may maintain the task identifier of the streaming task, wherein the task identifier of the streaming task may be a task number assigned to the streaming task; different streaming tasks have different task identifiers.

[0097] In practical applications, the corresponding relationship between the task identifier and the task status may be stored in the above shared storage space.

[0098] Correspondingly, for the streaming task executed in the first container, the above-mentioned serverless computing platform can detect in the first container whether the current task state of the streaming task is consistent with the target task state corresponding to the task identifier of the streaming task stored in the above-mentioned shared storage space; if the current task state is inconsistent with the target task state, the streaming task can be switched to the target task state.

[0099] It should be noted that the user can modify the task status corresponding to the task identifier of the streaming task executed in the first container stored in the above-mentioned shared storage space through the above-mentioned client, so that the above-mentioned serverless computing platform can switch the task status of the streaming task in the first container.

[0100] Based on the above content, on the one hand, the task status stored in the above shared storage space is only related to the corresponding streaming task, and has nothing to do with other streaming tasks; on the other hand, although the operation of the first container depends on the task status of the streaming task executed therein, the first container can judge and restore the task status of the streaming task through the shared storage space. Therefore, the streaming task executed in the first container can be regarded as a task corresponding to the stateless service.

[0101] That is, by adopting the above method, the streaming service can be transformed from a stateful service to a stateless service, so that the above serverless computing platform can elastically expand and shrink the containers used to execute streaming tasks, and dynamically adjust the number of containers used to execute streaming tasks.

[0102] Furthermore, in some embodiments, the task status may include any one of the following: a start state, a pause state, and a stop state.

[0103] The start state refers to restarting a paused or stopped streaming task. The pause state refers to pausing the streaming task. The stop state refers to stopping the streaming task.

[0104] In some embodiments, the first container may maintain a task identifier of the streaming task, wherein the task identifier of the streaming task may be a task number assigned to the streaming task; different streaming tasks may have different task identifiers.

[0105] In actual applications, the corresponding relationship between the task identifier and the task progress may be stored in the above shared storage space.

[0106] Correspondingly, for the streaming task executed in the first container, the serverless computing platform can write the correspondence between the task identifier and the task progress of the streaming task into the shared storage space in the first container, and update the task progress stored in the shared storage space in real time.

[0107] Furthermore, in some embodiments, for a streaming task executed in the first container, the serverless computing platform may, in the first container, update the task progress corresponding to the task identifier of the streaming task stored in the shared storage space to task completion in response to an unrecoverable exception occurring in the streaming task.

[0108] In other embodiments, for a streaming task executed in a first container, the serverless computing platform may, in response to a recoverable exception occurring in the streaming task, shut down the first container and start other containers (referred to as second containers) corresponding to the streaming task.

[0109] Subsequently, the serverless computing platform may determine in the second container whether the shared storage space stores the task progress corresponding to the task identifier of the streaming task. If the shared storage space stores the task progress, the streaming task may continue to be executed according to the task progress.

[0110] Based on the above content, it is possible to implement exception recovery for recoverable exceptions that occur in streaming tasks, thereby ensuring that each streaming task is fully executed at least once on the above serverless computing platform, without causing task loss or task execution failure due to such recoverable exceptions.

[0111] Furthermore, in some embodiments, the above-mentioned unrecoverable exception may include any one of the following: failure to download a static media file, failure to read a static media file, and failure to decode a static media file.

[0112] Among them, static media file download failure, reading failure, decoding failure, etc. are generally considered to be input / output (I / O) exceptions.

[0113] When such an exception occurs, it is usually considered that there is an exception in the static media file itself, and the exception cannot be resolved by retrying. Therefore, the task failure can be directly determined, and the task progress corresponding to the task identifier of the above-mentioned streaming task stored in the above-mentioned shared storage space is directly updated to task completion, and the streaming task will no longer be delivered subsequently.

[0114] In other embodiments, the above-mentioned recoverable exceptions may include any one of the following: network exception, container exception.

[0115] The network anomaly may include disconnection from the shared storage space, disconnection from the content distribution network, disconnection from the serverless computing platform, etc. The container anomaly may include host machine anomaly, platform anomaly, etc.

[0116] When such an exception occurs, it can be considered that there is no exception in the streaming task itself, but an exception in the container or host network that executes the streaming task. Therefore, the exception recovery can be achieved by invoking a new container for executing the streaming task.

[0117] Exemplary Media

[0118] After introducing the method of the exemplary embodiment of the present invention, next, refer to Figure 4 A medium for plug flow according to an exemplary embodiment of the present invention will be described.

[0119] In this exemplary embodiment, the above method can be implemented by a program product, such as a portable compact disk read-only memory (CD-ROM) and including program code, and can be run on a device, such as a personal computer. However, the program product of the present invention is not limited to this. In this document, a readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, an apparatus or a device.

[0120] The program product may adopt any combination of one or more readable media, which may be readable signal media or readable storage media.

[0121] The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more conductors, a portable 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 thereof.

[0122] The readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein the readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0123] The program code contained on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RE, etc., or any suitable combination of the foregoing.

[0124] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as C or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user computing device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).

[0125] Exemplary Devices

[0126] After introducing the medium of the exemplary embodiment of the present invention, next, reference is made to Figure 5 A device for pushing flow according to an exemplary embodiment of the present invention will be described.

[0127] The implementation process of the functions and effects of each module in the following device is specifically referred to the implementation process of the corresponding steps in the above method, which will not be repeated here. For the device embodiment, it basically corresponds to the method embodiment, so the relevant parts can be referred to the partial description of the method embodiment.

[0128] refer to Figure 5 , Figure 5 A flow-pushing device according to an embodiment of the present invention is schematically shown.

[0129] The streaming device can be applied to a serverless computing platform; the device may include:

[0130] The task acquisition module 501 is used to acquire a streaming task initiated by a client; wherein the streaming task includes a static media file to be streamed and a network address of a content distribution network used for streaming;

[0131] A container starting module 502 is used to start a first container corresponding to the streaming task;

[0132] The first streaming module 503 is used to execute the streaming task in the first container, convert the static media file into streaming media data, and send the streaming media data to a central platform in the content distribution network corresponding to the network address, so that the central platform performs the streaming operation based on the streaming media data.

[0133] Optionally, the task acquisition module 501 is specifically used for:

[0134] A message initiated by a client and corresponding to a streaming task is obtained from a message queue, and the streaming task is determined based on the message.

[0135] Optionally, the streaming task includes a storage address of a static media file to be streamed, and a network address of a content distribution network used for streaming;

[0136] The first streaming module 503 is specifically used for:

[0137] A static media file corresponding to the storage address is obtained from the shared storage space, and the static media file is converted into streaming media data.

[0138] Optionally, the device may further include:

[0139] The state switching module 504 is used to detect in the first container whether the current task state of the streaming task is consistent with the target task state corresponding to the task identifier of the streaming task stored in the shared storage space; if the current task state is inconsistent with the target task state, the streaming task is switched to the target task state.

[0140] Optionally, the task state includes any one of the following: a start state, a pause state, and a stop state.

[0141] Optionally, the device may further include:

[0142] The progress writing module 505 is used to write the correspondence between the task identifier and the task progress of the streaming task into the shared storage space in the first container, and update the task progress in real time.

[0143] Optionally, the device may further include:

[0144] The progress updating module 506 is used to update the task progress corresponding to the task identifier of the streaming task stored in the shared storage space to task completion in the first container in response to an unrecoverable exception occurring in the streaming task.

[0145] Optionally, the unrecoverable exception includes any one of the following: failure to download the static media file, failure to read the static media file, and failure to decode the static media file.

[0146] Optionally, the device may further include:

[0147] The second streaming module 507 is used for:

[0148] In the first container, in response to a recoverable exception occurring in the streaming task, the first container is closed, and a second container corresponding to the streaming task is started;

[0149] In the second container, it is determined whether the shared storage space stores a task progress corresponding to the task identifier of the streaming task; if the shared storage space stores the task progress, the streaming task is continued to be executed according to the task progress.

[0150] Optionally, the recoverable exception includes any one of the following: network exception, container exception.

[0151] Exemplary Computing Devices

[0152] After introducing the method, medium and apparatus of the exemplary embodiments of the present invention, next, reference is made to Figure 6 A computing device for streaming according to an exemplary embodiment of the present invention is described.

[0153] Figure 6 The computing device 600 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0154] like Figure 6 As shown, the computing device 600 is in the form of a general computing device. The components of the computing device 600 may include but are not limited to: at least one processing unit 601, at least one storage unit 602, and a bus 603 connecting different system components (including the processing unit 601 and the storage unit 602).

[0155] The bus 603 includes a data bus, a control bus, and an address bus.

[0156] The storage unit 602 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 6021 and / or a cache memory 6022 , and may further include a readable medium in the form of a non-volatile memory, such as a read-only memory (ROM) 6023 .

[0157] The storage unit 602 may also include a program / utility 6025 having a set (at least one) of program modules 6024, such program modules 6024 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0158] The computing device 600 may also communicate with one or more external devices 604 (eg, keyboards, pointing devices, etc.).

[0159] Such communication may be performed via input / output (I / O) interface 605. Furthermore, computing device 600 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via network adapter 606. Figure 6 As shown, the network adapter 606 communicates with other modules of the computing device 600 via the bus 603. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the computing device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0160] It should be noted that although several units / modules or subunits / modules of the flow-pushing device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more units / modules described above can be concretized in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules to be concretized.

[0161] In addition, although the operations of the method of the present invention are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0162] Although the spirit and principle of the present invention have been described with reference to several specific embodiments, it should be understood that the present invention is not limited to the disclosed specific embodiments, and the division of various aspects does not mean that the features in these aspects cannot be combined to benefit, and such division is only for the convenience of expression. The present invention is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the attached claims.

Claims

1. A streaming method, applied to a serverless computing platform; the method comprises: Obtaining a message initiated by a client and corresponding to a streaming task from a message queue, and determining the streaming task based on the message; wherein the streaming task includes a storage address of a static media file to be streamed, and a network address of a content distribution network used for streaming; Starting a first container corresponding to the streaming task; The streaming task is executed in the first container, a static media file corresponding to the storage address is obtained from a shared storage space, the static media file is converted into streaming media data, and the streaming media data is sent to a central platform in a content distribution network corresponding to the network address, so that the central platform performs a streaming operation based on the streaming media data.

2. The method according to claim 1, further comprising: In the first container, detect whether the current task state of the streaming task is consistent with the target task state corresponding to the task identifier of the streaming task stored in the shared storage space; if the current task state is inconsistent with the target task state, switch the streaming task to the target task state. 3 . The method according to claim 2 , wherein the task state comprises any one of the following: a start state, a pause state, and a stop state.

4. The method according to claim 1, further comprising: In the first container, the correspondence between the task identifier and the task progress of the streaming task is written into the shared storage space, and the task progress is updated in real time.

5. The method according to claim 4, further comprising: In the first container, in response to an unrecoverable exception occurring in the streaming task, the task progress corresponding to the task identifier of the streaming task stored in the shared storage space is updated to task completion.

6. According to the method of claim 5, the unrecoverable exception comprises any one of the following: failure to download the static media file, failure to read the static media file, and failure to decode the static media file.

7. The method according to claim 4, further comprising: In the first container, in response to a recoverable exception occurring in the streaming task, the first container is closed, and a second container corresponding to the streaming task is started; In the second container, it is determined whether the shared storage space stores a task progress corresponding to the task identifier of the streaming task; if the shared storage space stores the task progress, the streaming task is continued to be executed according to the task progress.

8. According to the method of claim 7, the recoverable exception includes any one of the following: network exception, container exception.

9. A streaming device, applied to a serverless computing platform; the device comprises: A task acquisition module, used to acquire a message corresponding to a streaming task initiated by a client from a message queue, and determine the streaming task based on the message; wherein the streaming task includes a storage address of a static media file to be streamed, and a network address of a content distribution network used for streaming; A container startup module, used to start the first container corresponding to the streaming task; The first streaming module is used to execute the streaming task in the first container, obtain the static media file corresponding to the storage address from the shared storage space, convert the static media file into streaming media data, and send the streaming media data to the central platform in the content distribution network corresponding to the network address, so that the central platform performs the streaming operation based on the streaming media data.

10. The device according to claim 9, further comprising: A state switching module is used to detect in the first container whether the current task state of the streaming task is consistent with the target task state corresponding to the task identifier of the streaming task stored in the shared storage space; if the current task state is inconsistent with the target task state, the streaming task is switched to the target task state. The device according to claim 10 , wherein the task state comprises any one of the following: a start state, a pause state, and a stop state.

12. The device according to claim 9, further comprising: The progress writing module is used to write the corresponding relationship between the task identifier and the task progress of the streaming task into the shared storage space in the first container, and update the task progress in real time.

13. The device according to claim 12, further comprising: The progress updating module is used to update the task progress corresponding to the task identifier of the streaming task stored in the shared storage space to task completion in the first container in response to an unrecoverable exception occurring in the streaming task.

14. The device according to claim 13, wherein the unrecoverable exception comprises any one of the following: failure to download the static media file, and failure to decode the static media file.

15. The apparatus according to claim 12, further comprising: The second streaming module is used for: In the first container, in response to a recoverable exception occurring in the streaming task, the first container is closed, and a second container corresponding to the streaming task is started; In the second container, it is determined whether the shared storage space stores a task progress corresponding to the task identifier of the streaming task; if the shared storage space stores the task progress, the streaming task is continued to be executed according to the task progress.

16. The device according to claim 15, wherein the recoverable exception comprises any one of the following: a network exception and a container exception.

17. A medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method according to any one of claims 1 to 8.

18. A computing device comprising: processor; a memory for storing a processor executable program; The processor implements the method according to any one of claims 1 to 8 by running the executable program.

Citation Information

Patent Citations

  • File carousel flow pushing method and device and live broadcast flow pushing server

    CN114339267A