Video transcoding scheduling method, device, computer equipment and storage medium

By collecting and generating load and quality views in real time, and dynamically scheduling transcoding tasks, the problem of low utilization of video transcoding resources is solved, load-quality balance is achieved, resource utilization is improved and cost is reduced.

CN114245139BActive Publication Date: 2025-09-02GUANGZHOU BAIGUOYUAN INFORMATION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The prior art has low resource utilization rate and excessive load or too low when transcoding video data, resulting in waste of machine resources and increased costs.

Method used

Collect load and quality data of the transcoding device in real time, generate load views and quality views, divide task types according to different dimensions, and select appropriate transcoding devices in the view to process tasks, and dynamically schedule transcoding tasks to balance load and quality.

Benefits of technology

It improves the overall utilization rate of transcoding resources, reduces computing costs, meets the quality needs of transcoding video data, and saves development time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114245139B_ABST
    Figure CN114245139B_ABST
Patent Text Reader

Abstract

The present invention provides a scheduling method, apparatus, computer equipment and storage medium for video transcoding, the method comprising: respectively collecting in real time the load data and quality data of the transcoding device when performing transcoding operations on video data, respectively extracting the load data and quality data related to multiple dimensions for the transcoding device, and respectively recording them in the load view and quality view under the multiple dimensions, receiving a transcoding task, the transcoding task being used to perform transcoding operations on video data, dividing the task type of the transcoding task under the dimension, selecting a transcoding device suitable for processing the task type in the load view or the quality view, sending the transcoding task to the transcoding device for processing, achieving a dynamic balance between the load of the transcoding device and the quality of transcoding, meeting the quality requirements of video data transcoding in business terms with minimal computing cost, improving the utilization rate of the overall transcoding resources, and saving development time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of video transcoding, and in particular to a scheduling method, apparatus, computer equipment and storage medium for video transcoding. Background Art

[0002] Video data is widely used in entertainment, security, daily life and other scenarios, and is presented in various forms, such as live broadcasts and short videos. In response to business needs in different scenarios, some standardization organizations have proposed multiple video encoding standards. In order to adapt to different network bandwidths, different terminal processing capabilities, different user needs, etc., video data is usually transcoded from one encoding standard to another.

[0003] Transcoding video data consumes a large amount of machine resources. To rationally utilize machine resources and minimize machine costs, developers estimate the transcoding load. This is usually an empirical value derived from factors such as the results of offline stress testing of existing video data and actual video data parameters.

[0004] However, the parameters of actual video data change quickly, which often causes the actual transcoding load to be too high or too low, and the overall resource utilization is low. Summary of the Invention

[0005] The present invention proposes a scheduling method, apparatus, computer equipment and storage medium for video transcoding to solve the problem of improving resource utilization of video data transcoding.

[0006] In a first aspect, an embodiment of the present invention provides a method for scheduling video transcoding, comprising:

[0007] respectively collecting, in real time, load data of a transcoding device when performing a transcoding operation on video data and quality data of the transcoding operation;

[0008] extracting the load data and the quality data related to multiple dimensions from the transcoding device respectively, and recording them in the load view and the quality view under the multiple dimensions respectively;

[0009] receiving a transcoding task, wherein the transcoding task is used to perform a transcoding operation on video data;

[0010] Dividing the task types of the transcoding tasks under the dimensions;

[0011] Selecting the transcoding device suitable for processing the task type in the load view or the quality view;

[0012] The transcoding task is sent to the transcoding device for processing.

[0013] In a second aspect, an embodiment of the present invention further provides a video transcoding scheduling device, comprising:

[0014] Running a data acquisition module for respectively acquiring in real time load data of a transcoding device when performing a transcoding operation on video data and quality data of the transcoding operation;

[0015] a view recording module, configured to extract the load data and the quality data related to multiple dimensions for the transcoding device, and record them in load views and quality views under the multiple dimensions, respectively;

[0016] A transcoding task receiving module, configured to receive a transcoding task, wherein the transcoding task is configured to perform a transcoding operation on video data;

[0017] A task type classification module, configured to classify the task types of the transcoding tasks under the dimensions;

[0018] A transcoding device selection module, configured to select the transcoding device suitable for processing the task type in the load view or the quality view;

[0019] The transcoding task distribution module is used to send the transcoding task to the transcoding device for processing.

[0020] In a third aspect, an embodiment of the present invention further provides a computer device, comprising:

[0021] one or more processors;

[0022] a memory for storing one or more programs,

[0023] When the one or more programs are executed by the one or more processors, the one or more processors implement the video transcoding scheduling method as described in the first aspect.

[0024] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the scheduling method for video transcoding as described in the first aspect is implemented.

[0025] In this embodiment, the load data and quality data of the transcoding device when performing transcoding operations on video data are collected in real time, the load data and quality data related to multiple dimensions are extracted from the transcoding device, and are recorded in the load view and quality view under multiple dimensions respectively, and a transcoding task is received. The transcoding task is used to perform transcoding operations on video data, and the task type of the transcoding task is divided under the dimension. A transcoding device suitable for processing the task type is selected in the load view or the quality view, and the transcoding task is sent to the transcoding device for processing. This embodiment dynamically schedules transcoding tasks based on load and quality, so that the load of the transcoding device and the quality of transcoding can be taken into account, and a dynamic balance is achieved between the load of the transcoding device and the quality of transcoding, so that the quality requirements of video data transcoding are met in business with minimal computing cost, the utilization rate of overall transcoding resources is improved, and development time is saved. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 A flowchart of a video transcoding scheduling method provided in Example 1 of the present invention;

[0027] Figure 2 This is an architecture diagram of a video transcoding scheduling system provided in Example 1 of the present invention;

[0028] Figure 3 This is an example diagram of a view provided in the first embodiment of the present invention;

[0029] Figure 4 This is a flowchart of a video transcoding scheduling method provided by the second embodiment of the present invention;

[0030] Figure 5 This is a flowchart of a video transcoding scheduling method provided by Embodiment 3 of the present invention;

[0031] Figure 6 A schematic structural diagram of a video transcoding scheduling device provided in a fourth embodiment of the present invention;

[0032] Figure 7 This is a structural diagram of a computer device provided in Example 5 of the present invention. DETAILED DESCRIPTION

[0033] The present invention will be further described in detail below with reference to the accompanying drawings and examples. It will be understood that the specific embodiments described herein are intended only to illustrate the present invention and are not intended to limit the present invention. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions relevant to the present invention, not all structures.

[0034] Example 1

[0035] Figure 1This is a flowchart of a video transcoding scheduling method provided in the first embodiment of the present invention. This embodiment is applicable to the case of scheduling video data transcoding tasks in different dimensions under load and quality. The method can be performed by a video transcoding scheduling device. The video transcoding scheduling device can be implemented by software and / or hardware and can be configured in a computer device, such as a server, workstation, personal computer, etc., and specifically includes the following steps:

[0036] Step 101 : Collect in real time the load data and the quality data of the transcoding operation when the transcoding device performs the transcoding operation on the video data.

[0037] In this embodiment, multiple machines are deployed according to business needs. A process or thread can be generated in each machine device to independently undertake one or more transcoding tasks. The transcoding tasks are used to perform transcoding operations on video data. Therefore, the machine can also be called a transcoding device.

[0038] Among them, the transcoding operation is to first decode the video data and then encode it, converting it from one coding standard to another, such as MPEG-4, H.264, H.265, VC-1, etc.

[0039] According to the type of computing hardware device, transcoding operations can be divided into:

[0040] 1. CPU (central processing unit) decoding, CPU encoding

[0041] 2. GPU (graphics processing unit) decoding, GPU encoding

[0042] 3. Decoding and encoding of heterogeneous hardware other than CPU and GPU

[0043] These encoding and decoding methods can be used in combination to complete the transcoding operation of video data.

[0044] Furthermore, a container cluster is installed on multiple transcoding devices, containers are generated in the container cluster, and processes or threads for performing transcoding operations are generated in the containers. The container is an abstraction of program code and its dependencies at the application layer. Multiple containers each run as an independent process in the user space on the same machine and share the operating system kernel.

[0045] Taking Kubernetes as an example of a container cluster, Kubernetes is a platform for automated container operations that provides functions such as application deployment, maintenance, and expansion mechanisms. It can be used to manage containerized applications running across clusters.

[0046] A cluster in Kubernetes refers to a group of nodes, which can be physical machines or virtual machines, on which the Kubernetes platform is installed. Kubernetes typically includes the following structure:

[0047] Node: A node is a physical machine or a virtual machine that acts as a worker. A node is also commonly called a Minion.

[0048] Pod (instance): Pod is the smallest or simplest basic unit created or deployed by Kubernetes. A pod represents a process running on Kubernetes. A pod encapsulates one or more containers, storage resources, an independent IP (Internet Protocol) address, and policy options for managing and controlling how containers run.

[0049] That is, a node is provided in Kubernetes, and a pod is provided in the node to accommodate a container, so that the container in the pod generates a process or thread for performing a transcoding operation.

[0050] In this embodiment, a video transcoding scheduling system is deployed in a computer device, and the video transcoding scheduling system is responsible for scheduling transcoding tasks, such as Figure 2 As shown, the video transcoding scheduling system can be divided into the following parts:

[0051] 1. CsMgrLoadGw (collector)

[0052] CsMgrLoadGw is responsible for collecting the load of the transcoding device and detecting the quality of the transcoding operation.

[0053] For the load, an agent can be installed in each transcoding device. When the transcoding device performs tasks and transcodes video data, the agent can collect the load data of the transcoding device at preset time intervals and upload the load data to CsMgrLoadGw.

[0054] The load data may include CPU occupancy, GPU occupancy, memory occupancy, heterogeneous hardware occupancy, and the like.

[0055] Furthermore, different frequencies can be set for different types of load data, so that the corresponding type of load data can be collected according to the frequency. While ensuring the real-time nature of the load data, resource consumption is reduced, configuration management is facilitated, and it has good scalability.

[0056] CsMgrLoadGw aggregates the load data reported by the agent and preprocesses it, such as sorting and filtering out noise that interferes with scheduling. It then writes the load data to the video transcoding scheduling system's cache, such as Etcd or Redis. In the cache, different types of load data for each transcoding device can be assigned to separate key-value pairs.

[0057] Regarding quality, it can be reported simultaneously by the business end using video data (such as a web server, streaming media server, etc.) and the transcoding device (especially the process or thread used to perform transcoding operations). Both the business end and the transcoding device can report part or all of the quality data. The quality data reported by the business end and the quality data reported by the transcoding device can be the same or different. This embodiment does not limit this.

[0058] In the specific implementation, on the one hand, CsMgrLoadGw receives the quality data of the transcoding operation collected by the business end using the video data, and on the other hand, CsMgrLoadGw receives the quality data of the transcoding operation collected by the transcoding device, thereby merging the quality data collected by the business end with the quality data collected by the transcoding device.

[0059] Considering that the business end provides services to users, the quality data can be based on the business end. During the merging process, if the quality data collected by the business end overlaps with the quality data collected by the transcoding device (that is, the type of quality data is the same), the quality data collected by the transcoding device can be ignored and the quality data collected by the business end can be retained.

[0060] Exemplarily, the quality data includes at least one of the following:

