CN118132258A - Video acceleration card selection method and device, computer equipment and storage medium - Google Patents
Video acceleration card selection method and device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN118132258A CN118132258A CN202410234080.0A CN202410234080A CN118132258A CN 118132258 A CN118132258 A CN 118132258A CN 202410234080 A CN202410234080 A CN 202410234080A CN 118132258 A CN118132258 A CN 118132258A
- Authority
- CN
- China
- Prior art keywords
- video
- candidate
- task
- processing
- tasks
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 230000001133 acceleration Effects 0.000 title claims abstract description 93
- 238000010187 selection method Methods 0.000 title claims abstract description 28
- 238000012545 processing Methods 0.000 claims abstract description 387
- 238000000034 method Methods 0.000 claims abstract description 36
- 238000007781 pre-processing Methods 0.000 claims abstract description 10
- 230000015654 memory Effects 0.000 claims description 33
- 238000011161 development Methods 0.000 abstract description 13
- 230000006870 function Effects 0.000 description 8
- 238000010586 diagram Methods 0.000 description 7
- 238000007726 management method Methods 0.000 description 5
- 238000004891 communication Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 238000012423 maintenance Methods 0.000 description 3
- 238000009877 rendering Methods 0.000 description 3
- 230000006835 compression Effects 0.000 description 2
- 238000007906 compression Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000013468 resource allocation Methods 0.000 description 2
- 239000007787 solid Substances 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T1/00—General purpose image data processing
- G06T1/20—Processor architectures; Processor configuration, e.g. pipelining
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Television Signal Processing For Recording (AREA)
Abstract
The invention relates to the technical field of video processing, and discloses a video acceleration card selection method, a device, computer equipment and a storage medium, wherein the method comprises the following steps: acquiring a first video acceleration card set based on the processing resources of each video acceleration card and the processing resources required by video tasks; each video acceleration card in the first video acceleration card set is used as a candidate video acceleration card for preprocessing the video task, and then the residual processing resources after the candidate video acceleration card preprocesses the video task are predicted; generating a candidate scheme based on the candidate video accelerator card, the remaining processing resources of the candidate video accelerator card, other video accelerator cards, and the processing resources of other video accelerator cards; determining task processing capacity of each candidate scheme; and selecting a candidate scheme with optimal task processing capacity, and determining a candidate video acceleration card in the optimal candidate scheme as a target video acceleration card. The invention realizes the automatic allocation of video acceleration card resources and reduces the development cost of users.
Description
Technical Field
The invention relates to the technical field of video processing, in particular to a video accelerator card selection method, a video accelerator card selection device, computer equipment and a storage medium.
Background
Video accelerator cards are a type of hardware device that is dedicated to accelerating video processing and rendering. They are typically used in conjunction with a computer or server to provide faster video processing speeds and a smoother playback experience.
In general, a video processing task is run by a video accelerator card, and development or operation personnel need to specify on an application layer which video accelerator card the video processing task runs manually or by means of a configuration file. This approach requires the user to maintain video accelerator card resources, increasing user development costs.
Disclosure of Invention
In view of the above, the present invention provides a method, an apparatus, a computer device and a storage medium for selecting a video accelerator card, so as to solve the problem that the existing video accelerator card selecting method requires a user to maintain video accelerator card resources, and the development cost of the user is high.
In a first aspect, the present invention provides a video accelerator card selection method, where the method includes:
acquiring processing resources of each video acceleration card in a plurality of video acceleration cards, wherein the processing resources are used for processing video tasks;
Receiving a video task to be processed;
determining processing resources required by the video task based on the task type of the video task;
Acquiring a first video acceleration card set based on processing resources of each video acceleration card and processing resources required by the video task in a plurality of video acceleration cards;
Each video acceleration card in the first video acceleration card set is used as a candidate video acceleration card for preprocessing the video task, and then the residual processing resources after the candidate video acceleration card preprocesses the video task are predicted;
generating a candidate scheme based on each candidate video accelerator card, the remaining processing resources of the candidate video accelerator cards, other video accelerator cards except the candidate video accelerator cards in the plurality of video accelerator cards, and the processing resources of the other video accelerator cards;
Determining task processing capacity of each candidate scheme in a plurality of candidate schemes, wherein the task processing capacity is used for respectively processing the number of one or more types of video tasks in different types of video tasks through the residual processing resources of the candidate video accelerator cards, and determining the number of one or more types of video tasks in different types of video tasks through the processing resources of other video accelerator cards except the candidate video accelerator cards in the plurality of video accelerator cards;
and selecting a candidate scheme with optimal task processing capacity from the plurality of candidate schemes, and determining a candidate video acceleration card in the optimal candidate scheme as a target video acceleration card for processing the video task to be processed.
According to the video accelerator card selection method, the optimal target video accelerator card is determined through the processing resources required by the video task to be processed, the processing resources of each video accelerator card and the processing resources required by each type of video task, and the video task to be processed is processed by the target video accelerator card, so that the automatic allocation of the video accelerator card resources is realized, and the development cost of users is reduced.
In an alternative embodiment, the obtaining a first video accelerator card set based on processing resources of each of the video accelerator cards and processing resources required for the video task includes:
And selecting video accelerator cards with processing resources larger than or equal to the processing resources required by the video task from the video accelerator cards to form the first video accelerator card set.
The video accelerator card selection method provided by the embodiment realizes automatic allocation of video accelerator card resources and reduces the development cost of users.
In an alternative embodiment, the determining the task processing capability of each of the plurality of candidates includes:
Determining the priority of each type of video task in the different types of video tasks based on the processing resources required by each type of video task in the different types of video tasks;
Determining the number of video tasks with highest priority processed by the residual processing resources of the candidate video accelerator cards under each candidate scheme in a plurality of candidate schemes, and the number of video tasks with highest priority processed by the processing resources of other video accelerator cards except the candidate video accelerator cards in the plurality of video accelerator cards, so as to determine the total amount of the video tasks with highest priority processed under each candidate scheme;
determining the task processing capacity of each candidate scheme based on the total amount of the video tasks with the highest priority, wherein the more the total amount of the video tasks with the highest priority is processed, the greater the task processing capacity of the corresponding candidate scheme is;
When at least two candidate schemes exist and the total amount of the video tasks with the highest processing priority is the largest, acquiring the total amount of the video tasks with the secondary priority from the candidate scheme with the highest processing priority and determining that the total amount of the video tasks with the secondary priority is the largest and the task processing capacity is the largest;
Or when the candidate solution with the largest total amount of video tasks of the secondary priority comprises at least two, further determining the total amount of video tasks of the next priority according to the sorting order of the priorities until the task processing capacity of each candidate solution is determined.
According to the video accelerator card selection method, the optimal target video accelerator card is determined through the processing resources required by the video task to be processed, the processing resources of each video accelerator card, the processing resources required by each type of video task and the task processing capacity of each candidate scheme, the video task to be processed is processed by the target video accelerator card, automatic allocation of the video accelerator card resources is achieved, and the development cost of users is reduced.
In an alternative embodiment, the determining the priority of each of the different types of video tasks based on the processing resources required for each of the different types of video tasks includes:
And arranging the priorities of each type of video tasks from high to low according to the order of the processing resources required by each type of video tasks.
In an alternative embodiment, the selecting a candidate solution with optimal task processing capability from a plurality of candidate solutions includes:
when the total amount of video tasks of any priority before each candidate scheme of the plurality of candidate schemes processes the video tasks of the ith priority is determined to be the same according to the sorting order of the priorities, selecting the candidate scheme with the largest total amount of video tasks of the ith priority as the optimal candidate scheme;
or when at least two candidate schemes exist and the total amount of the video tasks of each priority is the same, randomly selecting one candidate scheme from at least two candidate schemes with the same total amount of the video tasks of each priority as the optimal candidate scheme.
According to the video accelerator card selection method, the optimal target video accelerator card is determined through the processing resources required by the video task to be processed, the processing resources of each video accelerator card, the processing resources required by each type of video task and the task processing capacity of each candidate scheme, the video task to be processed is processed by the target video accelerator card, automatic allocation of the video accelerator card resources is achieved, and the development cost of users is reduced.
In an alternative embodiment, the processing resources of the video accelerator card, the remaining processing resources of the candidate video accelerator card, the processing resources required by the video tasks of different types, and the processing resources required by the video tasks to be processed are all integer multiples of sub-processing resources, where the processing resource required by the video task type with the lowest priority is the sub-processing resource.
In an alternative embodiment, in the case of an initialization start, the processing resource of each of the plurality of video accelerator cards is full.
In a second aspect, the present invention provides a video accelerator card selecting apparatus, the apparatus comprising:
The processing resource acquisition module is used for acquiring the processing resource of each video acceleration card in the plurality of video acceleration cards, and the processing resource is used for processing video tasks;
The video task receiving module is used for receiving the video task to be processed;
The processing resource determining module is used for determining processing resources required by the video task based on the task type of the video task;
The first video acceleration card set acquisition module is used for acquiring a first video acceleration card set based on the processing resources of each video acceleration card in the plurality of video acceleration cards and the processing resources required by the video task;
the residual processing resource prediction module is used for predicting the residual processing resources of the video task preprocessed by the candidate video accelerator after each video accelerator in the first video accelerator set is used as the candidate video accelerator for preprocessing the video task;
a candidate solution generating module, configured to generate a candidate solution based on each of the candidate video accelerator cards, remaining processing resources of the candidate video accelerator cards, other video accelerator cards except the candidate video accelerator cards in the plurality of video accelerator cards, and processing resources of the other video accelerator cards;
A task processing capability determining module, configured to determine a task processing capability of each candidate solution in the plurality of candidate solutions, where the task processing capability is configured to process, by using remaining processing resources of the candidate video accelerator card, a number of one or more types of video tasks in different types of video tasks, and determine a number of one or more types of video tasks in different types of video tasks, where processing resources of other video accelerator cards in the plurality of video accelerator cards except the candidate video accelerator card;
And the target accelerating card determining module is used for selecting a candidate scheme with optimal task processing capacity from a plurality of candidate schemes, and determining a candidate video accelerating card in the optimal candidate scheme as a target video accelerating card for processing the video task to be processed.
In a third aspect, the present invention provides a computer device comprising: the video acceleration card selecting device comprises a memory and a processor, wherein the memory and the processor are in communication connection, the memory stores computer instructions, and the processor executes the computer instructions, so that the video acceleration card selecting method according to the first aspect or any implementation mode corresponding to the first aspect is executed.
In a fourth aspect, the present invention provides a computer readable storage medium having stored thereon computer instructions for causing a computer to execute the video accelerator card selection method according to the first aspect or any one of the embodiments corresponding thereto.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a video accelerator card operating architecture according to the related art;
FIG. 2 is a schematic diagram of a video accelerator card operating architecture according to an embodiment of the invention;
FIG. 3 is a flow chart of a video accelerator card selection method according to an embodiment of the invention;
FIG. 4 is a flowchart of another video accelerator card selection method according to an embodiment of the invention;
FIG. 5 is a block diagram of a video accelerator card selection device according to an embodiment of the invention;
Fig. 6 is a schematic diagram of a hardware structure of a computer device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Video accelerator cards are a type of hardware device that is dedicated to accelerating video processing and rendering. They are typically used in conjunction with a computer or server to provide faster video processing speeds and a smoother playback experience.
Various types of video accelerator cards are provided in the market at present, and the video accelerator cards are mainly applied to the following fields:
Professional video editing: the video editing, special effect processing, color correction and other tasks need a large amount of computing resources, and the video accelerator card can help editors to improve the working efficiency.
Game live and content authoring: many game players and content creators need to process video and game pictures simultaneously when playing live or recorded, and the video accelerator card can relieve the CPU (Central Processing Unit ) from the burden and provide a smoother live and recorded experience.
Cloud video service: with the development of cloud technology, many video service providers began to employ video accelerator cards to provide higher quality video content and better user experience.
Although video accelerator cards have made significant advances in performance and efficiency, there are still challenges in the market today. First, the price problem, video accelerator cards are often expensive and may not be easily affordable to the average consumer.
In general, video accelerator cards have a wide application prospect in the field of video processing and rendering, and with the continuous progress of technology, we can expect higher performance and more innovative video accelerator card products to appear.
The video accelerator card is used for processing video tasks, and the video tasks can be video encoding and decoding tasks or video transcoding tasks. The following description is made by taking a video task as a video encoding and decoding task, wherein a certain relation exists between the video encoding and decoding task and video resolution, and the video resolution is one of important factors influencing the occupation of resources of the video encoding and decoding task. Generally, as video resolution increases, so does the need for video acceleration card resources for video codec tasks.
In particular, the main impact of video resolution on video codec task resource occupancy includes the following:
GPU (Graphics Processing Unit, graphics processor) computing resources: an increase in video resolution results in an increase in the amount of computation in video codec tasks. For example, in the video encoding process, more pixels need to be compressed; in the decoding process, more pixels need to be restored. This will create a higher demand on the GPU computing resources of the video accelerator card, potentially requiring more computing cores and greater memory bandwidth.
Display memory requirement: the higher the video resolution, the larger the size of the video data will increase accordingly. The video encoding and decoding task needs to load video data into the video memory of the video accelerator card for processing. Therefore, as video resolution increases, the video codec task's demand for video memory capacity increases. Higher resolution video may require more memory to store video frames, code streams, and associated decoding parameters, etc.
Hardware decoder/encoder efficiency: hardware decoders and encoders on video accelerator cards are typically optimized for a particular video codec format. Higher resolution video codec tasks place higher demands on the efficiency of the hardware decoder/encoder, and it is necessary to ensure that large amounts of high resolution video data can be processed quickly and stably.
It should be noted that the video codec task occupies video accelerator card resources not only in relation to video resolution, but also in relation to factors such as video codec algorithm, compression format, and system performance. Therefore, in practical application, the developer needs to comprehensively consider these factors and perform appropriate system configuration and resource allocation to meet the requirements of video encoding and decoding tasks.
Fig. 1 is a schematic diagram of a video accelerator card operating architecture according to the related art. As shown in fig. 1, in the related art, the video accelerator card operation architecture includes a computer hardware layer, a video accelerator card driving layer, a video accelerator card software stack, an application layer, and a video processing framework layer, where a plurality of video accelerator cards are physically connected to the computer hardware layer, and an operating system provides an operation environment for the video accelerator card driving layer, the video accelerator card software stack, the application layer, and the video processing framework layer.
In the related art, the method for processing the video encoding and decoding task by the user by using the video accelerator card is as follows: the application layer receives the video coding and decoding task, determines a video acceleration card for running the video coding and decoding task from a configuration file preset by a user, acquires a corresponding video acceleration card by calling a video acceleration card software stack, and runs the video coding and decoding task on the determined video acceleration card.
After the application layer determines the video acceleration card for running the video coding and decoding task from the configuration file preset by the user, the application layer can also call a video acceleration card software stack through the video processing frame so as to obtain the corresponding video acceleration card, and the video coding and decoding task is run on the determined video acceleration card. Illustratively, the video processing framework may be FFmpeg.
In general, a video codec task is run by a video accelerator card, and a user designates the video accelerator card running the video codec task manually at the application layer or by means of a configuration file. The user can be a developer or an operation and maintenance person, and can also be any person using the video accelerator card.
Illustratively, mirror 1080P video encoding is performed when executing ffmpeg commands, and service usage/dev/transcoder 0 video accelerator card resources are specified for processing by the parameter "insvid = dev0:/dev/transcoder 0". The corresponding code may include:
ffmpeg-y-vsync 0-init_hw_device
insvid=dev0:/dev/transcoder0,priority=vod,insvidloglevel=0-s 1920x1080-pix_fmt yuv420p-iinput.yuv-filter_complex'insvid_pp'-c:v h264enc_insvid-preset superfast-b:v 10000000out0.h264.
when the codes are used for service development, the video accelerator card used for the service needs to be specified during the initialization of the video accelerator card, and the video accelerator card can be/dev/transcoder 4. The corresponding code may include:
Therefore, in the related art, the video task binding video accelerator card needs to be specified by the application layer user, and the user is required to maintain the video accelerator card resource, so that the development cost of the user is increased. The user can not acquire the video acceleration card resource, and after the video acceleration card reaches the upper limit of task processing, the user can still issue video tasks to the card, which can cause confusion of service resources and influence other running tasks.
Fig. 2 is a schematic diagram of a video accelerator card operating architecture according to an embodiment of the invention. As shown in fig. 2, in the embodiment of the present invention, the video accelerator card operation architecture includes a computer hardware layer, a video accelerator card driving layer, a video accelerator card software stack, a video accelerator card resource management module, an application layer and a video processing framework layer, where a plurality of video accelerator cards are physically connected to the computer hardware layer, and an operating system provides an operation environment for the video accelerator card driving layer, the video accelerator card software stack, the video accelerator card resource management module, the application layer and the video processing framework layer.
Compared with fig. 1, the video accelerator card operation architecture of the embodiment of the invention is added with the video accelerator card resource management module, and the video accelerator card selection method is executed by using the module, so that the corresponding video accelerator card can be automatically allocated for the video task to be processed, and the user does not need to manually perform pre-configuration at an application layer.
The embodiment of the invention provides a video accelerator card selection method which is executed on a video accelerator card resource management module. The video acceleration card processes the video coding and decoding task in the following way: the application layer receives the video coding and decoding task, the video acceleration card resource management module executes a video acceleration card selection method to obtain a video acceleration card for processing the video coding and decoding task, and the video acceleration card is used for processing the video coding and decoding task. According to the video accelerator card selection method provided by the embodiment of the invention, the optimal video accelerator card is allocated for the video task to be processed by acquiring the processing resource of each video accelerator card in the plurality of video accelerator cards, the processing resource required by the video task to be processed and the processing resource required by the video task of different types, so that the effect of automatically allocating the video accelerator cards for the video task is achieved, and the reasonable allocation of the video accelerator card resources is ensured.
In accordance with an embodiment of the present invention, a video accelerator card selection method embodiment is provided, it being noted that the steps shown in the flowchart of the figures may be performed in a computer system, such as a set of computer executable instructions, and, although a logical sequence is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than what is shown or described herein.
In this embodiment, a video accelerator card selection method is provided, which may be used in the above mobile terminal, such as a central processing unit, a server, etc., and fig. 3 is a flowchart of a video accelerator card selection method according to an embodiment of the present invention, as shown in fig. 3, where the flowchart includes the following steps:
step S301, obtaining processing resources of each video accelerator card in the plurality of video accelerator cards.
The processing resources are used for processing video tasks, and the video accelerator cards are physically connected with the computer hardware.
The current processing resources of each of the plurality of video accelerator cards are obtained. It can be understood that, when there may be some video tasks issued by the video accelerator card before the video accelerator card is processing, the current processing resources of the video accelerator card are the difference between the total processing resources of the video accelerator card and the processing resources occupied by the video tasks being processed by the video accelerator card.
Step S302, a video task to be processed is received.
The method comprises the steps of receiving a video task to be processed issued by an application layer or receiving a video task to be processed issued by the application layer through a video processing frame, wherein the video task can be a video coding task, a video decoding task or a video transcoding task.
Step S303, based on the task type of the video task, determining the processing resources required by the video task.
After the video task to be processed is obtained, determining processing resources required by the video task according to the task type of the video task to be processed.
Note that, task types of the video task may include: video resolution, video frame rate, video codec algorithms, compression format, system performance, etc. The information covered by the task type of the video task should be related to the processing resources required for the video task.
Step S304, a first video accelerator card set is obtained based on the processing resources of each video accelerator card of the plurality of video accelerator cards and the processing resources required by the video task.
After the current processing resource of each video accelerator card of the plurality of video accelerator cards and the processing resource required by the issued video task are obtained, comparing the current processing resource of each video accelerator card of the plurality of video accelerator cards with the processing resource required by the issued video task to obtain a first video accelerator card set.
Step S305, after each video accelerator card in the first video accelerator card set is used as a candidate video accelerator card for preprocessing the video task, predicting the remaining processing resources after the candidate video accelerator card preprocesses the video task.
After the first video acceleration card set is obtained, each video acceleration card in the first video acceleration card set is used as a candidate video acceleration card for preprocessing a video task, and residual processing resources after the candidate video acceleration card preprocesses the video task are obtained.
And the residual processing resources after the candidate video accelerator card preprocesses the video task are obtained by making a difference between the current processing resources of the candidate video accelerator card and the processing resources required by the video task.
Step S306 generates a candidate solution based on each candidate video accelerator card, the remaining processing resources of the candidate video accelerator cards, the other video accelerator cards other than the candidate video accelerator cards among the plurality of video accelerator cards, and the processing resources of the other video accelerator cards.
After the candidate video accelerator card and the remaining processing resources of the candidate video accelerator card are determined, the candidate video accelerator card, the remaining processing resources of the candidate video accelerator card, other video accelerator cards except the candidate video accelerator card in the plurality of video accelerator cards, and the processing resources of other video accelerator cards are used as a candidate scheme.
It will be appreciated that the number of candidates is the same as the number of video accelerator cards in the first set of video accelerator cards and less than the total number of video accelerator cards physically connected to the computer hardware. That is, when each video accelerator card in the first video accelerator card set is a candidate video accelerator card, one candidate is corresponding.
The processing resources of other video accelerator cards except the candidate video accelerator card in the plurality of video accelerator cards are the same as the current processing resources of the other acquired video accelerator cards.
Step S307 determines the task processing capability of each of the plurality of candidates.
After the multiple candidate schemes are obtained, the number of one or more types of video tasks in different types of video tasks is processed through the residual processing resources of the candidate video accelerator cards, and the number of one or more types of video tasks in different types of video tasks is processed through the processing resources of the other video accelerator cards except the candidate video accelerator cards, so that the task processing capacity of each candidate scheme is determined.
It should be noted that the different types of video tasks may be a plurality of types of video tasks that can be processed by the video accelerator card.
Assuming that the total processing resources of one video accelerator card except the candidate video accelerator card among the plurality of video accelerator cards are 32 sub-processing resources, the current processing resources are 21 sub-processing resources, the video accelerator card can process four types of video encoding tasks, namely 720p30fps, 1080p30fps, 4k30fps and 4k60fps, and under the condition that factors influencing the occupation of video encoding and decoding task resources are the same except for video resolution and video frame rate, 720p30fps corresponds to 1 sub-processing resource, 1080p30fps corresponds to 2 sub-processing resources, 4k30fps corresponds to 8 sub-processing resources, and 4k60fps corresponds to 16 sub-processing resources.
The current processing resource of the video accelerator card then pre-processes the four types of video encoding tasks in order of priority, i.e., 4k60fps, 4k30fps, 1080p30fps, 720p30fps. The current processing resource of the video accelerator card is divided by the processing resource required by the 4k60fps task, the quotient is 1, the remainder is 5, and then the video accelerator card can preprocess 14 k60fps task, and the rest is 5 sub-processing resources. The video accelerator card can preprocess 04 k30fps tasks with the remainder being 5, with the remaining 5 sub-processing resources divided by the processing resources required for the 4k30fps tasks, with a quotient of 0, and the remainder being 5. The video accelerator card can preprocess 2 1080p30fps tasks with the remainder being 1, and the remaining 1 sub-processing resource being 1, using the remaining 5 sub-processing resources divided by the processing resource required for 1080p30fps tasks. The video accelerator card can preprocess 1 720p30fps task with the remainder being 0, with the remaining 1 sub-processing resource divided by the processing resource required for 720p30fps task, with a quotient of 1 and a remainder being 0.
It can be seen that the current processing resources of the video accelerator card can preprocess 14 k60fps task, 04 k30fps task, 2 1080p30fps task, and 1 720p30fps task.
Step S308, selecting a candidate scheme with optimal task processing capacity from the plurality of candidate schemes, and determining a candidate video accelerator card in the optimal candidate scheme as a target video accelerator card for processing the video task to be processed.
After the task processing capacity of each candidate scheme in the plurality of candidate schemes is obtained, selecting a candidate scheme with optimal task processing capacity from the plurality of candidate schemes, and determining a candidate video acceleration card in the optimal candidate scheme as a target video acceleration card for processing the video task to be processed.
It will be appreciated that the greater the task processing power, the better its corresponding candidate.
After the target video accelerator card is determined, the target video accelerator card is utilized to process the video task to be processed, and the processing resource of the target video accelerator card is updated to be the difference value between the current processing resource of the target video accelerator card and the processing resource required by the video task to be processed, and can also be updated to be the remaining processing resource of the candidate video accelerator card in the optimal candidate scheme.
It should be further noted that, after the target video accelerator card finishes processing the video task to be processed, the processing resource of the target video accelerator card is updated again, and the processing resource of the target video accelerator card is updated to the processing resource value before the video task is processed.
According to the video acceleration card selection method, processing resources of each video acceleration card in a plurality of video acceleration cards are acquired; receiving a video task to be processed; determining processing resources required by the video task based on the task type of the video task; acquiring a first video acceleration card set based on processing resources of each video acceleration card and processing resources required by video tasks; each video acceleration card in the first video acceleration card set is used as a candidate video acceleration card for preprocessing the video task, and then the residual processing resources after the candidate video acceleration card preprocesses the video task are predicted; generating a candidate scheme based on each candidate video accelerator card, the remaining processing resources of the candidate video accelerator cards, other video accelerator cards of the plurality of video accelerator cards except the candidate video accelerator cards, and the processing resources of the other video accelerator cards; the task processing capacity of each candidate scheme in the plurality of candidate schemes is determined, a candidate scheme with optimal task processing capacity is selected from the plurality of candidate schemes, and a candidate video acceleration card in the optimal candidate scheme is determined as a target video acceleration card for processing the video task to be processed. The automatic allocation and the automatic maintenance of the video acceleration card resources are realized, manual configuration of a user is not needed, and the development cost of the user is reduced.
In this embodiment, a video accelerator card selection method is provided, which may be used in the above mobile terminal, such as a central processing unit, a server, etc., and fig. 4 is a flowchart of a video accelerator card selection method according to an embodiment of the present invention, as shown in fig. 4, where the flowchart includes the following steps:
step S401, obtaining processing resources of each video accelerator card in the plurality of video accelerator cards. Please refer to step S301 in the embodiment shown in fig. 3 in detail, which is not described herein.
Step S402, receiving a video task to be processed. Please refer to step S302 in the embodiment shown in fig. 3 in detail, which is not described herein.
Step S403, determining processing resources required for the video task based on the task type of the video task. Please refer to step S303 in the embodiment shown in fig. 3 in detail, which is not described herein.
Step S404, acquiring a first video accelerator card set based on the processing resource of each video accelerator card of the plurality of video accelerator cards and the processing resource required by the video task.
Specifically, the step S404 includes:
Step S4041, selecting video accelerator cards with processing resources greater than or equal to those required by the video task from the plurality of video accelerator cards to form a first video accelerator card set.
And traversing each video accelerator card according to the processing resources required by the video task to be processed, assuming that the video task to be processed is issued to the nth Zhang Shipin accelerator card, judging whether the processing resources of the video accelerator card are greater than or equal to the processing resources required by the video task, if the processing resources of the video accelerator card are smaller than the processing resources required by the video task, skipping the video accelerator card, and continuing traversing the next video accelerator card until the traversing is finished, wherein the traversing times are the total number of the video accelerator cards.
And after traversing, obtaining video acceleration cards with processing resources larger than or equal to those required by the video task, and forming a first video acceleration card set.
Step S405, after each video accelerator card in the first video accelerator card set is used as a candidate video accelerator card for preprocessing a video task, predicting the remaining processing resources after the candidate video accelerator card preprocesses the video task. Please refer to step S305 in the embodiment shown in fig. 3 in detail, which is not described herein.
In step S406, a candidate solution is generated based on each candidate video accelerator card, the remaining processing resources of the candidate video accelerator cards, the other video accelerator cards other than the candidate video accelerator cards among the plurality of video accelerator cards, and the processing resources of the other video accelerator cards. Please refer to step S306 in the embodiment shown in fig. 3 in detail, which is not described herein.
Step S407, determining a task processing capability of each of the plurality of candidate schemes. Please refer to step S307 in the embodiment shown in fig. 3 in detail, which is not described herein.
Step S408, selecting a candidate scheme with optimal task processing capacity from the plurality of candidate schemes, and determining a candidate video accelerator card in the optimal candidate scheme as a target video accelerator card for processing the video task to be processed. Please refer to step S308 in the embodiment shown in fig. 3 in detail, which is not described herein.
The video accelerator card selection method provided by the embodiment realizes automatic allocation and automatic maintenance of video accelerator card resources, does not need manual configuration of users, and reduces the development cost of users.
In some alternative embodiments, the step S407 includes:
Step a1, determining the priority of each type of video task in the different types of video tasks based on the processing resources required by each type of video task in the different types of video tasks.
The different types of video tasks can be a plurality of types of video tasks which can be processed by the video accelerator card.
Step a2, determining the number of video tasks with highest processing priority of the remaining processing resources of the candidate video accelerator cards under each candidate scheme in the plurality of candidate schemes, and the number of video tasks with highest processing priority of the processing resources of other video accelerator cards except the candidate video accelerator cards in the plurality of video accelerator cards, so as to determine the total amount of the video tasks with highest processing priority under each candidate scheme.
After determining the priority of each type of video task in different types of video tasks, acquiring the sum of the number of video tasks with highest processing priority of the residual processing resources of the candidate video accelerator card and the number of video tasks with highest processing priority of the processing resources of other video accelerator cards except the candidate video accelerator card in the plurality of video accelerator cards under each candidate scheme, and processing the total number of video tasks with highest processing priority for each candidate scheme.
Step a3, determining the task processing capacity of each candidate scheme based on the total amount of the video tasks with the highest processing priority.
The more the total number of the video tasks with the highest processing priority is, the greater the task processing capacity of the corresponding candidate scheme is.
And a4, when at least two candidate schemes exist and the total amount of the video tasks with the highest processing priority is the largest, acquiring the total amount of the video tasks with the secondary priority from the candidate schemes with the highest processing priority and determining that the total amount of the video tasks with the secondary priority is the largest and the task processing capacity is the largest.
Or when the candidate solution with the largest total amount of video tasks of the secondary priority comprises at least two, further determining the total amount of video tasks of the next priority according to the sorting order of the priorities until the task processing capacity of each candidate solution is determined.
It can be understood that, in the case where the number of candidate schemes with the highest total number of video tasks with the highest processing priority is at least two, the total number of video tasks with the secondary priority in the candidate scheme with the highest total number of video tasks with the highest processing priority is compared in order of the priorities, and the candidate scheme with the highest total number of video tasks with the secondary priority is acquired, and the task processing capacity is the largest. If the scheme that handles the largest total amount of video tasks of the secondary priority includes at least two, then the total amount of video tasks of the next priority is continued to be compared in order of priority until the task processing capacity of each candidate scheme is determined.
The first video accelerator card set includes three video accelerator cards, and the three video accelerator cards are respectively used as candidate video accelerator cards to generate candidate schemes corresponding to each candidate video accelerator card.
The total amount of each candidate processing each of the different types of video tasks is obtained, wherein the video task types can comprise 720p30fps, 1080p30fps, 4k30fps, and 4k60fps, and the total amount of each of the three candidate processing each of the different types of video tasks can be shown in table 1.
TABLE 1
Wherein the total number of video tasks with highest processing priority for candidate 1 and candidate 2 is more than and the same as the total number of candidate 3, as shown in table 1, the total number of 4k60fps tasks processed by candidate 1 and candidate 2 is 1.
In the case where the candidate scheme having the largest total number of video tasks with the highest processing priority includes at least two, the total number of video tasks with secondary priority is compared between candidate scheme 1 and candidate scheme 2, that is, the total number of 4k30fps tasks is compared between candidate scheme 1 and candidate scheme 2.
As shown in table 1, the total number of 4k30fps tasks processed by candidate 1 and candidate 2 is 0, and then the total number of video tasks of the next priority processed by candidate and candidate 2, i.e., the total number of 1080p30fps tasks processed by candidate 1 and candidate 2, is continuously compared.
As shown in table 1, if candidate 1 processes more than candidate 2 processes 1080p30fps tasks, the task processing capability of candidate 1 is determined to be the largest, candidate 1 is selected as the optimal candidate, and the candidate video accelerator in candidate 1 is the target video accelerator for processing the video task to be processed.
In some optional embodiments, the step S407 further includes:
When at least two candidate schemes exist and the total amount of the video tasks with the highest processing priority is the largest, the total amount of the video tasks with other priorities except the video tasks with the highest priority in the video tasks with different types is obtained from the candidate scheme with the highest processing priority, and the total amount of the video tasks with other priorities is determined to be the largest, so that the task processing capacity is the largest.
Or when the candidate schemes with the largest total amount of the video tasks with other priorities except the video task with the highest priority in the processing of the video tasks with different types comprise two video tasks, acquiring the total amount of the video tasks with the secondary priority according to the sorting order of the priorities, and determining that the total amount of the video tasks with the secondary priority is the largest and the task processing capacity is the largest.
When the candidate scheme for processing the video tasks with the secondary priority level and the maximum total amount comprises at least two video tasks with the secondary priority level, acquiring the total amount of the video tasks with other priority levels lower than the secondary priority level according to the sorting order of the priority levels, and determining that the total amount of the video tasks with other priority levels lower than the secondary priority level is the maximum, and the task processing capacity is the maximum.
It will be appreciated that where the total number of candidates for processing video tasks of other priority than the secondary priority is at least two, the comparison continues in the manner described above until the task processing capacity of each candidate is determined.
According to the video accelerator card selection method, the automatic allocation of the video accelerator card resources is realized, the reasonable allocation of the video accelerator card resources is also realized, the processing resource allocation of the video task with high priority in the subsequent service can be ensured, the optimal use effect is achieved based on the number of the existing video accelerator cards, and the cost of the video accelerator cards is reduced.
In some alternative embodiments, step a1 includes:
and a step a11, arranging the priorities of each type of video tasks in the different types of video tasks from high to low according to the order of the processing resources required by each type of video tasks in the different types of video tasks from more to less.
The more processing resources are needed for the video task, the higher the corresponding priority.
In some alternative embodiments, the step S408 includes:
And b1, when the total amount of video tasks of any priority before each candidate scheme of the plurality of candidate schemes processes the video tasks of the ith priority is determined to be the same according to the sorting order of the priorities, selecting the candidate scheme with the largest total amount of video tasks of the ith priority as the optimal candidate scheme.
Or when at least two candidate schemes exist and the total amount of the video tasks of each priority is the same, randomly selecting one candidate scheme from the at least two candidate schemes with the same total amount of the video tasks of each priority as the optimal candidate scheme.
In some alternative embodiments, the processing resources of the video accelerator card, the remaining processing resources of the candidate video accelerator card, the processing resources required for different types of video tasks, and the processing resources required for the video task to be processed are all integer multiples of the sub-processing resources, wherein the processing resources required for the video task type with the lowest priority are sub-processing resources.
In order to solve the problem that the processing resources of the video accelerator are wasted, the processing resources required by the video task type with the lowest priority are used as sub-processing resources, that is, the processing resource value with the minimum processing resources required by the video task type is used as the sub-processing resources. The processing resources of the video accelerator card, the residual processing resources of the candidate video accelerator card, the processing resources required by different types of video tasks and the processing resources required by the video tasks to be processed are integer multiples of the sub-processing resources, so that the processing resources of the video accelerator card can be reasonably utilized, and the resource waste is avoided.
In some alternative embodiments, in the event of an initialization boot, the processing resources of each of the plurality of video accelerator cards are full.
It will be appreciated that each of the plurality of video accelerator cards has its processing resources in an unused, i.e., full, state at each initial start-up of the video accelerator card operating architecture.
According to the video accelerator card selection method, the processing resources required by the video task type with the lowest priority are used as sub-processing resources, and the processing resources of the video accelerator card, the rest processing resources of the candidate video accelerator card, the processing resources required by the video tasks with different types and the processing resources required by the video task to be processed are integer multiples of the sub-processing resources, so that the automatic allocation of the video accelerator card resources is realized, and the reasonable allocation of the video accelerator card resources is further realized.
In order to make the video accelerator card selection method provided in this embodiment clearer, an example of encoding four types of video tasks on a video accelerator card with 4 processing resources having 32 sub-processing resources is described below, where the four types of video tasks are 720p30fps, 1080p30fps, 4k30fps, and 4k60fps, respectively, and in the case that factors affecting the occupation of video codec task resources except for video resolution and video frame rate are the same, 720p30fps corresponds to 1 sub-processing resource, 1080p30fps corresponds to 2 sub-processing resources, 4k30fps corresponds to 8 sub-processing resources, and 4k60fps corresponds to 16 sub-processing resources.
The initialization function init () function initializes the processing resource data of all the video accelerator cards so that the processing resource value of each video accelerator card is 32 and the used processing resource value is 0. Task creation obtains the video accelerator card that handles the task optimally through a select_card (int needs ability _value) interface by means of a INT CREATE _task (task_struct_task) function. The select_card function traverses four video accelerator cards, calculates the residual processing resources of 4 video accelerator cards after the video task is issued to the current candidate video accelerator card, compares four schemes, compares four groups of residual processing resources, takes the scheme with the largest total number of the operable high-priority video tasks as the optimal scheme, and selects the video accelerator card in the optimal scheme for issuing the video task. After the video task is issued to the video acceleration card, the residual processing resources of the video acceleration card are reduced; video task deletion updates the processing resource value of the corresponding video accelerator card after stopping the video task through a stop_task (task_struct) function.
The embodiment also provides a video accelerator card selecting device, which is used for implementing the above embodiment and the preferred implementation, and is not described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
The embodiment provides a video accelerator card selecting device, as shown in fig. 5, including:
the processing resource obtaining module 501 is configured to obtain processing resources of each of the video accelerator cards, where the processing resources are used to process video tasks.
The video task to be processed receiving module 502 is configured to receive a video task to be processed.
The processing resource determining module 503 is configured to determine processing resources required for the video task based on the task type of the video task.
The first video accelerator card set obtaining module 504 is configured to obtain a first video accelerator card set based on processing resources of each of the plurality of video accelerator cards and processing resources required for the video task.
The remaining processing resource prediction module 505 is configured to predict, after each video accelerator card in the first video accelerator card set is used as a candidate video accelerator card for preprocessing a video task, a remaining processing resource after the candidate video accelerator card preprocesses the video task.
The candidate solution generating module 506 is configured to generate the candidate solution based on each candidate video accelerator card, remaining processing resources of the candidate video accelerator card, other video accelerator cards other than the candidate video accelerator card among the plurality of video accelerator cards, and processing resources of the other video accelerator cards.
The task processing capability determining module 507 is configured to determine a task processing capability of each candidate solution in the plurality of candidate solutions, where the task processing capability is determined by respectively processing, by remaining processing resources of the candidate video accelerator card, a number of one or more types of video tasks in different types of video tasks, and processing resources of other video accelerator cards except the candidate video accelerator card in the plurality of video accelerator cards respectively process the number of one or more types of video tasks in different types of video tasks.
The target accelerator card determining module 508 is configured to select a candidate solution with optimal task processing capability from the multiple candidate solutions, and determine a candidate video accelerator card in the optimal candidate solution as a target video accelerator card for processing a video task to be processed.
In some alternative embodiments, the first video acceleration card set acquisition module 504 includes:
The first video acceleration card set acquisition subunit is used for screening video acceleration cards with processing resources greater than or equal to those required by the video task from the plurality of video acceleration cards to form a first video acceleration card set.
In some alternative embodiments, the task processing capability determination module 507 includes:
and the task priority determining unit is used for determining the priority of each type of video task in the different types of video tasks based on the processing resources required by each type of video task in the different types of video tasks.
The task total amount determining unit is used for determining the number of video tasks with highest processing priority of the residual processing resources of the candidate video accelerator cards under each candidate scheme in the plurality of candidate schemes and the number of video tasks with highest processing priority of the processing resources of other video accelerator cards except the candidate video accelerator cards in the plurality of video accelerator cards, so as to determine the total amount of the video tasks with highest processing priority under each candidate scheme.
And a first task processing capability determining subunit, configured to determine, based on the total amount of video tasks with highest processing priority, a task processing capability of each candidate solution, where the greater the number of total amounts of video tasks with highest processing priority, the greater the task processing capability of the corresponding candidate solution.
And the second task processing capability determining subunit is used for processing the total amount of the video tasks with secondary priority from the candidate schemes with the highest processing priority when at least two candidate schemes are the most in total amount of the video tasks with the highest processing priority, and determining that the total amount of the video tasks with secondary priority is the most in total amount and the task processing capability is the greatest.
Or when the candidate solution with the largest total amount of video tasks of the secondary priority comprises at least two, further determining the total amount of video tasks of the next priority according to the sorting order of the priorities until the task processing capacity of each candidate solution.
In some alternative embodiments, the task priority determination unit includes:
And the task priority determining subunit is used for arranging the priorities of each type of video tasks in the different types of video tasks from high to low according to the order of the processing resources required by each type of video tasks in the different types of video tasks from high to low.
In some alternative embodiments, the target accelerator card determination module 508 includes:
And the optimal candidate scheme determining unit is used for selecting the candidate scheme with the largest total amount of video tasks for processing the ith priority as the optimal candidate scheme when determining that the total amount of video tasks of any priority before each candidate scheme for processing the video tasks of the ith priority is the same according to the sorting order of the priorities.
Or when at least two candidate schemes exist and the total amount of the video tasks of each priority is the same, randomly selecting one candidate scheme from the at least two candidate schemes with the same total amount of the video tasks of each priority as the optimal candidate scheme.
Further functional descriptions of the above respective modules and units are the same as those of the above corresponding embodiments, and are not repeated here.
The video accelerator card selection device in this embodiment is in the form of a functional unit, where the unit refers to an ASIC (Application SPECIFIC INTEGRATED Circuit) Circuit, a processor and a memory that execute one or more software or firmware programs, and/or other devices that can provide the above functions.
The embodiment of the invention also provides a computer device which is provided with the video acceleration card selecting device shown in the figure 5.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a computer device according to an alternative embodiment of the present invention, as shown in fig. 6, the computer device includes: one or more processors 601, memory 602, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The various components are communicatively coupled to each other using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions executing within the computer device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface. In some alternative embodiments, multiple processors and/or multiple buses may be used, if desired, along with multiple memories and multiple memories. Also, multiple computer devices may be connected, each providing a portion of the necessary operations (e.g., as a server array, a set of blade servers, or a multiprocessor system). One processor 601 is illustrated in fig. 6.
The processor 601 may be a central processor, a network processor, or a combination thereof. The processor 601 may further comprise a hardware chip, among other things. The hardware chip may be an application specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general-purpose array logic, or any combination thereof.
Wherein the memory 602 stores instructions executable by the at least one processor 601 to cause the at least one processor 601 to perform a method for implementing the embodiments described above.
The memory 602 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, at least one application program required for a function; the storage data area may store data created according to the use of the computer device, etc. In addition, the memory 602 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, memory 602 may optionally include memory located remotely from processor 601, such remote memory being connectable to the computer device through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The memory 602 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk, or solid state disk; the memory 602 may also include a combination of the types of memory described above.
The computer device also includes a communication interface 603 for the computer device to communicate with other devices or communication networks.
The embodiments of the present invention also provide a computer readable storage medium, and the method according to the embodiments of the present invention described above may be implemented in hardware, firmware, or as a computer code which may be recorded on a storage medium, or as original stored in a remote storage medium or a non-transitory machine readable storage medium downloaded through a network and to be stored in a local storage medium, so that the method described herein may be stored on such software process on a storage medium using a general purpose computer, a special purpose processor, or programmable or special purpose hardware. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, a solid state disk or the like; further, the storage medium may also comprise a combination of memories of the kind described above. It will be appreciated that a computer, processor, microprocessor controller or programmable hardware includes a storage element that can store or receive software or computer code that, when accessed and executed by the computer, processor or hardware, implements the methods illustrated by the above embodiments.
Although embodiments of the present invention have been described in connection with the accompanying drawings, various modifications and variations may be made by those skilled in the art without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope of the invention as defined by the appended claims.
Claims (10)
1. A method for selecting a video accelerator card, the method comprising:
acquiring processing resources of each video acceleration card in a plurality of video acceleration cards, wherein the processing resources are used for processing video tasks;
Receiving a video task to be processed;
determining processing resources required by the video task based on the task type of the video task;
Acquiring a first video acceleration card set based on processing resources of each video acceleration card and processing resources required by the video task in a plurality of video acceleration cards;
Each video acceleration card in the first video acceleration card set is used as a candidate video acceleration card for preprocessing the video task, and then the residual processing resources after the candidate video acceleration card preprocesses the video task are predicted;
generating a candidate scheme based on each candidate video accelerator card, the remaining processing resources of the candidate video accelerator cards, other video accelerator cards except the candidate video accelerator cards in the plurality of video accelerator cards, and the processing resources of the other video accelerator cards;
Determining task processing capacity of each candidate scheme in a plurality of candidate schemes, wherein the task processing capacity is used for respectively processing the number of one or more types of video tasks in different types of video tasks through the residual processing resources of the candidate video accelerator cards, and determining the number of one or more types of video tasks in different types of video tasks through the processing resources of other video accelerator cards except the candidate video accelerator cards in the plurality of video accelerator cards;
and selecting a candidate scheme with optimal task processing capacity from the plurality of candidate schemes, and determining a candidate video acceleration card in the optimal candidate scheme as a target video acceleration card for processing the video task to be processed.
2. The method of claim 1, wherein the obtaining a first set of video accelerator cards based on processing resources of each of the plurality of video accelerator cards and processing resources required for the video task comprises:
And selecting video accelerator cards with processing resources larger than or equal to the processing resources required by the video task from the video accelerator cards to form the first video accelerator card set.
3. The method of claim 1, wherein said determining task processing capabilities of each of a plurality of said candidates comprises:
Determining the priority of each type of video task in the different types of video tasks based on the processing resources required by each type of video task in the different types of video tasks;
Determining the number of video tasks with highest priority processed by the residual processing resources of the candidate video accelerator cards under each candidate scheme in a plurality of candidate schemes, and the number of video tasks with highest priority processed by the processing resources of other video accelerator cards except the candidate video accelerator cards in the plurality of video accelerator cards, so as to determine the total amount of the video tasks with highest priority processed under each candidate scheme;
determining the task processing capacity of each candidate scheme based on the total amount of the video tasks with the highest priority, wherein the more the total amount of the video tasks with the highest priority is processed, the greater the task processing capacity of the corresponding candidate scheme is;
When at least two candidate schemes exist and the total amount of the video tasks with the highest processing priority is the largest, acquiring the total amount of the video tasks with the secondary priority from the candidate scheme with the highest processing priority and determining that the total amount of the video tasks with the secondary priority is the largest and the task processing capacity is the largest;
Or when the candidate solution with the largest total amount of video tasks of the secondary priority comprises at least two, further determining the total amount of video tasks of the next priority according to the sorting order of the priorities until the task processing capacity of each candidate solution is determined.
4. The method of claim 3, wherein determining the priority of each of the different types of video tasks based on the processing resources required for each of the different types of video tasks comprises:
And arranging the priorities of each type of video tasks from high to low according to the order of the processing resources required by each type of video tasks.
5. A method according to claim 3, wherein said selecting a candidate with optimal task processing power from a plurality of said candidates comprises:
when the total amount of video tasks of any priority before each candidate scheme of the plurality of candidate schemes processes the video tasks of the ith priority is determined to be the same according to the sorting order of the priorities, selecting the candidate scheme with the largest total amount of video tasks of the ith priority as the optimal candidate scheme;
or when at least two candidate schemes exist and the total amount of the video tasks of each priority is the same, randomly selecting one candidate scheme from at least two candidate schemes with the same total amount of the video tasks of each priority as the optimal candidate scheme.
6. A method according to claim 3, wherein the processing resources of the video accelerator card, the remaining processing resources of the candidate video accelerator card, the processing resources required for the different types of video tasks and the processing resources required for the video tasks to be processed are all integer multiples of sub-processing resources, wherein the processing resources required for the video task type with the lowest priority are the sub-processing resources.
7. The method of claim 1, wherein, in the event of an initialization boot, processing resources of each of the plurality of video accelerator cards are full.
8.A video accelerator card selection apparatus, the apparatus comprising:
The processing resource acquisition module is used for acquiring the processing resource of each video acceleration card in the plurality of video acceleration cards, and the processing resource is used for processing video tasks;
The video task receiving module is used for receiving the video task to be processed;
The processing resource determining module is used for determining processing resources required by the video task based on the task type of the video task;
The first video acceleration card set acquisition module is used for acquiring a first video acceleration card set based on the processing resources of each video acceleration card in the plurality of video acceleration cards and the processing resources required by the video task;
the residual processing resource prediction module is used for predicting the residual processing resources of the video task preprocessed by the candidate video accelerator after each video accelerator in the first video accelerator set is used as the candidate video accelerator for preprocessing the video task;
a candidate solution generating module, configured to generate a candidate solution based on each of the candidate video accelerator cards, remaining processing resources of the candidate video accelerator cards, other video accelerator cards except the candidate video accelerator cards in the plurality of video accelerator cards, and processing resources of the other video accelerator cards;
A task processing capability determining module, configured to determine a task processing capability of each candidate solution in the plurality of candidate solutions, where the task processing capability is configured to process, by using remaining processing resources of the candidate video accelerator card, a number of one or more types of video tasks in different types of video tasks, and determine a number of one or more types of video tasks in different types of video tasks, where processing resources of other video accelerator cards in the plurality of video accelerator cards except the candidate video accelerator card;
And the target accelerating card determining module is used for selecting a candidate scheme with optimal task processing capacity from a plurality of candidate schemes, and determining a candidate video accelerating card in the optimal candidate scheme as a target video accelerating card for processing the video task to be processed.
9. A computer device, comprising:
A memory and a processor, the memory and the processor being communicatively connected to each other, the memory having stored therein computer instructions, the processor executing the computer instructions to perform the video accelerator card selection method of any one of claims 1 to 7.
10. A computer-readable storage medium having stored thereon computer instructions for causing a computer to perform the video accelerator card selection method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410234080.0A CN118132258A (en) | 2024-02-29 | 2024-02-29 | Video acceleration card selection method and device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410234080.0A CN118132258A (en) | 2024-02-29 | 2024-02-29 | Video acceleration card selection method and device, computer equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118132258A true CN118132258A (en) | 2024-06-04 |
Family
ID=91233622
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410234080.0A Pending CN118132258A (en) | 2024-02-29 | 2024-02-29 | Video acceleration card selection method and device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118132258A (en) |
-
2024
- 2024-02-29 CN CN202410234080.0A patent/CN118132258A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP7191240B2 (en) | Video stream decoding method, device, terminal equipment and program | |
US9979979B2 (en) | Image coding apparatus, method for coding image, program therefor, image decoding apparatus, method for decoding image, and program therefor | |
US8705616B2 (en) | Parallel multiple bitrate video encoding to reduce latency and dependences between groups of pictures | |
US11563961B2 (en) | Load balancing method for video decoding in a system providing hardware and software decoding resources | |
WO2000036584A1 (en) | Methods and apparatus for rendering multiple images using a limited rendering resource | |
US10200716B2 (en) | Parallel intra-prediction encoding/decoding process utilizing PIPCM and/or PIDC for selected sections | |
CN106717007B (en) | Cloud end streaming media server | |
Hegazy et al. | Content-aware video encoding for cloud gaming | |
US20230127325A1 (en) | Load balancing method for video decoding in a system providing hardware and software decoding resources | |
CN113473148A (en) | Computing system for video coding and video coding method | |
WO2024183682A1 (en) | Video coding method and apparatus, and electronic device, storage medium and program product | |
CN114339412B (en) | Video quality enhancement method, mobile terminal, storage medium and device | |
CN116483587B (en) | Video super-division parallel method, server and medium based on image segmentation | |
US20170185455A1 (en) | Scheduler of computer processes for optimized offline video processing | |
CN110602505A (en) | Video transcoding method and device based on multiple GPUs | |
CN118132258A (en) | Video acceleration card selection method and device, computer equipment and storage medium | |
CN113014921A (en) | Method, device and equipment for scheduling encoder | |
CN111510715B (en) | Video processing method, system, computer device and storage medium | |
CN116567247A (en) | Video encoding method, real-time communication method, device, equipment and storage medium | |
CN110969672A (en) | Image compression method and device | |
US20240214583A1 (en) | Video surveillance system having a load distribution module | |
US20240314292A1 (en) | Video coding method and apparatus, computing device, storage medium, and program product | |
CN118118683B (en) | Short video quick transcoding method system | |
US20220021888A1 (en) | Systems and methods to encode regions-of-interest based on video content detection | |
US10582207B2 (en) | Video processing systems |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |