Multi-task concurrent rendering method and device, electronic equipment and storage medium
By extracting the rendering resource of the next render request in the rendering engine for preloading, and immediately rendering the next task after the GPU renders the current task, the problems of inefficient rendering and low hardware resource utilization in the existing technology are solved, and efficient multi-tasking concurrent rendering is achieved.
Patent Information
- Application Number
- CN202411979781.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-29
AI Technical Summary
The existing rendering engines are inefficient and have low hardware resource utilization in the case of multiple rendering tasks, resulting in an increase in GPU idle time.
Under CPU control, the rendering resource for the next render request is extracted for preloading. After the current task is rendered using GPU, the next task will be rendered immediately.
Multi-task concurrent rendering is realized, which improves rendering efficiency and GPU resource utilization, and reduces GPU idle time.
Smart Images

Figure CN119904562A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the fields of computer vision and data processing. The present disclosure specifically relates to a multi-task concurrent rendering method, device, electronic device and storage medium. Background Art
[0002] With the development of computer technology, in the field of image processing, rendering engines generally use GPU (image processing) to perform corresponding rendering processing on rendering tasks.
[0003] However, the rendering engine generally renders for each rendering task one by one, and the rendering process includes multiple stages such as rendering resource loading, rendering resource processing optimization, GPU image rendering, and post-processing. The next rendering task is executed only after the rendering process is completed. In this way, in the case of multiple rendering tasks, the rendering efficiency is low and the hardware resource utilization is low. Summary of the invention
[0004] The present disclosure provides a multi-task concurrent rendering method, device, electronic device and storage medium.
[0005] According to one aspect of the present disclosure, a multi-task concurrent rendering method is provided, comprising:
[0006] When controlling the image processor to perform image rendering on the rendering phase task of the first rendering request, extracting the second rendering request from the rendering request waiting queue, and preloading the rendering resources corresponding to the data preparation phase task of the second rendering request;
[0007] When the rendering phase task of the first rendering request has been completed, the image processor is triggered to perform image rendering on the rendering phase task of the second rendering request based on the preloaded rendering resources.
[0008] According to another aspect of the present disclosure, a multi-task concurrent rendering device is provided, comprising:
[0009] An image preloading module, configured to extract a second rendering request from a rendering request waiting queue and preload rendering resources corresponding to a data preparation phase task of the second rendering request while controlling an image processor to render an image for the rendering phase task of the first rendering request;
[0010] The image rendering module is used to trigger the image processor to perform image rendering on the rendering stage task of the second rendering request based on the preloaded rendering resources when the rendering stage task of the first rendering request has been completed.
[0011] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0012] at least one processor; and
[0013] a memory communicatively connected to the at least one processor; wherein,
[0014] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute any multi-task concurrent rendering method in the embodiments of the present disclosure.
[0015] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute any multi-task concurrent rendering method according to the embodiments of the present disclosure.
[0016] According to the technology disclosed in the present invention, when the central processing unit controls the image processor to perform image rendering on the rendering stage task of the first rendering request, the central processing unit extracts the second rendering request from the rendering request waiting queue and preloads the rendering resources corresponding to the data preparation stage task of the second rendering request; when the rendering stage task of the first rendering request has been completed, the image processor is triggered to perform image rendering on the rendering stage task of the second rendering request based on the preloaded rendering resources. In this way, when the GPU performs image rendering on the current rendering request, the CPU preloads the rendering resources of the next rendering request in advance, and then, when the GPU has completed the image rendering task of the current rendering request, it can quickly trigger the GPU to perform image rendering on the next rendering request based on the pre-added rendering resources. Thereby, multiple rendering requests can be processed in parallel to improve rendering efficiency.
[0017] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0019] Figure 1 is a flow chart of an image generating method according to an embodiment of the present disclosure;
[0020] Figure 2A is a schematic diagram of an execution process of a rendering request according to an embodiment of the present disclosure;
[0021] Figure 2B is a schematic diagram of an execution process of a rendering request according to an embodiment of the present disclosure;
[0022] Figure 3is a schematic diagram of an execution process of a rendering request according to another embodiment of the present disclosure;
[0023] Figure 4 is a schematic diagram of an execution process of a rendering request according to another embodiment of the present disclosure;
[0024] Figure 5 is a schematic diagram of an execution process of a rendering request according to another embodiment of the present disclosure;
[0025] Figure 6 is a structural block diagram of an image generating device according to an embodiment of the present disclosure;
[0026] Figure 7 is a structural block diagram of an image generating device according to another embodiment of the present disclosure;
[0027] Figure 8 is a block diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0028] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0029] Figure 1 is a flowchart of an image generating method according to an embodiment of the present disclosure.
[0030] like Figure 1 As shown, the image generation method, applied to a central processing unit (CPU), may include:
[0031] S110, while controlling a graphics processor (GPU) to perform image rendering on a rendering phase task of a first rendering request, extract a second rendering request from a rendering request waiting queue, and preload rendering resources corresponding to a data preparation phase task of the second rendering request.
[0032] S120, when the rendering phase task of the first rendering request has been completed, triggering the image processor to perform image rendering on the rendering phase task of the second rendering request based on the preloaded rendering resources.
[0033] It can be understood that for a rendering request, it includes tasks in multiple different stages, including data preparation stage tasks before GPU rendering, rendering stage tasks executed by the GPU, and data post-processing stage tasks after GPU rendering. Among them, the data preparation stage tasks and data post-processing stage tasks are not executed by the GPU, but by the CPU.
[0034] In some technologies, if the CPU processes the tasks corresponding to the rendering requests one by one, the GPU will be idle when the CPU is processing the tasks in the data preparation phase or the data post-processing phase. Figure 2A As shown in the figure, rendering requests 0, 1, and 2 are executed serially, and the tasks of each stage of each request are executed serially, namely, the data preparation stage tasks, the rendering stage tasks executed by the GPU, and the data post-processing stage tasks. Both the GPU and the CPU have a long period of idle time. For a 1K resolution rendering task, the CPU processing stage accounts for about 20%, that is, even when the GPU is working at full load, the GPU is idle for at least 20% of the time because it needs to wait for the CPU to pre-process.
[0035] In contrast, the embodiments of the present application, such as Figure 2B As shown, when the GPU is processing the current first rendering request, the CPU pre-loads the rendering resources of the next rendering request, i.e., the second rendering request. When the GPU completes processing the current first rendering request, it can perform image rendering on the next rendering request. In this way, the GPU resources can be efficiently utilized, reducing the GPU idle time and improving the rendering efficiency.
[0036] like Figure 3 As shown, the tasks at each stage of a request can be triggered separately.
[0037] In the data preparation phase, the uncached rendering resources in the local hard disk can be loaded from the network into the memory, and then the rendering resources can be asynchronously read from the memory and stored in the local hard disk, so that the IO usage frequency of the local hard disk can be reduced. The task execution in this phase does not occupy GPU resources, but occupies CPU resources and IO resources. Therefore, the CPU can execute the data preparation phase tasks of multiple different rendering requests in parallel.
[0038] In the GPU rendering phase, the CPU uploads the pre-added rendering resources in the memory to the GPU video memory and releases the corresponding memory resources. Then, the GPU renders the image based on the rendering resources in the GPU video memory. In this phase, only GPU resources are occupied, not CPU resources. The GPU executes the rendering phase tasks of multiple rendering requests in series.
[0039] In the data post-processing stage, the CPU downloads the rendering results from the GPU memory to the internal memory and releases the GPU memory. No GPU computing resources are used in this stage. The CPU can execute the data post-processing tasks of multiple different rendering requests in parallel.
[0040] It can be understood that the rendering request waiting queue includes a plurality of rendering requests arranged in order. When the second rendering request is extracted from the rendering request waiting queue, the second rendering request is deleted from the rendering request waiting queue. The second rendering request may be the first request in the queue.
[0041] It can be understood that at any time or specified time when the GPU performs image rendering for the rendering phase task of the first rendering request, the rendering resources corresponding to the data preparation phase task of the next rendering request, that is, the second rendering request, are preloaded.
[0042] It can be understood that the first rendering request is a request currently executing GPU rendering, and the second rendering request is a request currently waiting to be executed by GPU rendering.
[0043] It can be understood that when the rendering phase task of the first rendering request has been completed and the data preparation phase task of the second rendering request has also been completed, the image processor is triggered to perform image rendering on the rendering phase task of the second rendering request based on the preloaded rendering resources. The preloaded rendering resources are the rendering resources preloaded by the data preparation phase task of the second rendering request.
[0044] If the data preparation phase task of the second rendering request has not been completed, it is necessary to wait for it to be completed before triggering the image processor to perform image rendering on the rendering phase task of the second rendering request based on the preloaded rendering resources.
[0045] According to the disclosed embodiment, when the GPU performs image rendering on a GPU rendering phase task of a rendering request, the CPU preloads the rendering resources of the data preparation phase task of the next rendering request, and when the GPU has completed the GPU rendering phase task of the rendering request, the CPU triggers the GPU to perform image rendering on the GPU rendering phase task of the next rendering request. In this way, the CPU can execute multiple rendering requests in parallel and trigger the GPU to perform image rendering one by one. While the CPU meets the serial requirements of GPU rendering, the CPU can process multiple rendering requests in parallel, thereby improving rendering efficiency.
[0046] In some technologies, such as Figure 4As shown in the figure, triggering the preloading of rendering resources for the next rendering request too early will cause a certain time difference between the completion of the preloading of resources in the request and the start of the GPU rendering phase task execution time, that is, there is space time for the task to wait for execution. In this way, the total execution time of a rendering request is prolonged.
[0047] In some technologies, such as Figure 5 As shown, triggering the preloading of the rendering resources of the next rendering request too late will cause the GPU to be idle, and the GPU will not perform rendering until the preloading of the rendering resources of the next rendering request is completed, thereby reducing the utilization rate of the GPU.
[0048] In one embodiment, rendering resources corresponding to the data preparation phase task of the second rendering request are preloaded, including: determining a predicted termination execution time of the rendering phase task of the first rendering request based on the predicted execution time of the rendering phase task of the first rendering request and the actual start execution time of the rendering phase task of the first rendering request; determining a predicted start execution time of the data preparation phase task of the second rendering request based on the predicted termination execution time of the rendering phase task of the first rendering request and the predicted execution time of the data preparation phase task of the second rendering request; and preloading rendering resources corresponding to the data preparation phase task of the second rendering request when the current time reaches the predicted start execution time of the data preparation phase task of the second rendering request.
[0049] It can be understood that when the CPU receives a rendering request, the CPU can calculate the predicted execution time of tasks at various stages of the rendering request.
[0050] It can be understood that, since the rendering phase task of the first rendering request is being executed, the actual start execution time of the task can be obtained at this time.
[0051] Exemplarily, the actual start execution time and the predicted execution time of the rendering phase task of the first rendering request are added together to obtain the predicted termination execution time of the rendering phase task of the first rendering request;
[0052] Exemplarily, the predicted execution time of the data preparation phase task of the second rendering request is subtracted from the predicted termination execution time of the rendering phase task of the first rendering request to obtain the predicted start execution time of the data preparation phase task of the second rendering request. In this way, when the current moment is the predicted start execution time of the data preparation phase task of the second rendering request, the CPU starts to preload the rendering resources corresponding to the data preparation phase task of the second rendering request, and the preloading completion time of the rendering resources will be close to or the same as the predicted termination execution time of the rendering phase task of the first rendering request. In this way, the GPU can continuously and uninterruptedly execute the rendering phase tasks, thereby improving the utilization rate of GPU resources.
[0053] According to the above implementation, by estimating the execution time of tasks at each stage of each request, the start execution time of the data preparation stage tasks of each request can be predicted, thereby avoiding triggering the GPU rendering task of the next request too early or too late, and further improving the utilization of the GPU.
[0054] In one embodiment, the above method may also include: determining the predicted execution time of the rendering phase task of the first rendering request based on the metadata of the first rendering request; and determining the predicted execution time of the data preparation phase task of the second rendering request based on the metadata of the second rendering request.
[0055] It can be understood that when the CPU receives a rendering request, it can determine the predicted execution time of the tasks at each stage in the request based on the metadata of the request.
[0056] For example, the metadata records the resources required to be loaded for each stage task and information on how to process the stage task, etc. The CPU can predict the predicted execution time of each stage task based on this information.
[0057] Exemplarily, the metadata remembers the data volume and processing time of the tasks at each stage, from which the predicted execution time of the tasks at each stage can be determined.
[0058] According to the above implementation, based on the metadata of the rendering request, the predicted execution time of the tasks in each stage of the request can be determined.
[0059] In one embodiment, the above-mentioned preloading of rendering resources corresponding to the data preparation phase task of the second rendering request may include: when it is determined that the first rendering resource corresponding to the data preparation phase task of the second rendering request is not stored in the local hard disk and the first rendering resource is stored in the network resource library, obtaining the first rendering resource from the network resource library and loading the first rendering resource into the local memory; reading the first rendering resource from the local memory and storing the first rendering resource in the local hard disk.
[0060] Understandably, traditional rendering engines require all rendering resources to be on the local hard disk, but in fact, some rendering resources are still managed on independent network resource servers, so it is necessary to pull the rendering resources from the network to the local hard disk before the GPU executes the rendering task, and then load them from the local hard disk to the local memory. In this way, for any resource, the IO of the local hard disk needs to be used twice. In contrast, the present application pulls the rendering resources from the network to the local memory, and then loads them from the local memory to the local hard disk. In this way, for any resource, the IO of the local hard disk only needs to be used once.
[0061] According to the above implementation, uncached rendering resources in the local hard disk are loaded from the network into the local memory, and then the resources in the local memory are asynchronously cached into the local hard disk, which can improve parallelization and reduce the use of local hard disk IO.
[0062] In one implementation, the above may also include: when it is determined that the local hard disk stores the second rendering resource corresponding to the data preparation phase task of the second rendering request, reading the second rendering resource from the local hard disk and loading the second rendering resource into the local memory.
[0063] It can be understood that the first rendering resource is part or all of the resources corresponding to the data preparation phase task of the second rendering request that are not stored in the local hard disk, and the second rendering resource is part or all of the resources corresponding to the data preparation phase task of the second rendering request that are stored in the local hard disk.
[0064] According to the above implementation, if the corresponding rendering resources are stored in the local hard disk, the resources are extracted from the local hard disk for subsequent GPU rendering.
[0065] In one embodiment, the above-mentioned triggering image processor to perform image rendering on the rendering stage task of the second rendering request based on the preloaded rendering resources includes: controlling the image processor to read the rendering resources corresponding to the data preparation stage task of the second rendering request from the local memory, and storing them in the video memory of the image processor; controlling the image processor to perform image rendering on the rendering stage task of the second rendering request based on the rendering resources in the video memory of the image processor.
[0066] According to the above implementation, in the GPU rendering stage, data needs to be uploaded from the internal memory to the GPU video memory first, and the GPU can extract resources from the GPU video memory for rendering.
[0067] In one implementation, the method further includes: when the image processor reads the rendering resource from the local memory, deleting the read rendering resource from the local memory.
[0068] According to the above implementation, when the GPU loads resources from the local memory into the GPU video memory, the CPU deletes the resources in the local memory, so that the local memory can be released and resource utilization can be further improved.
[0069] In one embodiment, the method further includes: when the rendering phase task of the second rendering request has been completed, controlling the image processor to delete the rendering resources corresponding to the data preparation phase task of the second rendering request in the video memory of the image processor.
[0070] According to the above implementation, after GPU rendering is completed, the rendering resources previously preloaded in the video memory are deleted, so that the video memory resources can be released and the GPU rendering efficiency can be improved.
[0071] In one embodiment, the above method may also include: when the rendering stage task of the second rendering request has been completed, obtaining the image rendering result of the first rendering request from the video memory of the image processor, and storing the image rendering result of the first rendering request in the local hard disk; and controlling the image processor to delete the image rendering result of the first rendering request in the video memory of the image processor.
[0072] For example, the CPU may perform some image processing operations and format conversion on the image rendering result of the first rendering request, and then store the result in the local hard disk.
[0073] It can be understood that this example is a data post-processing stage task performed by the CPU after the GPU rendering is completed.
[0074] According to the above implementation, after the GPU rendering is completed, the CPU performs post-processing stage tasks, including downloading the rendering result from the video memory to the local hard disk and deleting the rendering result in the video memory, thereby releasing the video memory.
[0075] Figure 6 It is a structural block diagram of an image rendering device according to an embodiment of the present disclosure.
[0076] like Figure 6 As shown, the image rendering device is applied to a central processing unit and may include:
[0077] The image preloading module 610 is used to extract a second rendering request from the rendering request waiting queue and preload rendering resources corresponding to the data preparation phase task of the second rendering request when controlling the image processor to render the image for the rendering phase task of the first rendering request;
[0078] The image rendering module 620 is used to trigger the image processor to perform image rendering on the rendering stage task of the second rendering request based on the preloaded rendering resources when the rendering stage task of the first rendering request has been completed.
[0079] Figure 7 It is a structural block diagram of an image rendering device according to another embodiment of the present disclosure.
[0080] Figure 7 The image preloading module 610 and the image rendering module 620 in Figure 6 The image preloading module 610 and the image rendering module 620 have the same functions.
[0081] In one implementation, the image preloading module 710 includes:
[0082] The termination time prediction unit 711 is used to determine the predicted termination execution time of the rendering phase task of the first rendering request based on the predicted execution time of the rendering phase task of the first rendering request and the actual start execution time of the rendering phase task of the first rendering request;
[0083] A start time prediction unit 712 is used to determine a predicted start execution time of the data preparation phase task of the second rendering request based on the predicted termination execution time of the rendering phase task of the first rendering request and the predicted execution time of the data preparation phase task of the second rendering request;
[0084] The preloading triggering unit 713 is used to preload the rendering resources corresponding to the data preparation phase task of the second rendering request when the current time reaches the predicted start execution time of the data preparation phase task of the second rendering request.
[0085] In one implementation, the image preloading module 710 further includes:
[0086] A first time consumption prediction unit 714 is used to determine the predicted execution time consumption of the rendering phase task of the first rendering request based on the metadata of the first rendering request;
[0087] The second time consumption prediction unit 715 is used to determine the predicted execution time consumption of the data preparation phase task of the second rendering request based on the metadata of the second rendering request.
[0088] In one implementation, the preload trigger unit 713 is specifically configured to:
[0089] When it is determined that the first rendering resource corresponding to the data preparation phase task of the second rendering request is not stored in the local hard disk, and the first rendering resource is stored in the network resource library, obtaining the first rendering resource from the network resource library and loading the first rendering resource into the local memory;
[0090] The first rendering resource is read from the local memory and stored in the local hard disk.
[0091] In one embodiment, if Figure 7 As shown, the image preloading module 710 also includes:
[0092] The first data loading unit 716 is used to read the second rendering resource from the local hard disk and load the second rendering resource into the local memory when it is determined that the second rendering resource corresponding to the data preparation phase task of the second rendering request is stored in the local hard disk.
[0093] In one implementation, the image rendering module 720 includes:
[0094] A second data loading unit 721, used to control the image processor to read the rendering resources corresponding to the data preparation phase task of the second rendering request from the local memory, and store them in the video memory of the image processor;
[0095] The image rendering unit 722 is used to control the image processor to perform image rendering on the rendering phase task of the second rendering request based on the rendering resources in the video memory of the image processor.
[0096] In one implementation, the image rendering module 720 further includes:
[0097] The first data deleting unit 723 is configured to delete the read rendering resources from the local memory when the image processor reads rendering resources from the local memory.
[0098] In one implementation, the image rendering module 720 further includes:
[0099] The second data deleting unit 724 is used to control the image processor to delete the rendering resources corresponding to the data preparation phase task of the second rendering request in the video memory of the image processor when the rendering phase task of the second rendering request has been completed.
[0100] In one embodiment, the above device further comprises:
[0101] a rendering result downloading module 730, configured to obtain the image rendering result of the first rendering request from the video memory of the image processor and store the image rendering result of the first rendering request in a local hard disk when the rendering phase task of the second rendering request has been completed; and
[0102] The video memory release module 740 is used to control the image processor to delete the image rendering result of the first rendering request in the video memory of the image processor.
[0103] For the description of specific functions and examples of each module and submodule of the device in the embodiment of the present disclosure, reference can be made to the relevant description of the corresponding steps in the above method embodiment, which will not be repeated here.
[0104] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0105] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0106] Figure 8 FIG. 1 is a structural block diagram of an electronic device according to an embodiment of the present disclosure. Figure 8 As shown, the electronic device includes: a memory 810 and a processor 820, and the memory 810 stores a computer program that can be run on the processor 820. The number of the memory 810 and the processor 820 can be one or more. The memory 810 can store one or more computer programs. When the one or more computer programs are executed by the electronic device, the electronic device executes the method provided by the above method embodiment. The electronic device may also include: a communication interface 830, which is used to communicate with external devices and perform data exchange transmission.
[0107] If the memory 810, the processor 820 and the communication interface 830 are implemented independently, the memory 810, the processor 820 and the communication interface 830 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0108] Optionally, in a specific implementation, if the memory 810, the processor 820 and the communication interface 830 are integrated on a chip, the memory 810, the processor 820 and the communication interface 830 can communicate with each other through an internal interface.
[0109] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor supporting the Advanced RISC Machines (ARM) architecture.
[0110] Further, optionally, the above-mentioned memory may include a read-only memory and a random access memory, and may also include a non-volatile random access memory. The memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may include a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may include a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available. For example, static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (DR RAM).
[0111] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the process or function described in the embodiment of the present disclosure is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (for example: coaxial cable, optical fiber, data subscriber line (Digital Subscriber Line, DSL)) or wireless (for example: infrared, Bluetooth, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access, or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a digital versatile disc (DVD)), or a semiconductor medium (e.g., a solid state disk (SSD)), etc. It is worth noting that the computer-readable storage medium mentioned in the present disclosure may be a non-volatile storage medium, in other words, a non-transient storage medium.
[0112] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0113] In the description of the embodiments of the present disclosure, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.
[0114] In the description of the embodiments of the present disclosure, unless otherwise specified, " / " means or, for example, A / B can mean A or B. "And / or" in this article is only a way to describe the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0115] In the description of the embodiments of the present disclosure, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present disclosure, unless otherwise specified, "plurality" means two or more.
[0116] The above description is only an exemplary embodiment of the present disclosure and is not intended to limit the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A multi-task concurrent rendering method, characterized in that: Applied to a central processing unit, the method comprises: When controlling the image processor to perform image rendering on the rendering phase task of the first rendering request, extracting the second rendering request from the rendering request waiting queue, and preloading the rendering resources corresponding to the data preparation phase task of the second rendering request; When the rendering phase task of the first rendering request has been completed, the image processor is triggered to perform image rendering on the rendering phase task of the second rendering request based on the preloaded rendering resources.
2. The method according to claim 1, characterized in that: The preloading of rendering resources corresponding to the data preparation phase task of the second rendering request includes: Determining a predicted termination execution time of the rendering phase task of the first rendering request based on the predicted execution time of the rendering phase task of the first rendering request and the actual start execution time of the rendering phase task of the first rendering request; Determine a predicted start execution time of the data preparation phase task of the second rendering request based on a predicted termination execution time of the rendering phase task of the first rendering request and a predicted execution time consumption of the data preparation phase task of the second rendering request; When the current time reaches the predicted start execution time of the data preparation phase task of the second rendering request, the rendering resources corresponding to the data preparation phase task of the second rendering request are preloaded.
3. The method according to claim 2, characterized in that Also includes: Determining, based on the metadata of the first rendering request, a predicted execution time of a rendering phase task of the first rendering request; Based on the metadata of the second rendering request, a predicted execution time of a task in a data preparation phase of the second rendering request is determined.
4. The method according to claim 2, characterized in that: The preloading of rendering resources corresponding to the data preparation phase task of the second rendering request includes: When it is determined that the first rendering resource corresponding to the data preparation phase task of the second rendering request is not stored in the local hard disk, and the first rendering resource is stored in the network resource library, obtaining the first rendering resource from the network resource library, and loading the first rendering resource into the local memory; The first rendering resource is read from the local memory, and the first rendering resource is stored in the local hard disk.
5. The method according to claim 4, characterized in that Also includes: When it is determined that the local hard disk stores the second rendering resource corresponding to the data preparation phase task of the second rendering request, the second rendering resource is read from the local hard disk and loaded into the local memory.
6. The method according to claim 4 or 5, characterized in that: The triggering the image processor to perform image rendering on the rendering phase task of the second rendering request based on the preloaded rendering resources includes: Controlling the image processor to read the rendering resources corresponding to the data preparation phase task of the second rendering request from the local memory, and store them in the video memory of the image processor; The image processor is controlled to perform image rendering on the rendering phase task of the second rendering request based on rendering resources in a video memory of the image processor.
7. The method according to claim 6, characterized in that Also includes: When the image processor reads rendering resources from the local memory, the read rendering resources are deleted from the local memory.
8. The method according to claim 6, characterized in that Also includes: When the rendering phase task of the second rendering request has been completed, the image processor is controlled to delete the rendering resources corresponding to the data preparation phase task of the second rendering request in the video memory of the image processor.
9. The method according to claim 1, characterized in that: Also includes: When the rendering phase task of the second rendering request has been completed, obtaining the image rendering result of the first rendering request from the video memory of the image processor, and storing the image rendering result of the first rendering request in the local hard disk; as well as The image processor is controlled to delete the image rendering result of the first rendering request in the video memory of the image processor.
10. A multi-task concurrent rendering device, characterized in that: Applied to a central processing unit, the device comprises: An image preloading module, configured to extract a second rendering request from a rendering request waiting queue and preload rendering resources corresponding to a data preparation phase task of the second rendering request while controlling an image processor to render an image for the rendering phase task of the first rendering request; The image rendering module is used to trigger the image processor to perform image rendering on the rendering stage task of the second rendering request based on the preloaded rendering resources when the rendering stage task of the first rendering request has been completed.
11. The device according to claim 10, characterized in that The image preloading module comprises: a termination time prediction unit, configured to determine a predicted termination execution time of the rendering phase task of the first rendering request based on the predicted execution time consumption of the rendering phase task of the first rendering request and the actual start execution time of the rendering phase task of the first rendering request; a start time prediction unit, configured to determine a predicted start time for executing the data preparation phase task of the second rendering request based on a predicted termination time for executing the rendering phase task of the first rendering request and a predicted execution time consumption for executing the data preparation phase task of the second rendering request; The preloading triggering unit is used to preload the rendering resources corresponding to the data preparation phase task of the second rendering request when the current time reaches the predicted start execution time of the data preparation phase task of the second rendering request.
12. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 9.
13. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-9.