[0061] Transcoding latency, video data resolution and bitrate, image quality score, transcoding parameters, transcoding accumulation information, and resource (such as CPU, GPU) usage information (such as occupancy rate and remaining amount) of the transcoding process or thread.

[0062] Among them, the transcoding delay refers to the delay when performing the transcoding operation on the video data, the image quality score is an indicator for independently evaluating the image quality of the transcoded video data, and the transcoding accumulation information is information for evaluating the video data waiting in the queue for the transcoding operation (such as quantity, waiting time, etc.).

[0063] In this example, the business end can report the transcoding delay, resolution and bit rate of the video data, and the transcoding device can report the transcoding delay, resolution and bit rate of the video data, quality score of the image quality, transcoding parameters, transcoding accumulation information, and resource usage information of the transcoding process or thread.

[0064] Therefore, if the business end successfully reports the transcoding delay, video data resolution and bit rate, the transcoding delay, video data resolution and bit rate reported by the transcoding device can be ignored.

[0065] Furthermore, different frequencies can be set for different types of quality data, so that the corresponding type of load data is collected according to the frequency. Quality data is usually collected every 30 seconds to 60 seconds. While ensuring the real-time quality data, it reduces resource consumption, facilitates configuration management, and has good scalability.

[0066] CsMgrLoadGw aggregates load data reported by business clients and transcoding devices, preprocesses the quality data, such as sorting and filtering out noise that interferes with scheduling, and writes the quality data to the video transcoding scheduling system's cache, such as Etcd and Redis. In the cache, different types of quality data can be set as independent key-value pairs.

[0067] 2. CsMgr (Dispatching Center)

[0068] CsMgr generates load views and quality views in multiple dimensions based on the load data and quality data collected by CsMgrLoadGw, and schedules transcoding tasks based on the load views and quality views.

[0069] The cache accessible to CsMgrLoadGw (such as Etcd, Redis, etc.) and the cache accessible to CsMgr (such as Etcd, Redis, etc.) will synchronize data (such as load data and quality data), so that CsMgr can access the load data and quality data collected by CsMgrLoadGw.

[0070] Step 102: Extract load data and quality data related to multiple dimensions from the transcoding device, and record them in load views and quality views under the multiple dimensions.

[0071] like Figure 3 As shown, each transcoding device has multiple types of resources, such as CPU, GPU, memory, etc. Different types of transcoding operations have different resource requirements. Therefore, in this embodiment, multiple transcoding operation-related dimensions can be set, such as computer room, region (geographical location), resource type (CPU encoding and decoding (i.e., soft encoding, soft decoding), GPU encoding and decoding (i.e., hard encoding, hard decoding), heterogeneous hardware encoding and decoding (i.e., hard coding, hard decoding)), etc., to reflect different resource requirements.

[0072] On the one hand, under a dimension, the load data with a high correlation with the dimension is extracted from all the load data in the transcoding device, and the load data of the transcoding device is written into a view, which is recorded as a load view.

[0073] On the other hand, under a dimension, quality data with a high correlation with the dimension is extracted from all quality data in the transcoding device, and the quality data of the transcoding device is written into a view, which is recorded as a quality view.

[0074] The dimension set for the load view and the dimension set for the quality setting may be the same or different, and this embodiment does not impose any limitation on this.

[0075] Step 103: Receive a transcoding task.

[0076] In this implementation, if Figure 2 As shown, the business end using video data can continuously receive the code generation task and send it to CsMgr according to business needs. The transcoding task is used to perform transcoding operations on the video data. The video data can be existing video data. At this time, the transcoding operation may be adjusted due to network reasons, etc., or it can be new video data. This embodiment does not limit this.

[0077] If the transcoding task has a high real-time requirement (ie, a real-time task), a streaming real-time system can be set up, and the user uploads the video data to the streaming real-time system in real time through the client in a streaming manner and waits for transcoding.

[0078] If the transcoding task has low real-time requirements (i.e., offline tasks), a database, such as a distributed database, can be set up. Users upload video data to the database through client streaming for persistence and wait for transcoding.

[0079] Step 104: Divide the task types of the transcoding tasks into dimensions.

[0080] There are many forms of video data, such as live broadcast, short video, video conversation, etc., among which live broadcast includes interactive entertainment live broadcast, security live broadcast, conference live broadcast, teaching live broadcast, etc., which are not limited in this embodiment.

[0081] like Figure 2 As shown, the task types of transcoding tasks can be divided into real-time tasks and offline tasks according to the business of video data. For the same form of video data, its transcoding tasks can be divided into real-time tasks in some cases and offline tasks in some cases.

[0082] Considering that real-time tasks have a significant impact on business, if the transcoding task is a real-time task, the attributes set for the transcoding operation of the video data are read in the transcoding task.

[0083] Query the task model set under a certain dimension. The task model is used to describe the classification requirements of the task type, so as to match the attributes with the task model to further classify the task types of transcoding tasks. By subdividing the task types of real-time tasks, the accuracy of transcoding task scheduling can be guaranteed, and appropriate resources can be allocated to perform transcoding tasks, ensuring the real-time performance of transcoding tasks and thus ensuring the quality of the service.

[0084] In a specific implementation, one or more attributes related to the dimension can be queried as target attributes. For example, if the dimension is soft-coded, the resolution, average frame rate, and transcoding parameters of the video data can be extracted as target attributes.

[0085] Query the conditions set for each target attribute in the task model. For example, the condition for setting the resolution is greater than or equal to the first threshold, the condition for setting the average frame rate is greater than or equal to the second threshold, and the condition for setting the transcoding parameter is greater than or equal to the third threshold.

[0086] If all target attributes meet the conditions, the task type of the transcoding task is determined to be a first real-time task.

[0087] If any target attribute does not meet the conditions, the task type of the transcoding task is determined to be a second real-time task.

[0088] The first real-time task occupies more resources of the transcoding device than the second real-time task. Therefore, the first real-time task is also called a large real-time task, and the second real-time task is also called a small real-time task.

[0089] Step 105: Select a transcoding device suitable for processing the task type in the load view or the quality view.

[0090] In this embodiment, the corresponding load view or quality view can be traversed according to the dimension, and a transcoding device suitable for processing the task type can be selected from the load view or the quality view according to the load data or quality data of the transcoding device, and transcoding devices that are prone to causing accumulation of transcoding operations can be filtered out. This can reduce resource fragmentation and improve resource utilization while ensuring transcoding quality.

[0091] For the load view, the order of transcoding devices can be set according to the load data in the load view, which shows the abundance of the transcoding devices under the resource of load data, so as to select the transcoding devices suitable for processing the task type in order. Generally, the transcoding devices with relatively abundant load data resources (reflected in the first n or last m positions in the load view) are selected for the transcoding tasks under this task type.

[0092] For the quality view, the order of transcoding devices can be set according to the quality data in the quality view, showing the quality of the transcoding devices under the resource of quality data, so as to select the transcoding devices suitable for processing the task type in order. Generally, the transcoding devices with relatively high quality data as a resource (reflected in the first n or last m positions in the quality view) are selected for the transcoding tasks under this task type.

[0093] Furthermore, if Figure 3 As shown, transcoding tasks with higher real-time requirements can be divided into a first real-time task (i.e., a large real-time task) and a second real-time task (i.e., a small real-time task). The execution and completion of the first real-time task (i.e., a large real-time task) causes a large fluctuation in resource occupancy, while the execution and completion of the second real-time task (i.e., a small real-time task) causes a small fluctuation in resource occupancy. In order to avoid the mutual influence of the first real-time task (i.e., a large real-time task) and the second real-time task (i.e., a small real-time task) and to ensure the normal execution of the first real-time task (i.e., a large real-time task) and the second real-time task (i.e., a small real-time task), the transcoding device for processing the first real-time task (i.e., a large real-time task) and the transcoding device for processing the second real-time task (i.e., a small real-time task) can be independently allocated, that is, the transcoding device suitable for processing the first real-time task is different from the transcoding device suitable for processing the second real-time task.

[0094] Then, if the task type is a first real-time task, a transcoding device suitable for processing the first real-time task is selected according to the order in the load view or the quality view.

[0095] If the task type is a second real-time task, a transcoding device suitable for processing the second real-time task is selected according to the order in the load view or the quality view.

[0096] In addition, corresponding low-load conditions may be set in advance for different dimensions, where the low-load condition indicates that resources (load data or quality data) are scarce.

[0097] If the load data or quality data of the transcoding device meets the low-load condition under a certain dimension, it is possible to prohibit the allocation of real-time tasks to the transcoding device under this dimension, and allow the allocation of offline tasks to the transcoding device under this dimension. Offline tasks have lower real-time requirements and can be executed after completing real-time tasks, thus realizing the organization of fragmented resources and effectively utilizing idle resources.

[0098] Step 106: Send the transcoding task to the transcoding device for processing.

[0099] like Figure 2As shown, CsMgr assigns the transcoding task to the transcoding device, and the transcoding device stores the transcoding task in a queue generated for the process or thread used to perform the transcoding operation. The process or thread used to perform the transcoding operation reads the transcoding task from the queue and performs the transcoding operation on the corresponding video data.

[0100] After the transcoding operation is completed, the transcoding device can transmit the transcoded video data to the service end so that the transcoded video data can be used in the corresponding service.

[0101] In this embodiment, the load data and quality data of the transcoding device when performing transcoding operations on video data are collected in real time, the load data and quality data related to multiple dimensions are extracted from the transcoding device, and are recorded in the load view and quality view under multiple dimensions respectively, and a transcoding task is received. The transcoding task is used to perform transcoding operations on video data, and the task type of the transcoding task is divided under the dimension. A transcoding device suitable for processing the task type is selected in the load view or the quality view, and the transcoding task is sent to the transcoding device for processing. This embodiment dynamically schedules transcoding tasks based on load and quality, so that the load of the transcoding device and the quality of transcoding can be taken into account, and a dynamic balance is achieved between the load of the transcoding device and the quality of transcoding, so that the quality requirements of video data transcoding are met in business with minimal computing cost, the utilization rate of overall transcoding resources is improved, and development time is saved.

[0102] Example 2

[0103] Figure 4 This is a flowchart of a video transcoding scheduling method provided in Embodiment 2 of the present invention. This embodiment is based on the previous embodiment and further adds operations for updating the load view and the quality view. The method specifically includes the following steps:

[0104] Step 401: Collect in real time the load data and the quality data of the transcoding operation when the transcoding device performs the transcoding operation on the video data.

[0105] Step 402: Extract load data and quality data related to multiple dimensions from the transcoding device, and record them in load views and quality views under the multiple dimensions.

[0106] Step 403: Receive a transcoding task.

[0107] The transcoding task is used to perform transcoding operations on video data.

[0108] Step 404: Divide the task types of the transcoding tasks into dimensions.

[0109] Step 405: Select a transcoding device suitable for processing the task type in the load view or the quality view.

[0110] Step 406: Send the transcoding task to the transcoding device for processing.

[0111] Step 407: If the load data of the transcoding device meets the first unavailable condition under a certain dimension, the transcoding device is deleted from the load view under the dimension.

[0112] In this embodiment, a first unavailable condition may be set in advance for the load data in different dimensions, such as the load data being less than a certain threshold.

