Transcoding task processing method and apparatus, electronic device, and computer storage medium
By identifying the duration of task backlog and adjusting the transcoding strategy, the problem of low resource utilization during video transcoding was solved, the transcoding speed and quality were improved, and resource utilization was optimized.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
- Filing Date
- 2022-11-30
- Publication Date
- 2026-07-14
AI Technical Summary
In existing technologies, there is a problem of low resource utilization during video transcoding, especially during peak periods when server resources are wasted, resulting in low transcoding task processing efficiency.
By identifying the backlog of tasks to be transcoded, the target transcoding strategy is determined based on the preset degradation transcoding strategy and waiting time threshold. The tasks to be transcoded and the target transcoding strategy are then sent to the transcoding cluster to adjust transcoding parameters, improve transcoding speed, and optimize resource utilization.
Without increasing resources, the transcoding speed was improved while maintaining the quality of transcoding output, thus maximizing resource utilization.
Smart Images

Figure CN115883845B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to video transcoding technology, and more particularly to a transcoding task processing method, apparatus, electronic device, computer-readable storage medium, and computer program product. Background Technology
[0002] Video transcoding refers to converting a compressed video stream into another video stream to adapt to different network bandwidths, terminal processing capabilities, and user needs. In the short video field, transcoding is triggered when a user uploads a short video (i.e., upload transcoding). Only transcoded videos can be distributed. Therefore, the time-consuming and stable requirements for transcoding tasks are relatively high.
[0003] Transcoding is essentially a process of first decoding and then encoding. The encoding speed is closely related to transcoding parameters (such as the bitrate and resolution of the output video). Generally, transcoding speed, output video quality, and output video bitrate form a triangular balance. For example, assuming the image quality remains unchanged, the longer the computation time for encoding, the smaller the compressed video will be; however, encoding also requires more machine resources.
[0004] Furthermore, upload transcoding exhibits a significant peak-and-trough effect, with sudden spikes occurring during evenings or holidays. Typically, to ensure the availability of upload transcoding services, related technologies expand server capacity to reserve substantial redundant resources. However, these resources remain idle most of the time, resulting in low resource utilization. Summary of the Invention
[0005] This disclosure provides a transcoding task processing method, apparatus, electronic device, computer-readable storage medium, and computer program product to at least solve the problem of low resource utilization caused by expanding server capacity to cope with peak loads in related technologies. The technical solution of this disclosure is as follows:
[0006] According to a first aspect of the present disclosure, a transcoding task processing method is provided, comprising:
[0007] Obtain the tasks to be transcoded and identify the task backlog duration of the tasks to be transcoded.
[0008] When the task backlog duration meets the preset waiting time threshold corresponding to the downgrade transcoding strategy, a target transcoding strategy matching the task to be transcoded is determined based on the task backlog duration and the waiting time threshold.
[0009] The transcoding task to be transcoded and the target transcoding strategy are sent to the transcoding cluster to instruct the transcoding cluster to use the target transcoding strategy to transcode the task to be transcoded.
[0010] In one embodiment, there are multiple preset downgrade transcoding strategies, each of which has a corresponding waiting time threshold and downgrade transcoding parameters, including at least one of transcoding speed, transcoding output bitrate, and output image quality.
[0011] In one embodiment, the waiting time threshold includes a first waiting time threshold and a second waiting time threshold corresponding to the downgraded transcoding strategy, wherein the second waiting time threshold is greater than the first waiting time threshold; when the task backlog time meets the preset waiting time threshold corresponding to the downgraded transcoding strategy, determining the target transcoding strategy matching the task to be transcoded based on the task backlog time and the waiting time threshold includes: when the task backlog time is greater than or equal to the first waiting time threshold and less than the second waiting time threshold, determining the downgraded task range targeted by the downgraded transcoding strategy based on the task backlog time, the first waiting time threshold, and the second waiting time threshold; when it is determined that the task to be transcoded belongs to the task in the downgraded task range, determining the downgraded transcoding strategy as the target transcoding strategy matching the task to be transcoded.
[0012] In one embodiment, determining the degraded task range targeted by the degraded transcoding strategy based on the task backlog duration, the first waiting time threshold, and the second waiting time threshold includes: obtaining a first difference between the task backlog duration and the first waiting time threshold; obtaining a second difference between the second waiting time threshold and the first waiting time threshold; obtaining a percentage of the first difference to the second difference; and determining the percentage range less than or equal to the first difference as the degraded task range targeted by the degraded transcoding strategy.
[0013] In one embodiment, the task to be transcoded has a corresponding task identifier; the method further includes: performing a modulo operation on the task identifier of the task to be transcoded and a first set parameter to obtain a modulo operation result, wherein the first set parameter is used to perform a modulo operation on the task identifier of the task to be transcoded to determine a calculation factor for a target position identifier in the task identifier; obtaining a quotient between the modulo operation result and a second set parameter, wherein the second set parameter is used to make the modulo operation result and the downgraded task interval have a unified unit of measurement; when the quotient is within the downgraded task interval, determining that the task to be transcoded belongs to the task within the downgraded task interval.
[0014] In one embodiment, the method further includes: when the task to be transcoded does not belong to the task range of the downgraded task, determining the downgraded transcoding strategy relative to the transcoding strategy before downgrading; and determining the transcoding strategy before downgrading as the target transcoding strategy that matches the task to be transcoded.
[0015] In one embodiment, after determining the downgrade transcoding strategy as a target transcoding strategy matching the transcoding task, the method further includes: generating a transcoding recovery task for the transcoding task based on the transcoding task and the target transcoding strategy matching the transcoding task; and sending the transcoding recovery task for the transcoding task to the transcoding cluster when the transcoding cluster is detected to be in an idle state, so as to instruct the transcoding cluster to perform transcoding recovery processing on the transcoding task.
[0016] In one embodiment, the method further includes: when the task backlog duration is greater than or equal to the second waiting duration threshold, determining the downgrade transcoding strategy as a target transcoding strategy that matches the task to be transcoded.
[0017] According to a second aspect of the present disclosure, a transcoding task processing apparatus is provided, comprising:
[0018] The task acquisition module is configured to acquire tasks to be transcoded and identify the task backlog duration of the tasks to be transcoded.
[0019] The target transcoding strategy determination module is configured to determine a target transcoding strategy that matches the task to be transcoded when the task backlog duration meets the preset waiting time threshold corresponding to the downgrade transcoding strategy.
[0020] The task sending module is configured to send the task to be transcoded and the target transcoding strategy to the transcoding cluster, so as to instruct the transcoding cluster to use the target transcoding strategy to transcode the task to be transcoded.
[0021] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the transcoding task processing method as described in the first aspect above.
[0022] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, which, when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to perform the transcoding task processing method as described in the first aspect above.
[0023] According to a fifth aspect of the present disclosure, a computer program product is provided, the computer program product including instructions that can be executed by a processor of an electronic device to perform the transcoding task processing method described in the first aspect above.
[0024] The technical solution provided by the embodiments of this disclosure brings at least the following beneficial effects: by acquiring the tasks to be transcoded, identifying the task backlog duration of the tasks to be transcoded, and when the task backlog duration meets the waiting time threshold corresponding to a preset degradation transcoding strategy, determining the target transcoding strategy matching the tasks to be transcoded based on the task backlog duration and the waiting time threshold, and sending the tasks to be transcoded and the matching target transcoding strategy to the transcoding cluster. This enables the transcoding speed to be improved without increasing resources, while also ensuring the quality of the transcoded output, thereby maximizing resource utilization.
[0025] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0026] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.
[0027] Figure 1 This is an application environment diagram illustrating a transcoding task processing method according to an exemplary embodiment.
[0028] Figure 2 This is a flowchart illustrating a transcoding task processing method according to an exemplary embodiment.
[0029] Figure 3A This is a schematic diagram illustrating the principle of a degradation mechanism according to an exemplary embodiment.
[0030] Figure 3B This is a flowchart illustrating the steps of determining a target transcoding strategy according to an exemplary embodiment.
[0031] Figure 4 This is a flowchart illustrating the steps of determining a degraded task range according to an exemplary embodiment.
[0032] Figure 5 This is a flowchart illustrating the steps for determining whether a task to be transcoded belongs to a degraded task range, according to an exemplary embodiment.
[0033] Figure 6 This is a flowchart illustrating a transcoding recovery step according to an exemplary embodiment.
[0034] Figure 7AThis is a time coordinate graph showing the various transcoding strategies according to an exemplary embodiment.
[0035] Figure 7B This is a flowchart illustrating a transcoding task processing method according to another exemplary embodiment.
[0036] Figure 8 This is a block diagram illustrating a transcoding task processing apparatus according to an exemplary embodiment.
[0037] Figure 9 This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation
[0038] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0039] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0040] It should also be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.
[0041] The transcoding task processing method provided in this disclosure can be applied to, for example... Figure 1 In the application environment shown, the transcoding scheduling server 102 interacts with the transcoding cluster 104 via a network. Specifically, the transcoding scheduling server 102 can be implemented using a standalone server or a server cluster consisting of multiple servers. The transcoding cluster 104 can also be a server cluster consisting of multiple servers. When a user uploads a video, a corresponding transcoding task is typically generated based on the uploaded video and stored in a transcoding request queue. The transcoding scheduling server 102 can then retrieve the transcoding tasks from the transcoding request queue and assign them to the transcoding cluster 104 for transcoding processing.
[0042] When the transcoding task volume of transcoding cluster 104 reaches its peak (i.e., transcoding cluster 104 is fully loaded and the thread pool utilization reaches 100%), it can no longer accept transcoding tasks (i.e., backpressure rate limiting mechanism). At this time, there will be a backlog of tasks in the transcoding request queue. In this embodiment, to address task backlog, the transcoding scheduling server 102, when consuming transcoding requests from the queue of tasks to be transcoded, can first identify the backlog duration of the tasks to be transcoded. If the backlog duration meets the waiting time threshold corresponding to a preset degradation transcoding strategy, it determines a target transcoding strategy matching the tasks to be transcoded (i.e., a transcoding degradation mechanism that adapts the degradation strategy based on the backlog) based on the backlog duration and the waiting time threshold. It then sends the tasks to be transcoded and the matching target transcoding strategy to the transcoding cluster 104, instructing the transcoding cluster 104 to use the target transcoding strategy to transcode the tasks. This saves machine resources consumed by transcoding, increases transcoding speed, and enables the processing of more transcoding tasks without scaling up, thus maximizing resource utilization to cope with peak transcoding task volumes.
[0043] Figure 2 This is a flowchart illustrating a transcoding task processing method according to an exemplary embodiment, such as... Figure 2 As shown, this method is applied to Figure 1 Taking the transcoding scheduling server 102 as an example, it can specifically include the following steps.
[0044] In step S210, the transcoding task is obtained and the task backlog duration is identified.
[0045] Here, "tasks to be transcoded" refers to tasks generated based on user-uploaded videos that are yet to be transcoded. "Task backlog duration" refers to the time interval between the time a task is generated and the time it is consumed. In this embodiment, when the transcoding scheduling server consumes tasks in the transcoding request queue, it first obtains the tasks to be transcoded and identifies their backlog duration.
[0046] In step S220, when the task backlog duration meets the waiting time threshold corresponding to the preset downgrade transcoding strategy, the target transcoding strategy matching the task to be transcoded is determined based on the task backlog duration and the waiting time threshold.
[0047] The target transcoding strategy is the final strategy adopted for transcoding the task to be transcoded. Specifically, the transcoding strategy has corresponding transcoding parameters, which include, but are not limited to, at least one of transcoding speed, transcoding output bitrate, and output image quality. These transcoding parameters can be implemented through externally adjustable parameters during the transcoding process, such as video encoder tool switches, target bitrate, target quality, target speed, and preset scene parameters of the encoder. By adjusting these parameters, different transcoding speeds, transcoding output bitrates, and output image qualities can be achieved.
[0048] Furthermore, there is a triangular balance between transcoding speed, transcoding output bitrate, and transcoding output image quality. For example, to maintain the same transcoding output image quality, the longer the computation time spent on encoding (i.e., the slower the transcoding speed), the smaller the video compression (i.e., the higher the bitrate). However, the encoding also requires more machine resources. Therefore, a relatively universal transcoding parameter is usually determined based on the actual application scenario and corresponds to a general transcoding strategy.
[0049] The downgraded transcoding strategy is determined based on the aforementioned general transcoding strategy, specifically to alleviate the processing pressure on the transcoding cluster. In this embodiment, the downgraded transcoding strategy primarily focuses on increasing transcoding speed, for example, by 2, 3, or 4 times the speed of the general transcoding strategy. However, since transcoding speed, output bitrate, and output image quality form a triangular balance, increasing transcoding speed will simultaneously lead to a decrease in output image quality and bitrate. Therefore, the downgraded transcoding strategy also has corresponding downgraded transcoding parameters; that is, different transcoding strategies have different transcoding parameters.
[0050] The waiting time threshold can be a pre-set trigger condition for activating the corresponding degraded transcoding strategy. Since the degraded transcoding strategy in this embodiment is determined based on alleviating the processing pressure on the transcoding cluster, when the transcoding cluster is in normal working condition (when the task backlog is usually short, i.e., less than the waiting time threshold), it can use a general transcoding strategy for transcoding. However, when the transcoding cluster reaches full load (when the task backlog is relatively long, i.e., greater than or equal to the waiting time threshold), as the number of tasks increases, the corresponding task backlog will also increase. Therefore, based on the waiting time threshold reached by the task backlog, a corresponding degraded transcoding strategy can be used to process the tasks to improve transcoding speed. It is understood that multiple degraded transcoding strategies of different levels can be pre-set, and a corresponding waiting time threshold and degraded transcoding parameters can be set for each degraded transcoding strategy. Different waiting time thresholds can trigger the activation of different degraded transcoding strategies.
[0051] In this embodiment, the transcoding scheduling server can determine the target transcoding strategy matching the task to be transcoded by judging the relationship between the task backlog duration and the waiting time threshold corresponding to the preset degraded transcoding strategy. Specifically, when the task backlog duration is less than the waiting time threshold, it means that the transcoding cluster can handle the current task volume. Therefore, it is not necessary to enable the degraded transcoding strategy for the time being, and thus the target transcoding strategy for the task to be transcoded can be determined to be the general transcoding strategy.
[0052] When the backlog of tasks to be transcoded is greater than or equal to the waiting time threshold corresponding to the preset downgrade transcoding strategy, it means that the backlog of tasks meets the waiting time threshold corresponding to the preset downgrade transcoding strategy. At this time, the transcoding cluster may have reached full load and accumulated a certain number of tasks to be transcoded. Therefore, the transcoding scheduling server can further determine the target transcoding strategy that matches the tasks to be transcoded based on the backlog of tasks and the waiting time threshold.
[0053] Since queues follow a first-in, first-out (FIFO) principle, a longer backlog of tasks awaiting transcoding indicates a larger backlog of tasks in the transcoding request queue. Based on this, the transcoding scheduling server can determine the degree of task backlog in the queue based on the backlog duration and waiting time thresholds. Then, it can determine whether to implement a degraded transcoding strategy (i.e., gradual implementation) for the current tasks awaiting transcoding. For example, when the backlog is low, a degraded transcoding strategy can be implemented only for some tasks, while when the backlog is high, it can be implemented for all tasks. This allows for both increased transcoding speed and reduced processing pressure on the transcoding cluster, while maintaining the quality of the transcoded output.
[0054] In step S230, the transcoding task and target transcoding strategy are sent to the transcoding cluster.
[0055] Specifically, after the transcoding scheduling server determines the target transcoding strategy that matches the task to be transcoded through the above steps, it can also send the task to be transcoded and the matching target transcoding strategy to the transcoding cluster, so as to instruct the transcoding cluster to use the target transcoding strategy to transcode the task to be transcoded.
[0056] In the above transcoding task processing method, the tasks to be transcoded are acquired, and their backlog duration is identified. When the backlog duration meets the waiting time threshold corresponding to a preset degradation transcoding strategy, a target transcoding strategy matching the tasks to be transcoded is determined based on the backlog duration and the waiting time threshold. The tasks to be transcoded and the matching target transcoding strategy are then sent to the transcoding cluster. This allows for increased transcoding speed without increasing resources, while maintaining the quality of the transcoded output, thereby maximizing resource utilization.
[0057] In an exemplary embodiment, since the transcoding strategy includes corresponding transcoding parameters, and these parameters include transcoding speed, the transcoding speed of a given transcoding strategy is relatively fixed. That is, under the same transcoding strategy, the processing time for each transcoding task is approximately the same. Therefore, this embodiment can also determine the waiting time threshold corresponding to the downgraded transcoding strategy by setting a maximum allowed processing time for the downgraded transcoding strategy and the processing time for each transcoding task corresponding to the transcoding speed under that downgraded transcoding strategy. For example, if for a certain downgraded transcoding strategy F, its maximum allowed processing time is Tmax, and the processing time for each transcoding task is Tn, then the waiting time threshold corresponding to the downgraded transcoding strategy can be determined by (Tmax - Tn).
[0058] It is understandable that when there are multiple different levels of degradation transcoding strategies, since the transcoding parameters corresponding to each level of degradation transcoding strategy are different, that is, the processing time Tn for processing the transcoding task is different, the maximum allowed processing time Tmax set for it is also different (e.g., Figure 3A The actual processing time and the maximum allowed processing time for each level are calculated, so the waiting time thresholds corresponding to different levels of downgrade transcoding strategies are also different.
[0059] In an exemplary embodiment, the waiting time threshold may include a first waiting time threshold and a second waiting time threshold corresponding to the downgraded transcoding strategy, wherein the second waiting time threshold is greater than the first waiting time threshold. Since a longer task backlog indicates a larger backlog of tasks in the transcoding request queue, i.e., a higher degree of task backlog, different waiting time thresholds can be set based on the same downgraded transcoding strategy, and different maximum allowed processing time thresholds can be set based on different downgraded transcoding strategies. This allows for a preliminary assessment of the degree of task backlog based on the relationship between the task backlog of the tasks to be transcoded and different waiting time thresholds, thereby determining the target transcoding strategy for the tasks to be transcoded. For example, the first waiting time threshold may be a threshold condition for triggering the downgraded transcoding strategy for some tasks to be transcoded, and the second waiting time threshold may be a threshold condition for triggering the downgraded transcoding strategy for all tasks to be transcoded (e.g., ...). Figure 3A The waiting time thresholds for partially enabling the light degradation transcoding strategy, fully enabling the light degradation transcoding strategy, partially enabling the heavy degradation transcoding strategy, and fully enabling the heavy degradation transcoding strategy.
[0060] Therefore, different maximum allowed processing times can be preset for the same downgraded transcoding strategy. For example, the maximum allowed processing time Tmax1 for partially enabling the downgraded transcoding strategy and the maximum allowed processing time Tmax2 for fully enabling the downgraded transcoding strategy can be preset, where Tmax2 is greater than Tmax1. Since the processing time Tn for transcoding tasks is the same for the same downgraded transcoding strategy, the first waiting time threshold and the second waiting time threshold corresponding to the downgraded transcoding strategy can be calculated separately using the above-mentioned method for calculating waiting time thresholds.
[0061] Specifically, such as Figure 3B As shown, in step S220, when the task backlog duration meets the preset waiting time threshold corresponding to the downgrade transcoding strategy, a target transcoding strategy matching the task to be transcoded is determined based on the task backlog duration and the waiting time threshold. Specifically, this may include:
[0062] In step S310, when the task backlog duration is greater than or equal to the first waiting duration threshold and less than the second waiting duration threshold, the range of downgraded tasks targeted by the downgrade transcoding strategy is determined.
[0063] Since the second waiting time threshold is greater than the first waiting time threshold, when the backlog of tasks to be transcoded is greater than or equal to the first waiting time threshold and less than the second waiting time threshold, it indicates that the threshold condition for enabling the downgraded transcoding strategy for some tasks has been met. Based on this, the transcoding scheduling server can further determine the downgraded task range targeted by the downgraded transcoding strategy according to the task backlog, the first waiting time threshold, and the second waiting time threshold, that is, determine which tasks to be transcoded need to be transcoded using this downgraded transcoding strategy.
[0064] In step S320, when it is determined that the task to be transcoded belongs to the degraded task range, the degraded transcoding strategy is determined as the target transcoding strategy that matches the task to be transcoded.
[0065] Specifically, when the transcoding scheduling server determines that the task to be transcoded belongs to the degraded task range, it determines the degraded transcoding strategy as the target transcoding strategy that matches the task to be transcoded. That is, the target transcoding strategy for the task to be transcoded is determined to be the corresponding degraded transcoding strategy.
[0066] In the above embodiments, the transcoding scheduling server determines the target transcoding strategy for the task to be transcoded based on the task backlog duration. When the task backlog duration is greater than or equal to a first waiting time threshold and less than a second waiting time threshold, the transcoding scheduling server can determine the degraded task range targeted by the degraded transcoding strategy based on the task backlog duration, the first waiting time threshold, and the second waiting time threshold. When it is determined that the task to be transcoded belongs to the degraded task range, the degraded transcoding strategy is determined as the target transcoding strategy that matches the task to be transcoded, thereby enabling the degraded transcoding strategy to be gradually activated, thereby improving the transcoding processing speed, alleviating the pressure on the transcoding cluster, and minimizing the impact of the current transcoding task volume on the degraded transcoding.
[0067] In an exemplary embodiment, when the task backlog duration is greater than or equal to a second waiting time threshold, the transcoding scheduling server can further determine a downgraded transcoding strategy as the target transcoding strategy matching the task to be transcoded. Since the task backlog duration can characterize the degree of task backlog, and the second waiting time threshold can be a threshold condition for triggering the downgraded transcoding strategy for all tasks to be transcoded, when the task backlog duration is greater than or equal to the second waiting time threshold, it indicates that the condition for triggering the downgraded transcoding strategy for all tasks to be transcoded has been met. Therefore, the target transcoding strategy for the task to be transcoded can be determined as the corresponding downgraded transcoding strategy. This effectively alleviates the pressure on the transcoding cluster when the transcoding task volume reaches its peak, and improves the transcoding processing speed.
[0068] In one exemplary embodiment, such as Figure 4 As shown, the above-mentioned determination of the downgraded task range for the downgrade transcoding strategy based on the task backlog duration, the first waiting time threshold, and the second waiting time threshold can specifically include:
[0069] In step S410, the first difference between the task backlog duration and the first waiting duration threshold is obtained.
[0070] Specifically, if the task backlog duration for the transcoding task is t, and the first waiting time threshold corresponding to the downgrade transcoding strategy is T1 and the second waiting time threshold is T2, then the transcoding scheduling server first obtains the first difference between the task backlog duration t and the first waiting time threshold T1, that is, it calculates (t-T1) to obtain the corresponding first difference D1.
[0071] In step S420, a second difference between the second waiting time threshold and the first waiting time threshold is obtained.
[0072] In this embodiment, the transcoding scheduling server further obtains the second difference between the second waiting time threshold T2 and the first waiting time threshold T1, that is, calculates (T2-T1) to obtain the corresponding second difference D2.
[0073] In step S430, the percentage of the first difference to the second difference is obtained, and the percentage range less than or equal to the percentage is determined as the downgrade task range targeted by the downgrade transcoding strategy.
[0074] Specifically, after obtaining the first difference D1 and the second difference D2, the transcoding scheduling server can further calculate the percentage between the first difference D1 and the second difference D2, and determine the percentage range less than or equal to the first difference D1 as the degraded task range targeted by the degraded transcoding strategy. For example, if the first difference D1 accounts for 20% of the second difference D2, then the percentage range less than or equal to 20% (i.e., all percentages below 20%) can be determined as the degraded task range targeted by the degraded transcoding strategy.
[0075] Since a longer backlog of tasks awaiting transcoding indicates a higher degree of task backlog, and because both the first and second waiting time thresholds are preset fixed values, a longer backlog results in a larger calculated degraded task range, indicating more tasks requiring degraded transcoding. Conversely, a shorter backlog results in a smaller degraded task range, indicating fewer tasks requiring degraded transcoding. This allows for flexible adjustment of the degraded task range, minimizing the impact of degraded transcoding under varying transcoding task volumes.
[0076] In an exemplary embodiment, the transcoding task further has a corresponding task identifier, wherein the task identifier can be a flag or mark used to distinguish different tasks. For example, the task identifier can be a corresponding code or number. In this embodiment, taking an auto-incrementing number as an example, then... Figure 5 As shown, determining whether a task to be transcoded belongs to the downgraded task range can include the following steps:
[0077] In step S510, a modulo operation is performed on the task identifier of the transcoding task and the first set parameter to obtain the modulo operation result.
[0078] The first setting parameter is a pre-defined calculation factor used to perform a modulo operation on the task identifier of the task to be transcoded, in order to determine the target position number in the task identifier. For example, in this embodiment, the first setting parameter can be an integer 100. Then the transcoding scheduling server can use 100 to perform a modulo operation on the task identifier of the task to be transcoded, and the result of the modulo operation is the remainder when the task identifier is divided by 100, which is the last two digits of the task identifier of the task to be transcoded.
[0079] In step S520, the quotient between the modulo operation result and the second set parameter is obtained, and it is determined whether the quotient is within the degraded task range.
[0080] The second setting parameter can also be a pre-set calculation factor used for calculation. This second setting parameter ensures that the modulo operation result and the downgraded task interval have a unified unit of measurement. As can be seen from the above embodiments, the range corresponding to the downgraded task interval is a percentage range. Therefore, in this embodiment, the second setting parameter can also be an integer 100, so that the quotient between the above modulo operation result and the second setting parameter is also a percentage, thereby enabling matching with the downgraded task interval. Specifically, when the calculated quotient is within the downgraded task interval, step S530 is executed; when the calculated quotient is not within the downgraded task interval, step S540 is executed.
[0081] In step S530, it is determined that the task to be transcoded belongs to the downgraded task range.
[0082] Specifically, when the quotient calculated above falls within the degraded task range, the corresponding transcoding task can be determined to belong to the degraded task range. For example, if the degraded task range is a percentage range less than or equal to 20%, that is, a range consisting of all percentages less than or equal to 20%, when the quotient calculated above is 10%, since 10% is less than 20%, it means that the quotient falls within the degraded task range. Therefore, it can be determined that the corresponding transcoding task belongs to the degraded task range, and thus the target transcoding strategy for the transcoding task can be determined to be a degraded transcoding strategy.
[0083] In step S540, it is determined that the task to be transcoded does not belong to the downgraded task range.
[0084] Specifically, if the quotient calculated above is not within the degraded task range, then it can be determined that the corresponding transcoding task does not belong to the degraded task range. Therefore, it can be determined that the corresponding degraded transcoding strategy is not applicable to this transcoding task.
[0085] In this embodiment, a modulo operation is performed on the task identifier of the task to be transcoded and the first set parameter to obtain the modulo operation result. The quotient between the modulo operation result and the second set parameter is obtained. By judging whether the quotient is within the degraded task range, it is determined whether the corresponding task to be transcoded belongs to the degraded task range. Then, the target transcoding strategy of the task to be transcoded can be determined so as to realize the use of the current optimal transcoding strategy to transcode the task to be transcoded.
[0086] In an exemplary embodiment, when the task to be transcoded does not belong to the degraded task range, the current degraded transcoding strategy can be determined relative to the previous transcoding strategy, and the previous transcoding strategy can be identified as the target transcoding strategy matching the task to be transcoded. For example, when there is only one degraded transcoding strategy, this degraded transcoding strategy is a general transcoding strategy relative to the previous transcoding strategy, i.e., the transcoding strategy normally used by the transcoding cluster. Therefore, when the task backlog duration of the task to be transcoded is greater than or equal to the first waiting time threshold corresponding to the degraded transcoding strategy, and less than the second waiting time threshold, and it is determined that the task to be transcoded does not belong to the degraded task range, the target transcoding strategy for the task to be transcoded can be determined to be the general transcoding strategy.
[0087] When multiple degradation transcoding strategies are used, these strategies are typically progressively improved based on some metric. For example, considering two different degradation transcoding strategies, the improvement in transcoding speed will differ depending on the strategy. For instance, if the first degradation transcoding strategy doubles the transcoding speed compared to the general transcoding strategy, and the second degradation transcoding strategy further doubles the speed compared to the first, then the first degradation transcoding strategy is considered the general transcoding strategy relative to the original strategy, while the second degradation transcoding strategy is considered the first degradation transcoding strategy relative to the original strategy.
[0088] Therefore, when the cumulative duration of tasks to be transcoded is greater than or equal to the first waiting time threshold corresponding to the first degradation transcoding strategy, and less than the second waiting time threshold, and it is determined that the task to be transcoded does not belong to the corresponding degradation task range, then the target transcoding strategy for the task to be transcoded can be determined to be the general transcoding strategy. Conversely, when the cumulative duration of tasks to be transcoded is greater than or equal to the first waiting time threshold corresponding to the second degradation transcoding strategy, and less than the second waiting time threshold, and it is determined that the task to be transcoded does not belong to the corresponding degradation task range, then the target transcoding strategy for the task to be transcoded can be determined to be the first degradation transcoding strategy. This achieves gray-scale degradation processing of tasks to be transcoded, minimizing the impact range of degradation transcoding under different transcoding task volumes.
[0089] In one exemplary embodiment, such as Figure 6 As shown, after determining the downgrade transcoding strategy as the target transcoding strategy matching the transcoding task in step S320, the above method may further include:
[0090] In step S610, a transcoding recovery task is generated based on the transcoding task to be transcoded and the target transcoding strategy that matches the transcoding task.
[0091] The transcoding recovery task is defined relative to a transcoding task processed using a downgraded transcoding strategy. Since downgraded transcoding strategies reduce both the output image quality and bitrate, the transcoding recovery task aims to restore the output image quality and bitrate of a transcoding task processed using a downgraded transcoding strategy.
[0092] In this embodiment, when it is determined that the target transcoding strategy matched by a certain transcoding task is a downgraded transcoding strategy, the transcoding scheduling server can also generate a transcoding recovery task for the transcoding task based on the transcoding task and the target transcoding strategy matched by the transcoding task. This facilitates subsequent transcoding recovery processing of the transcoding task to improve its output image quality and output bitrate.
[0093] In step S620, when the transcoding cluster is detected to be in an idle state, a transcoding recovery task for the transcoding task to be transcoded is sent to the transcoding cluster.
[0094] In this context, the transcoding cluster being considered idle can mean that its load is below a certain threshold, for example, a load below 50% indicates that the transcoding cluster is in an idle state; alternatively, it can mean that its thread pool utilization is below a certain threshold, for example, a thread pool utilization below 50% indicates that the transcoding cluster is in an idle state. It is understood that the specific load threshold and thread pool utilization threshold can be set according to the actual scenario, and this embodiment does not limit them.
[0095] In this embodiment, when the transcoding scheduling server detects that the transcoding cluster is in an idle state, it can send a transcoding recovery task to the transcoding cluster, so that the transcoding cluster can perform transcoding recovery processing on the task to be transcoded when idle, thereby improving the output image quality and output bitrate when performing downgrade transcoding.
[0096] In an exemplary embodiment, taking a degradation transcoding strategy including a light degradation transcoding strategy and a heavy degradation transcoding strategy as an example, the transcoding task processing method of this disclosure is further described. In this embodiment, the speed of processing transcoding tasks using the light degradation transcoding strategy is twice that of processing transcoding tasks without degradation (i.e., using a general transcoding strategy), while the speed of processing transcoding tasks using the heavy degradation transcoding strategy is twice that of processing transcoding tasks with the light degradation transcoding strategy, that is, the speed of processing transcoding tasks using the heavy degradation transcoding strategy is four times that of processing transcoding tasks without degradation (i.e., using a general transcoding strategy). Wherein, as... Figure 7AAs shown, the light degradation transcoding policy has a first partial enabling waiting duration threshold T11 and a first full enabling waiting duration threshold T12, and the heavy degradation transcoding policy has a second partial enabling waiting duration threshold T21 and a second full enabling waiting duration threshold T22. Assume that transcoding tasks start to pile up at time T0, where T0 < T11 < T12 < T21 < T22. Then, as Figure 7B shown, the above transcoding task processing method may specifically include:
[0097] In step S710, obtain the transcoding task to be processed and identify the task piling up duration of the transcoding task to be processed.
[0098] Specifically, reference may be made to step S210 as Figure 2 shown, which will not be elaborated in this embodiment.
[0099] In step S720, determine the matching target transcoding policy according to the task piling up duration of the transcoding task to be processed.
[0100] Specifically, determine whether the task piling up duration of the transcoding task to be processed matches the waiting duration thresholds (i.e., T11, T12) corresponding to the above light degradation transcoding policy, or whether it matches the waiting duration thresholds (i.e., T21, T22) corresponding to the above heavy degradation transcoding policy. For example, when the task piling up duration of the transcoding task to be processed is less than T11, it means that it does not meet the degradation transcoding policy. Therefore, step S730 is executed; when the task piling up duration of the transcoding task to be processed is greater than or equal to T11 and less than T12, or greater than or equal to T12 and less than T21, it means that it meets the light degradation transcoding policy; when the task piling up duration of the transcoding task to be processed is greater than or equal to T21 and less than T22, or greater than or equal to T22, it means that it meets the heavy degradation transcoding policy. Therefore, when the task piling up duration of the transcoding task to be processed is greater than or equal to T12 and less than T21, or greater than or equal to T22, step S740 is executed; when the task piling up duration of the transcoding task to be processed is greater than or equal to T11 and less than T12, or when the task piling up duration of the transcoding task to be processed is greater than or equal to T21 and less than T22, step S750 is executed.
[0103] In step S730, determine the target transcoding policy of the transcoding task to be processed as the general transcoding policy. [[ID=elementID=20]] [[ID=elementID=21]]
[0102] [[ID=elementID=22]]When it is determined that the task piling up duration of the transcoding task to be processed does not meet the degradation transcoding policy, it means that the transcoding cluster is not at full load at this time. Therefore, the transcoding cluster can normally perform transcoding processing on this transcoding task to be processed, and thus it can be determined that the target transcoding policy of this transcoding task to be processed is the general transcoding policy, that is, no degradation processing is performed on it. Therefore, this transcoding task to be processed and the corresponding general transcoding policy can be sent to the transcoding cluster to prompt the transcoding cluster to use the general transcoding policy to perform transcoding processing on this transcoding task to be processed.
[0103] In step S740, the target transcoding strategy of the transcoding task is determined to be a matching downgrade transcoding strategy.
[0104] Specifically, when the backlog of tasks to be transcoded is greater than or equal to T12 and less than T21, it indicates that it matches the first all-enable waiting time threshold T12 corresponding to the light degradation transcoding strategy. Therefore, the target transcoding strategy for this task can be determined to be the light degradation transcoding strategy. When the backlog of tasks to be transcoded is greater than or equal to T22, it indicates that it matches the second all-enable waiting time threshold T22 corresponding to the heavy degradation transcoding strategy. Therefore, the target transcoding strategy for this task can be determined to be the heavy degradation transcoding strategy. Thus, the task to be transcoded and its corresponding degradation transcoding strategy can be sent to the transcoding cluster to prompt the transcoding cluster to use the corresponding degradation transcoding strategy to transcode the task.
[0105] In step S750, the degradation task range targeted by the corresponding degradation transcoding strategy is determined.
[0106] Specifically, when the task accumulation time of the tasks to be transcoded is greater than or equal to T11 and less than T12, it means that it matches the first part of the activation waiting time threshold T11 corresponding to the light degradation transcoding strategy. Since the light degradation transcoding strategy only applies to some of the tasks to be transcoded at this time, the range of degraded tasks targeted by the light degradation transcoding strategy can be further determined.
[0107] When the cumulative duration of the tasks to be transcoded is greater than or equal to T21 and less than T22, it means that it matches the second part of the activation waiting time threshold T21 corresponding to the re-degradation transcoding strategy. Since the re-degradation transcoding strategy only applies to some of the tasks to be transcoded at this time, the range of degraded tasks targeted by the re-degradation transcoding strategy can be further determined.
[0108] For a specific determination of the degradation task range targeted by the corresponding degradation transcoding strategy, please refer to the above. Figure 4 The embodiments shown are not described in detail here.
[0109] In step S760, it is determined whether the task to be transcoded belongs to the downgraded task range.
[0110] For details on determining whether a task to be transcoded belongs to the downgraded task range, please refer to the above. Figure 5 The embodiments shown are not described in detail here.
[0111] Specifically, when it is determined that the task to be transcoded belongs to the degraded task range, step S740 is executed to determine the target transcoding strategy of the task to be transcoded as a matching degraded transcoding strategy. For example, if it is determined that the task to be transcoded belongs to the lightly degraded task range, then the target transcoding strategy of the task to be transcoded can be determined as a lightly degraded transcoding strategy; and if it is determined that the task to be transcoded belongs to the heavily degraded task range, then the target transcoding strategy of the task to be transcoded can be determined as a heavily degraded transcoding strategy. When it is determined that the task to be transcoded does not belong to the degraded task range, step S770 is executed.
[0112] In step S770, the corresponding downgraded transcoding strategy is determined as the target transcoding strategy that matches the transcoding task to be transcoded, relative to the transcoding strategy before downgrading.
[0113] Specifically, when it is determined that the task to be transcoded does not belong to the degraded task range, the corresponding degraded transcoding strategy relative to the transcoding strategy before degrade can be determined as the target transcoding strategy matching the task to be transcoded. For example, if the task backlog duration of the task to be transcoded matches a light degraded transcoding strategy, then since this light degraded transcoding strategy is a general transcoding strategy relative to the transcoding strategy before degrade, the target transcoding strategy matching the task to be transcoded can be determined as a general transcoding strategy. Conversely, if the task backlog duration of the task to be transcoded matches a severe degraded transcoding strategy, then since this severe degraded transcoding strategy is a light degraded transcoding strategy relative to the transcoding strategy before degrade, the target transcoding strategy matching the task to be transcoded can be determined as a light degraded transcoding strategy.
[0114] In step S780, a transcoding recovery task is generated based on the transcoding task to be transcoded and the matching downgrade transcoding strategy.
[0115] Specifically, this embodiment can generate a corresponding transcoding recovery task based on the transcoding task to be downgraded, so that the transcoding recovery process can be performed on the transcoding task in the future to improve its output image quality and output bitrate.
[0116] In step S790, when the transcoding cluster is detected to be in an idle state, a transcoding recovery task for the transcoding task to be transcoded is sent to the transcoding cluster.
[0117] In this embodiment, when the transcoding scheduling server detects that the transcoding cluster is in an idle state, it can send a transcoding recovery task to the transcoding cluster, so that the transcoding cluster can perform transcoding recovery processing on the task to be transcoded when idle, thereby improving the output image quality and output bitrate when performing downgrade transcoding.
[0118] The above embodiments improve transcoding speed by performing grayscale downgrading transcoding when the transcoding task volume reaches its peak, and can perform transcoding recovery processing on downgraded transcoding tasks when the transcoding cluster is idle, thereby improving the transcoded output image quality and output bitrate, so as to maximize resource utilization.
[0119] It should be understood that, although Figure 1 The steps in the flowchart in Figure 7 are shown sequentially as indicated by the arrows; however, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise explicitly stated herein, there is no strict order requirement for the execution of these steps, and they can be executed in other orders. Furthermore, Figure 1 - At least some of the steps in Figure 7 may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the steps or stages in other steps.
[0120] It is understood that the same / similar parts between the various embodiments of the methods described above in this specification can be referred to each other. Each embodiment focuses on the differences from other embodiments, and relevant parts can be referred to the description of other method embodiments.
[0121] Figure 8 This is a block diagram of a transcoding task processing apparatus according to an exemplary embodiment. (Refer to...) Figure 8 The device includes a task acquisition module 802, a target transcoding strategy determination module 804, and a task sending module 806.
[0122] The task acquisition module 802 is configured to acquire tasks to be transcoded and identify the task backlog duration of the tasks to be transcoded.
[0123] The target transcoding strategy determination module 804 is configured to determine a target transcoding strategy that matches the task to be transcoded based on the task backlog duration and the waiting time threshold when the task backlog duration meets the preset waiting time threshold corresponding to the downgrade transcoding strategy.
[0124] The task sending module 806 is configured to send the task to be transcoded and the matching target transcoding strategy to the transcoding cluster, so as to instruct the transcoding cluster to use the target transcoding strategy to transcode the task to be transcoded.
[0125] In an exemplary embodiment, the waiting time threshold includes a first waiting time threshold and a second waiting time threshold corresponding to the downgrade transcoding strategy, wherein the second waiting time threshold is greater than the first waiting time threshold; the target transcoding strategy determination module further includes: a downgrade task interval determination unit, configured to determine the downgrade task interval targeted by the downgrade transcoding strategy based on the task accumulation time, the first waiting time threshold, and the second waiting time threshold when the task accumulation time is greater than or equal to the first waiting time threshold and less than the second waiting time threshold; and a target transcoding strategy matching unit, configured to determine the downgrade transcoding strategy as a target transcoding strategy matching the task to be transcoded when it is determined that the task to be transcoded belongs to the downgrade task interval.
[0126] In an exemplary embodiment, the degraded task interval determination unit is further configured to perform: obtaining a first difference between the task backlog duration and the first waiting duration threshold; obtaining a second difference between the second waiting duration threshold and the first waiting duration threshold; obtaining a percentage of the first difference to the second difference, and determining the percentage interval less than or equal to the percentage as the degraded task interval targeted by the degraded transcoding strategy.
[0127] In an exemplary embodiment, the task to be transcoded has a corresponding task identifier; the target transcoding strategy determination module is further configured to perform: performing a modulo operation on the task identifier of the task to be transcoded and a first set parameter to obtain a modulo operation result, wherein the first set parameter is used to perform a modulo operation on the task identifier of the task to be transcoded to determine a calculation factor of the target position identifier in the task identifier; obtaining the quotient between the modulo operation result and a second set parameter, wherein the second set parameter is used to make the modulo operation result and the downgraded task interval have a unified unit of measurement; when the quotient is within the downgraded task interval, determining that the task to be transcoded belongs to the task of the downgraded task interval.
[0128] In an exemplary embodiment, the target transcoding strategy determination module is further configured to perform: when the task to be transcoded does not belong to the task in the downgraded task range, determine the downgraded transcoding strategy relative to the transcoding strategy before downgrading; and determine the transcoding strategy before downgrading as the target transcoding strategy that matches the task to be transcoded.
[0129] In one exemplary embodiment, the apparatus further includes a transcoding recovery processing module configured to perform: generating a transcoding recovery task for the task to be transcoded based on the task to be transcoded and a target transcoding strategy matching the task to be transcoded; and sending the transcoding recovery task for the task to be transcoded to the transcoding cluster when the transcoding cluster is detected to be in an idle state, so as to instruct the transcoding cluster to perform transcoding recovery processing on the task to be transcoded.
[0130] In an exemplary embodiment, the target transcoding strategy determination module is further configured to: determine the downgrade transcoding strategy as the target transcoding strategy that matches the task to be transcoded when the task backlog duration is greater than or equal to the second waiting duration threshold.
[0131] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0132] Figure 9 This is a block diagram illustrating an electronic device S00 for a transcoding task processing method according to an exemplary embodiment. For example, the electronic device S00 can be a server. (Refer to...) Figure 9 The electronic device S00 includes a processing component S20, which further includes one or more processors, and memory resources represented by a memory S22 for storing instructions, such as application programs, that can be executed by the processing component S20. The application programs stored in the memory S22 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component S20 is configured to execute instructions to perform the methods described above.
[0133] The electronic device S00 may further include: a power supply component S24 configured to perform power management of the electronic device S00, a wired or wireless network interface S26 configured to connect the electronic device S00 to a network, and an input / output (I / O) interface S28. The electronic device S00 can operate on an operating system stored in memory S22, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, or similar.
[0134] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory S22 including instructions, which can be executed by a processor of an electronic device S00 to perform the above-described method. The storage medium can be a computer-readable storage medium, for example, a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0135] In an exemplary embodiment, a computer program product is also provided, the computer program product including instructions that can be executed by a processor of an electronic device S00 to perform the above method.
[0136] It should be noted that the above-mentioned apparatus, electronic equipment, computer-readable storage medium, computer program product, etc., may also include other implementation methods according to the description of the method embodiments. For specific implementation methods, please refer to the description of the relevant method embodiments, which will not be elaborated here.
[0137] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.
[0138] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A transcoding task processing method, characterized in that, The method includes: Obtain the tasks to be transcoded and identify the task backlog duration of the tasks to be transcoded. When the task backlog duration meets the preset waiting time threshold corresponding to the downgrade transcoding strategy, a target transcoding strategy matching the task to be transcoded is determined based on the task backlog duration and the waiting time threshold. Send the task to be transcoded and the target transcoding strategy to the transcoding cluster to instruct the transcoding cluster to use the target transcoding strategy to transcode the task to be transcoded. The waiting time threshold includes a first waiting time threshold and a second waiting time threshold corresponding to the downgrade transcoding strategy, wherein the second waiting time threshold is greater than the first waiting time threshold; When the task backlog duration meets a preset waiting time threshold corresponding to a downgraded transcoding strategy, a target transcoding strategy matching the task to be transcoded is determined based on the task backlog duration and the waiting time threshold, including: When the task backlog duration is greater than or equal to the first waiting duration threshold and less than the second waiting duration threshold, the downgraded task range targeted by the downgrade transcoding strategy is determined based on the task backlog duration, the first waiting duration threshold, and the second waiting duration threshold. When it is determined that the task to be transcoded belongs to the task range of the downgraded task, the downgraded transcoding strategy is determined as the target transcoding strategy that matches the task to be transcoded. When the task to be transcoded does not belong to the task range of the downgraded task, the downgraded transcoding strategy is determined relative to the transcoding strategy before downgrading; the transcoding strategy before downgrading is determined as the target transcoding strategy that matches the task to be transcoded. When the task backlog duration is greater than or equal to the second waiting duration threshold, the downgrade transcoding strategy is determined as the target transcoding strategy that matches the task to be transcoded.
2. The method according to claim 1, characterized in that, There are multiple preset downgrade transcoding strategies, and each downgrade transcoding strategy has a corresponding waiting time threshold and downgrade transcoding parameters. The downgrade transcoding parameters include at least one of transcoding speed, transcoding output bitrate, and output image quality.
3. The method according to claim 1, characterized in that, The step of determining the degraded task range targeted by the degraded transcoding strategy based on the task backlog duration, the first waiting duration threshold, and the second waiting duration threshold includes: Obtain the first difference between the task backlog duration and the first waiting duration threshold; Obtain the second difference between the second waiting time threshold and the first waiting time threshold; Obtain the percentage of the first difference to the second difference, and determine the percentage range that is less than or equal to the first difference as the downgrade task range targeted by the downgrade transcoding strategy.
4. The method according to claim 1, characterized in that, The transcoding task has a corresponding task identifier; the method further includes: A modulo operation is performed on the task identifier of the task to be transcoded and a first set parameter to obtain a modulo operation result. The first set parameter is used to perform a modulo operation on the task identifier of the task to be transcoded in order to determine the calculation factor of the target position identifier in the task identifier. Obtain the quotient between the modulo operation result and the second set parameter, where the second set parameter is a calculation factor used to ensure that the modulo operation result and the downgraded task interval have a unified unit of measurement; When the quotient is located within the downgraded task range, the transcoding task is determined to belong to the downgraded task range.
5. The method according to claim 1, characterized in that, After determining the downgraded transcoding strategy as the target transcoding strategy that matches the transcoding task to be transcoded, the method further includes: Based on the transcoding task to be transcoded and the target transcoding strategy matching the transcoding task, a transcoding recovery task for the transcoding task is generated. When the transcoding cluster is detected to be in an idle state, a transcoding recovery task for the transcoding task to be transcoded is sent to the transcoding cluster to instruct the transcoding cluster to perform transcoding recovery processing on the transcoding task to be transcoded.
6. A transcoding task processing device, characterized in that, The device includes: The task acquisition module is configured to acquire tasks to be transcoded and identify the task backlog duration of the tasks to be transcoded. The target transcoding strategy determination module is configured to determine a target transcoding strategy that matches the task to be transcoded when the task backlog duration meets the preset waiting time threshold corresponding to the downgrade transcoding strategy. The task sending module is configured to send the task to be transcoded and the target transcoding strategy to the transcoding cluster, so as to instruct the transcoding cluster to use the target transcoding strategy to transcode the task to be transcoded. The waiting time threshold includes a first waiting time threshold and a second waiting time threshold corresponding to the downgraded transcoding strategy, wherein the second waiting time threshold is greater than the first waiting time threshold; the target transcoding strategy determination module further includes: a downgraded task interval determination unit, configured to determine the downgraded task interval targeted by the downgraded transcoding strategy based on the task accumulation time, the first waiting time threshold, and the second waiting time threshold when the task accumulation time is greater than or equal to the first waiting time threshold and less than the second waiting time threshold; and a target transcoding strategy matching unit, configured to determine the downgraded transcoding strategy as a target transcoding strategy matching the task to be transcoded when it is determined that the task to be transcoded belongs to the downgraded task interval; The target transcoding strategy determination module is further configured to, when the task to be transcoded does not belong to the degraded task range, determine the degraded transcoding strategy relative to the transcoding strategy before degrading; and determine the transcoding strategy before degrading as the target transcoding strategy that matches the task to be transcoded. The target transcoding strategy determination module is further configured to determine the downgrade transcoding strategy as the target transcoding strategy that matches the task to be transcoded when the task backlog duration is greater than or equal to the second waiting duration threshold.
7. The apparatus according to claim 6, characterized in that, The degraded task interval determination unit is further configured to perform the following: obtain a first difference between the task backlog duration and the first waiting duration threshold; obtain a second difference between the second waiting duration threshold and the first waiting duration threshold; obtain a percentage of the first difference to the second difference; and determine the percentage interval less than or equal to the first percentage as the degraded task interval targeted by the degraded transcoding strategy.
8. The apparatus according to claim 6, characterized in that, The task to be transcoded has a corresponding task identifier; the target transcoding strategy determination module is further configured to perform a modulo operation on the task identifier of the task to be transcoded and a first set parameter to obtain a modulo operation result, wherein the first set parameter is used to perform a modulo operation on the task identifier of the task to be transcoded to determine the calculation factor of the target position identifier in the task identifier; obtain the quotient between the modulo operation result and a second set parameter, wherein the second set parameter is used to make the modulo operation result and the downgraded task interval have a unified unit of measurement; when the quotient is within the downgraded task interval, it is determined that the task to be transcoded belongs to the task of the downgraded task interval.
9. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the transcoding task processing method as described in any one of claims 1 to 5.
10. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device is able to perform the transcoding task processing method as described in any one of claims 1 to 5.