Image rendering task scheduling method and device based on load balancing
By calculating the rendering load of the target frame image and scheduling rendering tasks according to the load status, the problem of uneven rendering task load in the cloud rendering system is solved, and the overall efficiency and resource utilization of the rendering system are improved.
Patent Information
- Application Number
- CN202410663857.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-27
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-05-27
AI Technical Summary
A single GPU hardware on the user side cannot support complex image rendering performance requirements, resulting in limited rendering speed. Although the existing cloud rendering system improves the rendering speed, it is difficult to achieve load balancing of rendering tasks, resulting in low resource utilization efficiency.
By obtaining the material complexity and operation complexity of the target frame image, the rendering load is calculated, and scheduled according to the rendering load and the task load value of the rendering module. The rendering task is scheduled to the rendering module with the smallest load or the smallest load variance for rendering processing. Monitor and adjust task load in real time, and use linear regression to optimize coefficients to balance rendering load.
It achieves load balancing of rendering tasks, improves the overall task processing efficiency of the rendering system, and improves resource utilization and rendering speed.
Smart Images

Figure CN118245230B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for scheduling image rendering tasks based on load balancing. Background Art
[0002] Image rendering technology is the process of converting three-dimensional light energy transfer processing into a two-dimensional image. Scenes and entities are represented in three-dimensional form, which is closer to the real world and easier to manipulate and transform. However, most graphic display devices are two-dimensional rasterized displays and dot matrix printers. By using image rendering technology, three-dimensional images can be clearly presented on the display device to meet the image display needs of various scenes, such as VR, games, industrial modeling, CG video production, etc.
[0003] In order to present real scenes more vividly, rendering scenes and model construction are becoming more and more complex, resulting in higher and higher complexity of image rendering. Single GPU hardware on the user side is difficult to support such large-scale image rendering performance requirements. With the rapid development of cloud computing technology and the evolution of cloud rendering / rendering farm technology, a cloud rendering system has emerged. Users only need to build the rendering task on the local side in advance, and then submit the rendering task to the cloud, while the final time-consuming image rendering operation is performed by the cloud rendering server. The cloud rendering server is equipped with powerful CPU, GPU and other hardware resources, which greatly accelerates the image rendering operation. Finally, the rendered image is sent to the user side. Through the cloud rendering system, the user side no longer needs a GPU hardware environment, and the rendering speed is greatly improved. Summary of the invention
[0004] The embodiments of the present disclosure provide a method, device, electronic device and storage medium for scheduling image rendering tasks based on load balancing.
[0005] According to a first aspect of an embodiment of the present disclosure, a method for scheduling image rendering tasks based on load balancing is provided, comprising: obtaining the material complexity of a target frame image; the material complexity at least includes: a primitive size; and texture scale ; Obtain the operation complexity of the target frame image ; According to the complexity of the material and the complexity of the operation , calculate the rendering load of the target frame image , the corresponding formula is as follows: ;in, is the material complexity coefficient, is the operation complexity coefficient, is the primitive scale factor, is the texture scale factor; obtain the task load value of each rendering module ; According to the rendering load of the target frame image and the task load value of each rendering module , dispatching the rendering task of the target frame image to the target rendering module for rendering processing.
[0006] In some exemplary embodiments of the present disclosure, the obtaining of the material complexity of the target frame image further includes: obtaining the number of vertices and primitive types of the target frame image; and calculating the primitive scale of the target frame image according to the number of vertices and primitive types. .
[0007] In some exemplary embodiments of the present disclosure, the texture scale It is positively correlated with the image size of the target frame image.
[0008] In some exemplary embodiments of the present disclosure, the complexity of the operation of acquiring the target frame image is , further comprising: obtaining a preset rendering processing step of the target frame image; determining the operation complexity of the target frame image according to the preset rendering processing step; .
[0009] In some exemplary embodiments of the present disclosure, the method further includes: obtaining the number of times the target frame image is drawn ; According to the complexity of the material and the complexity of the operation , calculate the rendering load of the target frame image , the corresponding formula is as follows: ;in, is the complexity of the i-th drawing operation, is the scale of the primitive drawn for the i-th time, The texture scale for the i-th drawing.
[0010] In some exemplary embodiments of the present disclosure, the rendering load according to the target frame image and the task load value of each rendering module , dispatching the rendering task of the target frame image to the target rendering module for rendering processing, and also comprising: comparing the task load values of the respective rendering modules ; The task load value The smallest rendering module is determined as the target rendering module; and the rendering task of the target frame image is dispatched to the target rendering module for rendering processing.
[0011] In some exemplary embodiments of the present disclosure, the rendering load according to the target frame image and the task load value of each rendering module , dispatching the rendering task of the target frame image to the target rendering module for rendering processing, and further comprising: dispatching the rendering task of the target frame image to the target rendering module according to the task load value of each rendering module , calculate the average task load value of each rendering module ; The rendering load of the target frame image Add each rendering module separately and calculate the task load variance of the rendering module after adding , the corresponding formula is as follows: ;in, is the number of rendering modules, is the task load value of the i-th rendering module; the task load variance The smallest rendering module is determined as the target rendering module; and the rendering task of the target frame image is dispatched to the target rendering module for rendering processing.
[0012] In some exemplary embodiments of the present disclosure, the method further includes: in response to dispatching the rendering task of the target frame image to the target rendering module, according to the rendering load of the target frame image , the task load value of the target rendering module to update.
[0013] In some exemplary embodiments of the present disclosure, the method further includes: obtaining the rendering task execution time of each of the target frame images; and calculating the rendering load of each of the target frame images based on the rendering load of each of the target frame images. and the rendering task execution time, and perform data statistics; according to the data statistics, the material complexity coefficient is calculated by linear regression method , Operational complexity coefficient , Element scale factor and texture scale factor At least one coefficient in is adjusted.
[0014] According to a second aspect of an embodiment of the present disclosure, a device for scheduling image rendering tasks based on load balancing is provided, comprising: a material complexity acquisition module configured to acquire material complexity of a target frame image; the material complexity at least includes: a primitive size and texture scale ; An operation complexity acquisition module configured to acquire the operation complexity of the target frame image ; A rendering load calculation module is configured to calculate the rendering load according to the complexity of the material and the complexity of the operation , calculate the rendering load of the target frame image , the corresponding formula is as follows: ;in, is the material complexity coefficient, is the operation complexity coefficient, is the primitive scale factor, is the texture scale factor; a task load value acquisition module is configured to obtain the task load value of each rendering module ; A task scheduling module is configured to schedule the rendering load of the target frame image according to the and the task load value of each rendering module , dispatching the rendering task of the target frame image to the target rendering module for rendering processing.
[0015] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, comprising: one or more processors; and a storage device configured to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any one of the load balancing-based image rendering task scheduling methods.
[0016] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute any one of the load balancing-based image rendering task scheduling methods.
[0017] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program / signaling, characterized in that when the computer program / signaling is executed by a processor, the image rendering task scheduling method based on load balancing as described in the above embodiment is implemented.
[0018] The image rendering task scheduling method based on load balancing provided by the embodiment of the present disclosure calculates the rendering load of the target frame image by obtaining the material complexity and operation complexity of the target frame image; according to the rendering load of the target frame image and the task load value of each rendering module, the rendering task of the target frame image is scheduled to the target rendering module for rendering processing. This method can estimate the rendering load of the target frame image based on the material complexity and operation complexity of the target frame image, and at the same time, monitor the task load value of each rendering module in real time based on the rendering load of each image to be rendered. Based on this, according to the task load status of each rendering module, the rendering task of the target frame image is selected to be scheduled to the appropriate target rendering module for rendering processing, thereby realizing balanced rendering task scheduling based on the load of each rendering module, which greatly improves the overall task processing efficiency of the rendering system.
[0019] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0021] Figure 1 A schematic diagram of a cloud-based image rendering system architecture to which the embodiments of the present disclosure can be applied is shown.
[0022] Figure 2 The figure is a flow chart of a method for scheduling image rendering tasks based on load balancing according to an exemplary embodiment.
[0023] Figure 3 The process of the method for scheduling the rendering task of the target frame image according to an example is shown Figure 1 .
[0024] Figure 4 The process of the method for scheduling the rendering task of the target frame image according to an example is shown Figure 2 .
[0025] Figure 5 The present invention is a flowchart of a coefficient regression adjustment method in rendering task scheduling according to an example.
[0026] Figure 6 The figure is a block diagram of a device for scheduling image rendering tasks based on load balancing according to an exemplary embodiment.
[0027] Figure 7 It is a schematic diagram showing the structure of an electronic device suitable for implementing the exemplary embodiments of the present disclosure according to an exemplary embodiment. DETAILED DESCRIPTION
[0028] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.
[0029] The features, structures or characteristics described in the present disclosure may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the present disclosure.
[0030] The accompanying drawings are only schematic diagrams of the present disclosure, and the same reference numerals in the drawings represent the same or similar parts, so their repeated description will be omitted. Some block diagrams shown in the accompanying drawings do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in at least one hardware module or integrated circuit, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0031] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and steps, nor must they be executed in the order described. For example, some steps can be decomposed, and some steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0032] In this specification, the terms "a", "an", "the", "said" and "at least one" are used to indicate the presence of at least one element / component / etc.; the terms "comprising", "including" and "having" are used to express an open-ended inclusion and mean that additional elements / components / etc. may exist in addition to the listed elements / components / etc.; the terms "first", "second" and "third" etc. are used only as labels and are not intended to limit the quantity of their objects.
[0033] Figure 1 A schematic diagram of a cloud-based image rendering system architecture to which the embodiments of the present disclosure can be applied is shown.
[0034] like Figure 1 As shown in FIG. 1 , the system architecture is a distributed architecture based on cloud computing technology, which consists of multiple physical servers, each of which is equipped with at least one GPU (graphics processing unit) hardware. These physical servers are connected to each other through the network and work together to complete the image rendering task.
[0035] The client plays the role of the user interface in the cloud image rendering system. It allows users to upload images to be rendered, submit image rendering tasks, and set corresponding rendering parameters. Once the rendering is completed, the client will also receive and display the rendering results from the cloud, realizing the whole process interaction from demand proposal to result delivery.
[0036] In the cloud rendering environment, there are two core modules: management module and rendering module. The management module is the core of the entire system. Its main responsibility is to receive the user's rendering request from the client and parse it to understand its specific needs. Then, based on these needs, the management module will assign the rendering task to the appropriate GPU node for processing. The benefit of this is that the computing power of each GPU node can be fully utilized to improve the overall rendering efficiency.
[0037] The rendering module is the part that actually performs image rendering operations. They receive specific rendering tasks from the management module and use their own GPU resources to perform image processing. When the rendering is completed, the rendering module returns the result to the management module, which then passes it back to the client.
[0038] Users only need to build the rendering task in advance on the local side, and then submit the rendering task to the cloud, and the final time-consuming image rendering operation is performed by the cloud rendering server. Through the cloud rendering system, the user side no longer needs a GPU hardware environment, and the rendering speed is greatly improved.
[0039] Below, each step of the method in the exemplary embodiment of the present disclosure will be described in more detail with reference to the accompanying drawings and embodiments.
[0040] Figure 2 The figure is a flow chart of a method for scheduling image rendering tasks based on load balancing according to an exemplary embodiment. Figure 2 The method provided in the embodiment can be carried out by the above Figure 1 The management module in the embodiment is executed, but the present disclosure does not limit this. Figure 2 As shown, the image rendering task scheduling method based on load balancing includes:
[0041] In step S210, the material complexity of the target frame image is obtained; the material complexity at least includes: the size of the primitive and texture scale .
[0042] In the disclosed embodiment, Figure 1The client shown receives the image to be rendered uploaded by the user and submits the image rendering task. The client splits the image rendering task according to the frame granularity and distributes it according to the image rendering task per frame. Among them, the image corresponding to each frame image rendering task is the target frame image. It should be pointed out that according to different actual task splitting requirements, the image to be rendered can also be split according to other granularities, which should also be within the scope of protection of the present invention.
[0043] According to the target frame image, the material complexity of the target frame image is obtained. The material complexity is used to represent the diversity and detail richness of the elements in the target frame image. The material complexity can be used to measure the difficulty of image processing or rendering of the target frame image itself. The material complexity at least includes: the size of the primitives and texture scale . Among them, primitive scale refers to the number of basic graphic elements that make up the image. These elements can be points, lines, surfaces, etc. The more primitives there are, the more complex the image structure is. Texture scale refers to the visual characteristics of the surface structure in the image, including the type, detail level and distribution of the texture. A high texture scale means that the image has more diverse or finer surface textures and patterns.
[0044] In an exemplary embodiment, the primitive size It can be obtained by the following method:
[0045] Get the number of vertices and primitive types of the target frame image;
[0046] According to the number of vertices and primitive type, calculate the primitive scale of the target frame image .
[0047] Images are usually composed of several points, lines, faces and other primitives. The primitives in these images are constructed by several vertices. According to the number of vertices and primitive types included in the image, the primitive scale of the image can be calculated. For example, the image includes 30,000 vertices, and the corresponding primitive type is triangle, that is, the image is constructed by triangle primitives, including 30,000 vertices in total. Since a triangle primitive includes three vertices. Therefore, it can be calculated that the primitive scale of the image is 10,000 triangle primitives.
[0048] In an exemplary embodiment, the texture scale It is usually positively correlated with the image size, that is, the texture scale can be calculated based on the image size and the preset texture coefficient. For example, the size of the target frame image is 1MB, and the texture coefficient is 1. Therefore, the texture scale of the target frame image is 1024.
[0049] In step S220, the operation complexity of the target frame image is obtained. .
[0050] In the disclosed embodiment, the same image rendering task may include multiple rendering steps such as depth test, template test, and blend test. Among them, the depth test determines the visibility of the pixel; the template test controls the pixel drawing based on specific conditions, and the blend test processes the pixel color superposition to achieve transparent or semi-transparent effects. Since different image rendering tasks perform different rendering processing operations on the image, it is necessary to further obtain the operation complexity corresponding to the target frame image. . You can do this by following these steps:
[0051] Obtain preset rendering processing steps for the target frame image.
[0052] According to the preset rendering processing steps, the operation complexity of the target frame image is determined .
[0053] The operation complexity is used to indicate the complexity of the rendering operation required for the image rendering task. By obtaining the image rendering task corresponding to the target frame image, the operation complexity of the task can be quantified to obtain the operation complexity .
[0054] In step S230, according to the complexity of the material and the complexity of the operation , calculate the rendering load of the target frame image , the corresponding formula is as follows:
[0055]
[0056] in, is the material complexity coefficient, is the operation complexity coefficient, is the primitive scale factor, is the texture scale factor.
[0057] In the embodiment of the present disclosure, according to the material complexity and operation complexity of the target frame image obtained in the aforementioned steps S210 and S220, , calculate the rendering load of the target frame image The rendering load is used to comprehensively measure the processing load of the image rendering task on the rendering module based on the material complexity and operation complexity. It can be calculated by the following formula:
[0058]
[0059] in, is the material complexity coefficient, is the operation complexity coefficient, is the primitive scale factor, is the texture scale coefficient. The above coefficients are pre-set coefficients used to adjust the scale of the primitives. , Texture Scale and operational complexity , when calculating the rendering load The weight coefficient in .
[0060] In an exemplary embodiment, the above-mentioned coefficients are not fixed values, but can be dynamically adjusted according to different rendering task requirements and the current load conditions of each rendering module.
[0061] In an exemplary embodiment, the target frame image 1 includes 30,000 vertices, and the corresponding primitive type is a triangle. According to the above method, the primitive scale of the target frame image 1 is calculated to be 10,000 triangle primitives. The size of the target frame image 1 is 1MB, and the texture coefficient is 1. According to the above method, the texture scale of the target frame image 1 is calculated to be 1024. The operation complexity of the target frame image 1 is determined according to the rendering task of the target frame image 1. is 1. Assume that the material complexity coefficient , operation complexity coefficient , the primitive scale factor , texture scale factor According to the above-obtained parameters, the rendering load of the target frame image 1 is calculated. It is 8268.
[0062] The rendering load , which means that when the rendering task of the target frame image is assigned to a rendering module, the increased processing pressure on the rendering module.
[0063] In an exemplary embodiment, during the image rendering task processing, multiple rounds of drawing are usually used for rendering processing. First, basic rendering is performed, and then advanced effects such as shadows, reflections, gloss, etc. are applied in each subsequent round. Each round may involve operations such as depth testing, template testing, and blending to ensure that details are accurately superimposed. In this way, layers are superimposed and the final image is gradually constructed through multiple loop iterations. For this image rendering method, the aforementioned method for calculating the rendering load of the target frame image can also include the following steps.
[0064] Get the number of times the target frame image is drawn ;
[0065] According to the complexity of the material and the complexity of the operation , calculate the rendering load of the target frame image , the corresponding formula is as follows:
[0066]
[0067] in, is the complexity of the i-th drawing operation, is the scale of the primitive drawn for the i-th time, The texture scale for the i-th drawing.
[0068] In this exemplary embodiment, the number of times the target frame image is drawn is obtained. And for each drawing, the corresponding operation complexity, primitive scale, and texture scale are obtained respectively. Then, referring to the aforementioned formula for calculating the rendering load of the target frame image, each drawing is calculated and summed to obtain the rendering load of the target frame image. By calculating the rendering load of the target frame image in this way, the rendering load of each drawing can be more accurately measured, and the rendering load of the overall rendering task of the target frame image can be estimated more accurately.
[0069] In step S240, the task load value of each rendering module is obtained. .
[0070] In the disclosed embodiment, Figure 1 The management module shown monitors the task load value of each rendering module in the cloud image rendering system in real time. The task load value is used to represent the total rendering load value of the image rendering tasks that have been assigned to the rendering module and have not been processed.
[0071] According to the disclosed embodiment, each image rendering task needs to go through the aforementioned steps S210-S230 to calculate the rendering load corresponding to the target frame image. When the corresponding image rendering task is assigned to a certain rendering module, or when the rendering module completes a certain image rendering task, the task load value of the rendering module needs to be updated. The management module monitors the task load value of each rendering module in real time to provide reasonable task scheduling for each rendering module.
[0072] For example, the cloud image rendering system currently has rendering module 1, rendering module 2, and rendering module 3. The management module monitors that the current task load values of rendering module 1, rendering module 2, and rendering module 3 are 5000, 10000, and 15000 respectively.
[0073] In step S250, according to the rendering load of the target frame image and the task load value of each rendering module , dispatching the rendering task of the target frame image to the target rendering module for rendering processing.
[0074] In the embodiment of the present disclosure, the rendering load of the target frame image obtained according to the above steps is And the task load value of each rendering module , according to the task load status of each rendering module, the rendering task of the target frame image can be selected and dispatched to a suitable target rendering module for rendering processing.
[0075] In an exemplary embodiment, after the management module dispatches the rendering task of the target frame image to the target rendering module, it further schedules the rendering task of the target frame image according to the rendering load of the target frame image. , the task load value of the target rendering module The task load value of the target rendering module is updated, and other image rendering tasks can be scheduled based on the updated task load value.
[0076] For example, the rendering load of the aforementioned target frame image 1 is 8268. The current task load values of rendering module 1, rendering module 2, and rendering module 3 are 5000, 10000, and 15000, respectively. Assume that the management module dispatches the rendering task of the target frame image 1 to rendering module 1 for processing. In response to dispatching the rendering task of the target frame image 1 to rendering module 1, the task load value of rendering module 1 is updated to 13268.
[0077] The image rendering task scheduling method based on load balancing provided by the embodiment of the present disclosure calculates the rendering load of the target frame image by obtaining the material complexity and operation complexity of the target frame image; according to the rendering load of the target frame image and the task load value of each rendering module, the rendering task of the target frame image is scheduled to the target rendering module for rendering processing. This method can estimate the rendering load of the target frame image based on the material complexity and operation complexity of the target frame image, and at the same time, monitor the task load value of each rendering module in real time based on the rendering load of each image to be rendered. Based on this, according to the task load status of each rendering module, the rendering task of the target frame image is selected to be scheduled to the appropriate target rendering module for rendering processing, thereby realizing balanced rendering task scheduling based on the load of each rendering module, which greatly improves the overall task processing efficiency of the rendering system.
[0078] Figure 3 The process of the method for scheduling the rendering task of the target frame image according to an example is shown Figure 1 .like Figure 3 As shown, in the aforementioned step S250, the rendering load of the target frame image is and the task load value of each rendering module , dispatching the rendering task of the target frame image to the target rendering module for rendering processing, may also include the following steps.
[0079] In step S310, compare the task load values of the rendering modules .
[0080] In the embodiment of the present disclosure, the task load values of each rendering module obtained by the management module are A direct comparison is performed, and the rendering task of the target frame image is scheduled based on the task load value of each rendering module.
[0081] In step S320, the task load value The smallest rendering module is determined as the target rendering module.
[0082] In the disclosed embodiment, based on the comparison of the task load values of the rendering modules in the aforementioned step S310, the rendering module with the smallest task load value is determined as the target rendering module. In this way, the load pressure of each rendering module can be balanced according to the task load value of each rendering module.
[0083] In an exemplary embodiment, the aforementioned cloud image rendering system includes rendering module 1, rendering module 2, and rendering module 3, and the current task load values are 5000, 10000, and 15000 respectively. According to the current task load values of each rendering module, the rendering module 1 with the smallest task load value is used as the target rendering module.
[0084] In step S330, the rendering task of the target frame image is dispatched to the target rendering module for rendering processing.
[0085] In the disclosed embodiment, according to the target rendering module determined in the aforementioned step S320, the rendering task of the target frame image is dispatched to the target rendering module for rendering processing.
[0086] The image rendering task scheduling method based on load balancing provided by the embodiment of the present disclosure selects the rendering module with the smallest task load value as the target rendering module. In this way, the load pressure of each rendering module can be balanced according to the task load value of each rendering module, so that the rendering task of the target frame image is scheduled to the appropriate target rendering module for rendering processing, which greatly improves the overall task processing efficiency of the rendering system.
[0087] Figure 4 The process of the method for scheduling the rendering task of the target frame image according to an example is shown Figure 2 .like Figure 4 As shown, in the aforementioned step S250, the rendering load of the target frame image is and the task load value of each rendering module , dispatching the rendering task of the target frame image to the target rendering module for rendering processing, may also include the following steps.
[0088] In step S410, according to the task load values of the respective rendering modules, , calculate the average task load value of each rendering module .
[0089] In the embodiment of the present disclosure, the task load value of each rendering module is obtained by the management module. , calculate the average task load value of each rendering module .
[0090] In step S420, the rendering load of the target frame image is Add each rendering module separately and calculate the task load variance of the rendering module after adding , the corresponding formula is as follows:
[0091]
[0092] in, is the number of rendering modules, is the task load value of the i-th rendering module.
[0093] In step S430, the task load variance The smallest rendering module is determined as the target rendering module.
[0094] In the embodiment of the present disclosure, based on the task load variance of each rendering module in the aforementioned step S420, The comparison of task load variance The smallest rendering module is determined as the target rendering module. In this way, the load pressure of each rendering module can be balanced according to the task load variance of each rendering module.
[0095] In an exemplary embodiment, the rendering load of the aforementioned target frame image 1 is 8268. The current task load values of rendering module 1, rendering module 2, and rendering module 3 are 5000, 10000, and 15000, respectively. According to the aforementioned task load variance formula, the task load variance corresponding to rendering module 1 is 11893275, the task load variance corresponding to rendering module 2 is 39453275, and the task load variance corresponding to rendering module 3 is 67013275. According to the current task load variance of each rendering module, the rendering module 1 with the smallest task load variance is used as the target rendering module.
[0096] In step S440, the rendering task of the target frame image is dispatched to the target rendering module for rendering processing.
[0097] In the disclosed embodiment, according to the target rendering module determined in the aforementioned step S430, the rendering task of the target frame image is dispatched to the target rendering module for rendering processing.
[0098] The image rendering task scheduling method based on load balancing provided by the disclosed embodiment compares the task load variances of various rendering modules and selects the rendering module with the smallest task load variance as the target rendering module. In this way, the load pressure of each rendering module can be balanced according to the task load value of each rendering module, so that the rendering task of the target frame image is scheduled to the appropriate target rendering module for rendering processing, which greatly improves the overall task processing efficiency of the rendering system.
[0099] Figure 5 FIG. 1 is a flowchart of a coefficient regression adjustment method in rendering task scheduling according to an example. Figure 5 As shown, the image rendering task scheduling method based on load balancing may further include the following steps.
[0100] In step S510, the rendering task execution time of each of the target frame images is obtained.
[0101] In the embodiment of the present disclosure, as mentioned above, the material complexity coefficient can be adjusted according to different rendering task requirements and the current load conditions of each rendering module. , operation complexity coefficient , the primitive scale factor , texture scale factor Dynamically adjust the rendering load of the target frame image , so that the calculation result of the rendering load can effectively balance the load of each rendering module. Based on this, the present disclosure is further designed with a feedback mechanism, which dynamically adjusts the above coefficients by recording the rendering load of each frame image and the execution time of the actual rendering task.
[0102] In the embodiment of the present disclosure, in response to the completion of the rendering task of the target frame image, the rendering task execution time of each target frame image is obtained. The rendering task execution time is used to indicate the actual task execution time of the rendering task of the target frame image in the assigned rendering module.
[0103] In step S520, based on the rendering load of each of the target frame images And the execution time of the rendering task, and perform data statistics.
[0104] In the embodiment of the present disclosure, by recording the rendering load of each target frame image The corresponding rendering task execution time is used to perform data statistics. The data statistics can use any existing data statistics and analysis methods, which are not limited here.
[0105] In step S530, the material complexity coefficient is calculated by linear regression method according to the data statistics. , Operational complexity coefficient , Element scale factor and texture scale factor At least one coefficient in is adjusted.
[0106] In the embodiment of the present disclosure, data analysis is performed on the data statistics of the preset statistical period, and then the material complexity coefficient is calculated. , Operational complexity coefficient , Element scale factor and texture scale factor At least one coefficient in is adjusted.
[0107] In an exemplary embodiment, the data analysis uses a linear regression method to analyze the data collected in step S520. The linear regression method is a statistical analysis method that uses regression analysis in mathematical statistics to determine the quantitative relationship between two or more variables that are interdependent. It is used to establish a linear relationship model between a dependent variable and one or more independent variables, and to estimate the best fit line by minimizing the sum of squared errors, thereby predicting the value of a continuous target variable. In this embodiment, a linear relationship model is established between the rendering load of each target frame image and the rendering task execution time, and the above-mentioned material complexity coefficient is calculated based on the actual task execution time. , Operational complexity coefficient , Element scale factor and texture scale factor At least one coefficient in is adjusted so that the relationship between the rendering load and the rendering task execution time tends to be linear.
[0108] The image rendering task scheduling method based on load balancing provided by the embodiment of the present disclosure performs data statistics by recording the image rendering load of each target frame and the corresponding rendering task execution time, and uses a linear regression method to analyze the statistical data. , Operational complexity coefficient , Element scale factor and texture scale factor At least one coefficient in is adjusted so that the rendering load and the rendering task execution time tend to be in a linear relationship, thereby further optimizing the load balancing effect of the task scheduling method.
[0109] The following are embodiments of the device disclosed herein, which can be used to execute the method embodiments disclosed herein. For details not disclosed in the device embodiments disclosed herein, please refer to the method embodiments disclosed herein.
[0110] Figure 6 FIG. 1 is a block diagram of a device for scheduling image rendering tasks based on load balancing according to an exemplary embodiment. Figure 6 The device 600 may include: a material complexity acquisition module 610, an operation complexity acquisition module 620, a rendering load calculation module 630, a task load value acquisition module 640 and a task scheduling module 650.
[0111] The material complexity acquisition module 610 is configured to acquire the material complexity of the target frame image; the material complexity at least includes: the size of the primitive and texture scale .
[0112] The operation complexity acquisition module 620 is configured to acquire the operation complexity of the target frame image. .
[0113] The rendering load calculation module 630 is configured to calculate the rendering load according to the material complexity and the operation complexity. , calculate the rendering load of the target frame image , the corresponding formula is as follows:
[0114]
[0115] in, is the material complexity coefficient, is the operation complexity coefficient, is the primitive scale factor, is the texture scale factor.
[0116] The task load value acquisition module 640 is configured to obtain the task load value of each rendering module. .
[0117] The task scheduling module 650 is configured to schedule the rendering load of the target frame image according to the rendering load of the target frame image. and the task load value of each rendering module , dispatching the rendering task of the target frame image to the target rendering module for rendering processing.
[0118] In some exemplary embodiments of the present disclosure, the obtaining of the material complexity of the target frame image further includes: obtaining the number of vertices and primitive types of the target frame image; and calculating the primitive scale of the target frame image according to the number of vertices and primitive types. .
[0119] In some exemplary embodiments of the present disclosure, the texture scale It is positively correlated with the image size of the target frame image.
[0120] In some exemplary embodiments of the present disclosure, the complexity of the operation of acquiring the target frame image is , further comprising: obtaining a preset rendering processing step of the target frame image; determining the operation complexity of the target frame image according to the preset rendering processing step; .
[0121] In some exemplary embodiments of the present disclosure, the rendering load calculation module 630 is further configured to obtain the number of times the target frame image is drawn. ; According to the complexity of the material and the complexity of the operation , calculate the rendering load of the target frame image , the corresponding formula is as follows:
[0122]
[0123] in, is the complexity of the i-th drawing operation, is the scale of the primitive drawn for the i-th time, The texture scale for the i-th drawing.
[0124] In some exemplary embodiments of the present disclosure, the task scheduling module 650 is further configured to compare the task load values of the respective rendering modules. ; The task load value The smallest rendering module is determined as the target rendering module; and the rendering task of the target frame image is dispatched to the target rendering module for rendering processing.
[0125] In some exemplary embodiments of the present disclosure, the task scheduling module 650 is further configured to schedule tasks according to the task load values of the respective rendering modules. , calculate the average task load value of each rendering module ; The rendering load of the target frame image Add each rendering module separately and calculate the task load variance of the rendering module after adding , the corresponding formula is as follows:
[0126]
[0127] in, is the number of rendering modules, is the task load value of the i-th rendering module; the task load variance The smallest rendering module is determined as the target rendering module; and the rendering task of the target frame image is dispatched to the target rendering module for rendering processing.
[0128] In some exemplary embodiments of the present disclosure, the method further includes: in response to dispatching the rendering task of the target frame image to the target rendering module, according to the rendering load of the target frame image , the task load value of the target rendering module to update.
[0129] In some exemplary embodiments of the present disclosure, the coefficient adjustment module is configured to obtain the rendering task execution time of each of the target frame images; based on the rendering load of each of the target frame images, and the rendering task execution time, and perform data statistics; according to the data statistics, the material complexity coefficient is calculated by linear regression method , Operational complexity coefficient , Element scale factor and texture scale factor At least one coefficient in is adjusted.
[0130] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0131] Refer to the following Figure 7 hereinafter describes an electronic device 700 according to such an embodiment of the present disclosure. Figure 7 The electronic device 700 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0132] like Figure 7 As shown, the electronic device 700 is in the form of a general computing device. The components of the electronic device 700 may include but are not limited to: the at least one processing unit 710, the at least one storage unit 720, a bus 730 connecting different system components (including the storage unit 720 and the processing unit 710), and a display unit 740.
[0133] The storage unit stores program codes, which can be executed by the processing unit 710, so that the processing unit 710 performs the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification. For example, the processing unit 710 can perform the following steps: Figure 2 The steps shown.
[0134] For example, electronic devices can achieve Figure 2 The steps shown.
[0135] The storage unit 720 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 721 and / or a cache memory unit 722 , and may further include a read-only memory unit (ROM) 723 .
[0136] The storage unit 720 may also include a program / utility 724 having a set (at least one) of program modules 725, such program modules 725 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0137] Bus 730 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0138] The electronic device 700 may also communicate with one or more external devices 770 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 700, and / or communicate with any device that enables the electronic device 700 to communicate with one or more other computing devices (e.g., routers, modems, etc.). This communication may be performed through an input / output (I / O) interface 750. In addition, the electronic device 700 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) through a network adapter 760. As shown, the network adapter 760 communicates with other modules of the electronic device 700 through a bus 730. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0139] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiment of the present disclosure.
[0140] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory including instructions, and the above instructions can be executed by a processor of the device to complete the above method. Optionally, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0141] In an exemplary embodiment, a computer program product is also provided, including a computer program / instruction, and when the computer program / instruction is executed by a processor, the method in the above embodiment is implemented.
[0142] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0143] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for scheduling image rendering tasks based on load balancing, characterized in that: include: Get the material complexity of the target frame image; The material complexity includes at least: primitive size and texture scale ; The operation complexity of obtaining the target frame image ; According to the complexity of the material and the complexity of the operation , calculate the rendering load of the target frame image , the corresponding formula is as follows: ; in, is the material complexity coefficient, is the operation complexity coefficient, is the primitive scale factor, is the texture scale factor; Get the task load value of each rendering module ; According to the rendering load of the target frame image and the task load value of each rendering module , dispatching the rendering task of the target frame image to the target rendering module for rendering processing, and according to the rendering load of the target frame image , the task load value of the target rendering module to update.
2. The method according to claim 1, characterized in that The step of obtaining the material complexity of the target frame image further includes: Obtaining the number of vertices and primitive types of the target frame image; Calculate the primitive scale of the target frame image according to the number of vertices and primitive type .
3. The method according to claim 1, characterized in that The texture scale It is positively correlated with the image size of the target frame image.
4. The method according to claim 1, characterized in that: The complexity of the operation of obtaining the target frame image , also includes: Obtaining preset rendering processing steps of the target frame image; According to the preset rendering processing steps, the operation complexity of the target frame image is determined .
5. The method according to claim 1, characterized in that The method further comprises: Get the number of times the target frame image is drawn ; According to the complexity of the material and the complexity of the operation , calculate the rendering load of the target frame image , the corresponding formula is as follows: ; in, is the complexity of the i-th drawing operation, is the scale of the primitive drawn for the i-th time, The texture scale for the i-th drawing.
6. The method according to claim 1, characterized in that The rendering load according to the target frame image and the task load value of each rendering module , dispatching the rendering task of the target frame image to the target rendering module for rendering processing, and also comprising: Compare the task load values of each rendering module ; The task load value The smallest rendering module is determined as the target rendering module; The rendering task of the target frame image is dispatched to the target rendering module for rendering processing.
7. The method according to claim 1, characterized in that The rendering load according to the target frame image and the task load value of each rendering module , dispatching the rendering task of the target frame image to the target rendering module for rendering processing, and also comprising: According to the task load value of each rendering module , calculate the average task load value of each rendering module ; The rendering load of the target frame image Add each rendering module separately and calculate the task load variance of the rendering module after adding , the corresponding formula is as follows: ; in, is the number of rendering modules, is the task load value of the i-th rendering module; The task load variance The smallest rendering module is determined as the target rendering module; The rendering task of the target frame image is dispatched to the target rendering module for rendering processing.
8. The method according to claim 1, characterized in that The method further comprises: Obtaining the rendering task execution time of each of the target frame images; Based on the rendering load of each target frame image and the execution time of the rendering task, and perform data statistics; According to the data statistics, the material complexity coefficient is calculated by linear regression method. , Operational complexity coefficient , Element scale factor and texture scale factor At least one coefficient in is adjusted.
9. A device for scheduling image rendering tasks based on load balancing, characterized in that: include: A material complexity acquisition module is configured to acquire the material complexity of the target frame image; The material complexity includes at least: primitive size and texture scale ; An operation complexity acquisition module is configured to acquire the operation complexity of the target frame image. ; The rendering load calculation module is configured to calculate the rendering load according to the complexity of the material and the complexity of the operation. , calculate the rendering load of the target frame image , the corresponding formula is as follows: ; in, is the material complexity coefficient, is the operation complexity coefficient, is the primitive scale factor, is the texture scale factor; The task load value acquisition module is configured to obtain the task load value of each rendering module. ; The task scheduling module is configured to schedule the rendering load of the target frame image according to the and the task load value of each rendering module , dispatching the rendering task of the target frame image to the target rendering module for rendering processing, and according to the rendering load of the target frame image , the task load value of the target rendering module to update.