[0113] If the load data of the transcoding device meets the first unavailability condition under a certain dimension, it means that the transcoding device is unavailable under this dimension. At this time, the transcoding device is deleted from the load view under this dimension. Furthermore, the transcoding device can be added to the view to be restored, waiting for the transcoding device to execute the transcoding task related to the load resources under this dimension, and waiting for the load resources of the transcoding device under this dimension to become available.

[0114] This embodiment can maintain the accuracy of the load view by deleting unavailable transcoding devices in the load view, thereby ensuring normal execution of the transcoding task.

[0115] Step 408: If the quality data of the transcoding device meets the second unavailable condition under a certain dimension, delete the transcoding device from the quality view under the dimension.

[0116] In this embodiment, a second unavailable condition may be set in advance for the quality data in different dimensions, such as the quality data being less than a certain threshold.

[0117] If the quality data of the transcoding device meets the second unavailability condition under a certain dimension, it means that the transcoding device is unavailable under the dimension. At this time, the transcoding device is deleted from a view under the dimension. Furthermore, the transcoding device can be added to the view to be restored, waiting for the transcoding device to execute the transcoding task related to the quality resources under the dimension, and waiting for the quality resources of the transcoding device under the dimension to be available.

[0118] This embodiment can maintain the accuracy of the quality view by deleting unavailable transcoding devices in the quality view, thereby ensuring normal execution of the transcoding task.

[0119] Step 409: If the number of transcoding devices in the load view under a certain dimension is less than a first threshold, add a transcoding device to the load view under the dimension.

[0120] In this embodiment, the number of transcoding devices in the load view may be counted in different dimensions, and the number of transcoding devices in the load view counted in different dimensions may be compared with the first threshold.

[0121] If the number of transcoding devices in the load view under a certain dimension is less than the first threshold, it means that the number of transcoding devices is small. At this time, you can perform a capacity expansion operation on the load view under this dimension and add a new transcoding device to the load view under this dimension.

[0122] Furthermore, the transcoding devices with available load resources in the dimension in the view to be restored can be added to the load view, and new transcoding devices can also be added to the load view, which is limited in this embodiment.

[0123] Step 410: If the number of transcoding devices in the load view under a certain dimension is greater than a second threshold, reduce the number of transcoding devices in the load view under the dimension.

[0124] In this embodiment, the number of transcoding devices in the load view may be counted in different dimensions, and the number of transcoding devices in the load view counted in different dimensions may be compared with the second threshold.

[0125] Generally, the second threshold is greater than the first threshold.

[0126] If the number of transcoding devices in the load view under a certain dimension is greater than the second threshold, it means that the number of transcoding devices is large. At this time, a scaling operation can be performed on the load view under this dimension, and the transcoding devices can be deleted from the load view under this dimension.

[0127] This embodiment can improve the utilization rate of load resources while ensuring the normal execution of transcoding tasks by dynamically expanding and shrinking the load view.

[0128] Step 411: If the number of transcoding devices in the quality view under a certain dimension is less than a third threshold, add a transcoding device to the quality view under the dimension.

[0129] In this embodiment, the number of transcoding devices in the quality view may be counted in different dimensions, and the number of transcoding devices in the quality view counted in different dimensions may be compared with a third threshold.

[0130] If the number of transcoding devices in the quality view under a certain dimension is less than the third threshold, it means that the number of transcoding devices is small. At this time, the quality view under this dimension can be expanded to add new transcoding devices to the quality view under this dimension.

[0131] Furthermore, the transcoding devices with available quality resources under the dimension in the view to be restored may be added to the quality view, or new transcoding devices may be added to the quality view, which is restricted in this embodiment.

[0132] Step 412: If the number of transcoding devices in the quality view under a certain dimension is greater than a fourth threshold, reduce the number of transcoding devices in the quality view under the dimension.

[0133] In this embodiment, the number of transcoding devices in the quality view may be counted in different dimensions, and the number of transcoding devices in the quality view counted in different dimensions may be compared with a fourth threshold.

[0134] Generally, the fourth threshold is greater than the third threshold.

[0135] If the number of transcoding devices in the quality view under a certain dimension is greater than the fourth threshold, it means that the number of transcoding devices is large. At this time, a scaling operation can be performed on the load view under this dimension, and the transcoding devices can be deleted from the quality view under this dimension.

[0136] This embodiment can improve the utilization rate of quality resources while ensuring the normal execution of transcoding tasks by dynamically expanding and reducing the quality view.

[0137] Example 3

[0138] Figure 5 This is a flowchart of a video transcoding scheduling method provided in Embodiment 3 of the present invention. This embodiment is based on the previous embodiment and further adds a resource migration operation. The method specifically includes the following steps:

[0139] Step 501: Collect in real time the load data and the quality data of the transcoding operation when the transcoding device performs the transcoding operation on the video data.

[0140] Step 502: Extract load data and quality data related to multiple dimensions from the transcoding device, and record them in load views and quality views under the multiple dimensions.

[0141] Step 503: Receive a transcoding task.

[0142] The transcoding task is used to perform transcoding operations on video data.

[0143] Step 504: Divide the task types of the transcoding tasks into dimensions.

[0144] Step 505: Select a transcoding device suitable for processing the task type in the load view or the quality view.

[0145] Step 506: Send the transcoding task to the transcoding device for processing.

[0146] Step 507: If the load data of the transcoding device meets the overload condition under a certain dimension, the offline task in the transcoding device is suspended.

[0147] In this embodiment, overload conditions may be set in advance for load data in different dimensions, such as the load data being greater than a certain threshold.

[0148] CsMgr monitors the load data of the transcoding device in real time. If the load data of the transcoding device meets the overload condition under a certain dimension, it means that the load of the transcoding device under this dimension is high. At this time, considering that the transcoding task with the task type of offline task under this dimension is not necessarily executed, one or more offline tasks under this dimension can be selected in the transcoding device and the offline task can be suspended. Specifically, the process or thread used to perform the transcoding operation is notified to suspend the offline task, thereby reducing the occupation of resources under this dimension by offline tasks, and giving priority to providing more resources under this dimension to the transcoding task with the task type of real-time task, thereby reducing the load.

[0149] Among them, after the offline task is created, it will switch from the sleep state to the ready state. The ready offline task can deprive the CPU of its right to use by calling a function (such as OSTaskSuspend), causing it to temporarily suspend its operation and switch to the blocked state. This process is called suspension.

[0150] Step 508: If the load data of the transcoding device continues to meet the overload condition under the dimension, the real-time tasks in the transcoding device are migrated out of the transcoding device according to the priority.

[0151] After suspending the offline task, CsMgr continues to monitor the load data of the transcoding device in real time. If the load data of the transcoding device continues to meet the overload conditions under this dimension, it means that the load of the transcoding device under this dimension continues to be high. At this time, the priority of the real-time tasks under this dimension in the transcoding device can be set according to business needs.

[0152] For example, for live broadcast services, the priority of the transcoding tasks of the video data of the anchor can be set according to the anchor's preference. The priority of the transcoding tasks of the big anchor is higher than that of the small anchor.

[0153] In the transcoding device, one or more transcoding tasks with the task type of real-time task under this dimension are selected according to priority. Generally, one or more real-time tasks with the lowest priority are selected, so as to migrate these real-time tasks out of the current transcoding device, thereby reasonably optimizing the load of the transcoding tasks and ensuring the overall quality of the business.

[0154] Furthermore, the process may return to step 505 and select a transcoding device suitable for processing the real-time task in the load view under the dimension, thereby sending the real-time task to the transcoding device for processing.

[0155] Step 509: If the quality data of the transcoding device meets the low-quality condition under a certain dimension, the offline task in the transcoding device is suspended.

[0156] In this embodiment, low-quality conditions may be set in advance for the quality data in different dimensions, such as load data being below a certain threshold.

[0157] CsMgr monitors the quality data of the transcoding device in real time. If the quality data of the transcoding device meets the low-quality condition under a certain dimension, it means that the quality of the transcoding device under this dimension is low. At this time, considering that the transcoding task with the task type of offline task under this dimension is not necessarily executed, one or more offline tasks under this dimension can be selected in the transcoding device and the offline task can be suspended. Specifically, the process or thread used to perform the transcoding operation is notified to suspend the offline task, thereby reducing the occupation of resources under this dimension by offline tasks, and giving priority to more resources under this dimension to the transcoding task with the task type of real-time task, thereby improving the quality.

[0158] Step 510: If the quality data of the transcoding device still meets the low-quality condition under the dimension, the real-time tasks in the transcoding device are migrated out of the transcoding device according to the priority.

[0159] After suspending the offline task, CsMgr continues to monitor the quality data of the transcoding device in real time. If the quality data of the transcoding device continues to meet the low-quality conditions under this dimension, it means that the quality of the transcoding device under this dimension continues to be low. At this time, the priority of the real-time tasks under this dimension in the transcoding device can be set according to business needs.

[0160] In the transcoding device, one or more transcoding tasks with the task type of real-time task under this dimension are selected according to priority. Generally, one or more real-time tasks with the lowest priority are selected, so as to migrate these real-time tasks out of the current transcoding device, thereby reasonably optimizing the quality of transcoding tasks and ensuring the overall quality of the business.

[0161] It should be noted that for the sake of simplicity, the method embodiments are described as a series of actions. However, those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0162] Example 4

[0163] Figure 6 This is a structural block diagram of a video transcoding scheduling device provided in the fourth embodiment of the present invention, which may specifically include the following modules:

[0164] Running a data acquisition module 601 for respectively acquiring in real time load data of a transcoding device when performing a transcoding operation on video data and quality data of the transcoding operation;

[0165] A view recording module 602 is configured to extract the load data and the quality data related to multiple dimensions for the transcoding device, and record them in load views and quality views under the multiple dimensions, respectively;

[0166] A transcoding task receiving module 603 is configured to receive a transcoding task, wherein the transcoding task is configured to perform a transcoding operation on the video data;

[0167] A task type classification module 604 is configured to classify the transcoding task into task types based on the dimension;

[0168] A transcoding device selection module 605 is configured to select the transcoding device suitable for processing the task type in the load view or the quality view;

[0169] The transcoding task distribution module 606 is configured to send the transcoding task to the transcoding device for processing.

[0170] In one embodiment of the present invention, the operation data acquisition module 601 includes:

[0171] a first quality data receiving module, configured to receive quality data of a transcoding operation collected by a service end using video data;

[0172] a second quality data receiving module, configured to receive quality data of the transcoding operation collected by the transcoding device;

[0173] A quality data merging module, configured to merge the quality data collected by the service end with the quality data collected by the transcoding device;

[0174] The quality data screening module is configured to ignore the quality data collected by the transcoding device and retain the quality data collected by the service end if the quality data collected by the service end overlaps with the quality data collected by the transcoding device.

[0175] In one embodiment of the present invention, the task type classification module 604 includes:

[0176] an attribute reading module, configured to read, in the transcoding task, an attribute set for the transcoding operation of the video data if the transcoding task is a real-time task;

[0177] A task model query module, used to query the task model set under the dimension, wherein the task model is used to describe the classification requirements of the task type;

[0178] The task model matching module is used to match the attribute with the task model to classify the task type of the transcoding task.

[0179] In one embodiment of the present invention, the task model matching module includes:

[0180] a target attribute query module, configured to query one or more attributes related to the dimension as target attributes;

[0181] A condition query module, configured to query the condition set for each target attribute in the task model;

[0182] A first real-time task determining module, configured to determine that the task type of the transcoding task is a first real-time task if all the target attributes meet the conditions;

[0183] The second real-time task determination module is used to determine that the task type of the transcoding task is a second real-time task if any of the target attributes does not meet the conditions, and the first real-time task occupies more resources of the transcoding device than the second real-time task does.

[0184] In one embodiment of the present invention, the transcoding device selection module 605 includes:

[0185] an order setting module, configured to set an order for the transcoding devices in the load view or the quality view according to the load data or the quality data;

[0186] A sequence selection module is used to select the transcoding device suitable for processing the task type according to the sequence.

[0187] In one embodiment of the present invention, the sequence selection module includes:

[0188] a first real-time task selection module, configured to select, if the task type is a first real-time task, the transcoding device suitable for processing the first real-time task in the order;

[0189] a second real-time task selection module, configured to select, if the task type is a second real-time task, the transcoding device suitable for processing the second real-time task in the order described;

[0190] The transcoding device suitable for processing the first real-time task is different from the transcoding device suitable for processing the second real-time task.

[0191] In one embodiment of the present invention, the transcoding device selection module 605 further includes:

[0192] If the load data or the quality data of the transcoding device meets the low-load condition under a certain dimension, allocating real-time tasks to the transcoding device under the dimension is prohibited, and allocating offline tasks to the transcoding device under the dimension is allowed.

[0193] In one embodiment of the present invention, it further comprises:

[0194] a first transcoding device deleting module, configured to delete the transcoding device from the load view under a dimension if the load data of the transcoding device meets a first unavailable condition under the dimension;

[0195] The second transcoding device deleting module is configured to delete the transcoding device from the quality view under a certain dimension if the quality data of the transcoding device meets a second unavailable condition under the dimension.

[0196] In one embodiment of the present invention, it further comprises:

[0197] a first expansion module, configured to add the transcoding device to the load view under a certain dimension if the number of the transcoding devices in the load view under the dimension is less than a first threshold;

[0198] a first scaling-down module, configured to reduce the number of transcoding devices in the load view under a certain dimension if the number of the transcoding devices in the load view under the dimension is greater than a second threshold;

[0199] a second expansion module, configured to add the transcoding device to the quality view under a certain dimension if the number of the transcoding devices in the quality view under the dimension is less than a third threshold;

[0200] The second scaling-down module is configured to reduce the transcoding devices in the quality view under a certain dimension if the number of the transcoding devices in the quality view under the dimension is greater than a fourth threshold.

[0201] In one embodiment of the present invention, it further comprises:

[0202] a first offline task suspending module, configured to suspend the offline task in the transcoding device if the load data of the transcoding device meets an overload condition under one of the dimensions;

[0203] a first real-time task migration module, configured to migrate the real-time tasks in the transcoding device out of the transcoding device according to priority if the load data of the transcoding device continues to meet the overload condition under the dimension;

[0204] a second offline task suspending module, configured to suspend the offline task in the transcoding device if the quality data of the transcoding device meets a low-quality condition under one of the dimensions;

[0205] The second real-time task migration module is configured to migrate the real-time tasks in the transcoding device out of the transcoding device according to priority if the quality data of the transcoding device continues to meet the low-quality condition under the dimension.

[0206] The video transcoding scheduling device provided in the embodiment of the present invention can execute the video transcoding scheduling method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0207] Example 5

[0208] Figure 7 This is a structural diagram of a computer device provided in Example 5 of the present invention. Figure 7 A block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention is shown. Figure 7 The computer device 12 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.

[0209] like Figure 7 As shown, computer device 12 is implemented as a general-purpose computing device. Components of computer device 12 may include, but are not limited to, one or more processors or processing units 16, system memory 28, and a bus 18 that connects various system components (including system memory 28 and processing unit 16).

[0210] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. Examples of these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0211] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.

[0212] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be configured to read and write non-removable, non-volatile magnetic media ( Figure 7 Not shown, often called a "hard drive"). Although Figure 7 Not shown, a magnetic disk drive for reading and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of various embodiments of the present invention.

[0213] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may include an implementation of a network environment. Program modules 42 generally implement the functions and / or methods of the embodiments described herein.

[0214] The computer device 12 can also communicate with one or more external devices 14 (e.g., a keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the computer device 12, and / or any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication can occur via an input / output (I / O) interface 22. Furthermore, the computer device 12 can 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 a network adapter 20. As shown, the network adapter 20 communicates with the other modules of the computer device 12 via a bus 18. It should be understood that, although not shown, other hardware and / or software modules can be used in conjunction with the computer device 12, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0215] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the scheduling method for video transcoding provided in an embodiment of the present invention.

[0216] Example 6

[0217] Embodiment 6 of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned video transcoding scheduling method are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0218] Among them, computer-readable storage media can include, for example, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or components, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or device.

[0219] Note that the above are only preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments and may include many other equivalent embodiments without departing from the concept of the present invention. The scope of the present invention is determined by the scope of the appended claims.

Claims

1. A video transcoding scheduling method, characterized in that: include: respectively collecting, in real time, load data of a transcoding device when performing a transcoding operation on video data and quality data of the transcoding operation; wherein the quality data is reported simultaneously by a service end using the video data and a process or thread in the transcoding device used to perform the transcoding operation; extracting the load data and the quality data related to multiple dimensions for the transcoding device respectively, and recording them in the load view and the quality view under the multiple dimensions respectively; receiving a transcoding task, wherein the transcoding task is used to perform a transcoding operation on video data; Dividing the task types of the transcoding tasks under the dimensions; Selecting the transcoding device suitable for processing the task type in the load view or the quality view includes: traversing the corresponding load view or quality view according to the dimension, selecting a transcoding device suitable for processing the task type from the load view or the quality view according to the load data or quality data of the transcoding device, and filtering out a transcoding device that causes a backlog of transcoding operations; The transcoding task is sent to the transcoding device for processing.

2. The method according to claim 1, characterized in that The respectively real-time acquisition of load data when the transcoding device performs a transcoding operation on the video data and quality data of the transcoding operation includes: receiving quality data of transcoding operations collected by a service end using the video data; receiving quality data of the transcoding operation collected by the transcoding device; Merging the quality data collected by the service end with the quality data collected by the transcoding device; If the quality data collected by the service end overlaps with the quality data collected by the transcoding device, the quality data collected by the transcoding device is ignored and the quality data collected by the service end is retained.

3. The method according to claim 1, characterized in that The task types of dividing the transcoding tasks under the dimensions include: If the transcoding task is a real-time task, reading the attributes set for the transcoding operation of the video data in the transcoding task; Querying a task model set under the dimension, wherein the task model is used to describe classification requirements of the task type; The attributes are matched with the task model to classify the task type of the transcoding task.

4. The method according to claim 3, characterized in that The matching of the attributes with the task model to classify the task type of the transcoding task includes: querying one or more attributes related to the dimension as target attributes; querying the task model for a condition set for each of the target attributes; If all the target attributes meet the conditions, determining that the task type of the transcoding task is a first real-time task; If any of the target attributes does not meet the conditions, the task type of the transcoding task is determined to be a second real-time task, and the first real-time task occupies more resources of the transcoding device than the second real-time task.

5. The method according to claim 1, characterized in that The selecting the transcoding device suitable for processing the task type in the load view or the quality view includes: arranging an order for the transcoding devices in the load view or the quality view according to the load data or the quality data; The transcoding device suitable for processing the task type is selected in the order.

6. The method according to claim 5, characterized in that The selecting, in the order, the transcoding device suitable for processing the task type comprises: If the task type is a first real-time task, selecting the transcoding device suitable for processing the first real-time task in the order; If the task type is a second real-time task, selecting the transcoding device suitable for processing the second real-time task in the order; The transcoding device suitable for processing the first real-time task is different from the transcoding device suitable for processing the second real-time task.

7. The method according to claim 5, characterized in that The selecting the transcoding device suitable for processing the task type in the load view or the quality view further includes: If the load data or the quality data of the transcoding device meets the low-load condition under a certain dimension, allocating real-time tasks to the transcoding device under the dimension is prohibited, and allocating offline tasks to the transcoding device under the dimension is allowed.

8. The method according to any one of claims 1 to 7, characterized in that Also includes: If the load data of the transcoding device meets the first unavailable condition under a certain dimension, deleting the transcoding device from the load view under the dimension; If the quality data of the transcoding device meets the second unavailable condition under a certain dimension, the transcoding device is deleted from the quality view under the dimension.

9. The method according to any one of claims 1 to 7, characterized in that Also includes: If the number of the transcoding devices in the load view under a certain dimension is less than a first threshold, adding the transcoding device to the load view under the dimension; If the number of the transcoding devices in the load view under a certain dimension is greater than a second threshold, reducing the transcoding devices in the load view under the dimension; If the number of the transcoding devices in the quality view under a certain dimension is less than a third threshold, adding the transcoding device to the quality view under the dimension; If the number of the transcoding devices in the quality view under a certain dimension is greater than a fourth threshold, the transcoding devices in the quality view under the dimension are reduced.

10. The method according to any one of claims 1 to 7, characterized in that Also includes: If the load data of the transcoding device meets the overload condition under one of the dimensions, suspending the offline task in the transcoding device; If the load data of the transcoding device continues to meet the overload condition under the dimension, migrating the real-time tasks in the transcoding device out of the transcoding device according to the priority; If the quality data of the transcoding device meets the low-quality condition under one of the dimensions, suspending the offline task in the transcoding device; If the quality data of the transcoding device still meets the low-quality condition under the dimension, the real-time tasks in the transcoding device are migrated out of the transcoding device according to the priority.

11. A video transcoding scheduling device, characterized in that: include: Running a data collection module for respectively collecting, in real time, load data of the transcoding device when performing a transcoding operation on video data and quality data of the transcoding operation; wherein the quality data is reported simultaneously by a service end using the video data and a process or thread in the transcoding device used to perform the transcoding operation; a view recording module, configured to extract the load data and the quality data related to multiple dimensions for the transcoding device, and record them in load views and quality views under the multiple dimensions, respectively; A transcoding task receiving module, configured to receive a transcoding task, wherein the transcoding task is configured to perform a transcoding operation on video data; A task type division module, configured to divide the task type of the transcoding task under the dimension; A transcoding device selection module, configured to select the transcoding device suitable for processing the task type in the load view or the quality view; The transcoding device selection module is specifically configured to traverse the corresponding load view or quality view according to the dimension, select a transcoding device suitable for processing the task type from the load view or the quality view according to the load data or quality data of the transcoding device, and filter out transcoding devices that cause a backlog of transcoding operations; The transcoding task distribution module is used to send the transcoding task to the transcoding device for processing.

12. A computer device, characterized in that: The computer device comprises: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the video transcoding scheduling method according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the video transcoding scheduling method according to any one of claims 1 to 10 is implemented.

Citation Information

Patent Citations

  • Transcoding task distribution method and device

    CN105872595A

  • Transcoding task distribution method, scheduling device and transcoding device

    CN108965884A

  • Video transcoding system, video transcoding method, electronic equipment and storage medium

    CN112702605A