A hardware layer rendering scheduling method, device, equipment and storage medium
By performing rendering polling on hardware layers and using the hardware layer with the fastest rendering speed in the previous cycle to fill the time gap, the problem of poor rendering effects caused by the GUI class library's single-threaded rendering of multiple hardware layers is solved, and rendering is improved. Efficiency and development efficiency.
Patent Information
- Application Number
- CN202110814760.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-19
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2041-07-19
AI Technical Summary
In the existing technology, the GUI class library can only use one thread to render multiple hardware layers, resulting in poor rendering effect of the hardware layers and the inability to effectively control the refresh rate of each hardware layer, especially in multi-hardware layer scenarios. , resulting in poor rendering results.
By periodically polling the hardware layer for rendering, confirm the rendering time of each hardware layer. If the current time is its rendering time, render and update the time. If it does not match, query the next hardware layer until all layers Inquiry completed; during the unnecessary rendering cycle, the hardware layer with the fastest rendering speed in the previous cycle is used for rendering to fill the time gap and improve rendering efficiency.
It improves the rendering effect and rendering efficiency of hardware layers, improves development efficiency through GUI class libraries in multi-hardware layer scenarios, reduces dependence on multi-threading, improves embedded platform resource utilization, and avoids the need for certain hardware The problem of insufficient rendering of other layers caused by too many layer rendering times.
Smart Images

Figure CN113610699B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of image processing, and in particular to a hardware layer rendering scheduling method, device, equipment and storage medium. Background Art
[0002] At present, the hardware of high-performance embedded platforms can generally provide multiple hardware layers and realize the function of mixing multiple hardware layers. Compared with the large amount of computing required for software layer mixing, hardware layers hardly waste computing resources when mixing. During use, users only need to render different pictures on different hardware layers according to actual needs. The embedded platform will automatically mix and superimpose all hardware layers and output them to the screen for display.
[0003] In actual use, users hope to control the refresh rate of each hardware layer. For example, for the interface required by a video player, which includes a video and an operation interface, when the refresh rate of the video and operation interface needs to be controlled, there are two ways:
[0004] 1. Use the existing GUI (Graphical User Interface) class library to render the video and operation interface. However, the existing GUI class libraries are single-threaded and all layers need to be rendered in the same thread. When the number of layers to be rendered is large, the entire video player (including the video stream) will be stuck.
[0005] 2. Create two threads, one thread is responsible for rendering the video to the hardware layer, and the other thread is responsible for calling the GUI library to render the operation interface to another hardware layer, so that the refresh rate of each thread can be controlled separately, and the GUI library can be used to process complex operation interfaces and reduce the refresh rate of the operation interface to ensure the smoothness of the video.
[0006] When two threads are created to control the refresh rate of the hardware layer respectively, such as Figure 1 As shown, if a hardware rendering layer is added (and a thread is also added to control this hardware layer) to render the cool barrage effect, since the GUI class library is single-threaded, the middle barrage layer cannot be rendered using the GUI class library; if the barrage layer and the operation interface layer are rendered using the same thread, the barrage playback will be unsmooth (the barrage scrolling needs to be smooth), and if the GUI class library is not used to render the cool barrage effect, the work difficulty and development time will be greatly increased.
[0007] In summary, in the prior art, since the GUI class library is single-threaded, only one thread can be used to render multiple hardware layers, resulting in a technical problem of poor rendering effect of the hardware layers. Summary of the invention
[0008] The embodiment of the present invention provides a hardware layer rendering scheduling method, which is used to solve the technical problem in the prior art that a GUI class library can only use one thread to render multiple hardware layers, resulting in poor rendering effect of the hardware layers.
[0009] In a first aspect, an embodiment of the present invention provides a hardware layer rendering scheduling method, comprising the following steps:
[0010] Periodically polling the hardware layer for rendering to confirm the rendering time of the currently queried hardware layer, wherein the hardware layer includes at least two types;
[0011] If the currently queried time is the rendering time of the currently queried hardware layer, the hardware layer is rendered, and the rendering time is updated according to the type of the hardware layer;
[0012] If the currently queried time is not the rendering time of the currently queried hardware layer, the next hardware layer will be queried until all hardware layers have been queried;
[0013] Determine whether all hardware layers do not need to be rendered in this cycle;
[0014] If so, the target hardware layer is rendered in the current cycle, and the target hardware layer is the hardware layer with the fastest rendering speed in the previous cycle.
[0015] Preferably, the specific process of updating the rendering time according to the type of the hardware layer is:
[0016] Determine the time when the hardware layer starts rendering, and determine the number of times the hardware layer needs to be rendered within one second according to the type of the hardware layer;
[0017] According to the number of renderings required within the one second and the time when the rendering starts, the next rendering time of the hardware layer is calculated, and the rendering time of the hardware layer is updated.
[0018] Preferably, the specific process of calculating the next rendering time of the hardware layer according to the number of rendering times required within one second and the time when the rendering starts is:
[0019] Calculating the time interval between two adjacent renderings of the hardware layer according to the number of renderings required within one second;
[0020] The time interval is added to the rendering start time to obtain the next rendering time of the hardware layer, and the rendering time of the hardware layer is updated.
[0021] Preferably, the target hardware layer is a hardware layer with the fastest rendering speed in the previous cycle, which has a redraw area request and has not reached a preset frame number.
[0022] Preferably, if the currently queried time is the rendering time of the currently queried hardware layer, the specific process is:
[0023] If the current query time is greater than the rendering time of the hardware layer currently being queried, the current query time is the rendering time of the hardware layer currently being queried.
[0024] Preferably, if the currently queried time is the rendering time of the currently queried hardware layer, the specific process of rendering the hardware layer is:
[0025] If the currently queried time is the rendering time of the currently queried hardware layer, determine whether the hardware layer reaches the preset frame rate;
[0026] If not, render the hardware layer;
[0027] If yes, then ask for the next hardware layer.
[0028] Preferably, in the first rendering polling cycle, the currently queried time is the rendering time of the currently queried hardware layer.
[0029] In a second aspect, an embodiment of the present invention further provides a hardware layer rendering scheduling device, comprising:
[0030] A polling module, used for periodically polling the hardware layer for rendering, and confirming the rendering time of the currently queried hardware layer, wherein the hardware layer includes at least two types;
[0031] A rendering module, for rendering the hardware layer if the currently queried time is the rendering time of the currently queried hardware layer, and updating the rendering time according to the type of the hardware layer;
[0032] The traversal module is used to query the next hardware layer if the current query time is not the rendering time of the hardware layer currently being queried, until all hardware layers are queried;
[0033] A judgment module is used to judge whether all hardware layers do not need to be rendered in this cycle;
[0034] The scheduling module is used to render a target hardware layer in the current cycle when all hardware layers do not need to be rendered in the current cycle, and the target hardware layer is the hardware layer with the fastest rendering speed in the previous cycle.
[0035] In the third aspect, an embodiment of the present invention also provides a hardware layer rendering scheduling device, which includes a processor and a memory; the memory is used to store program code and transmit the program code to the processor; the processor is used to execute a hardware layer rendering scheduling method as described in the first aspect according to the instructions in the program code.
[0036] In a fourth aspect, an embodiment of the present invention further provides a storage medium storing computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are used to execute the hardware layer rendering method as described in the first aspect.
[0037] As described above, the embodiment of the present invention performs rendering polling on the hardware layer periodically to confirm the rendering time of the currently queried hardware layer, and the hardware layer includes at least two types; if the currently queried time is the rendering time of the currently queried hardware layer, the hardware layer is rendered, and the rendering time is updated according to the type of the hardware layer; if the currently queried time is not the rendering time of the currently queried hardware layer, the next hardware layer is queried until all hardware layers are queried; it is determined whether all hardware layers do not need to be rendered in this cycle; if so, the target hardware layer is rendered in this cycle, and the target hardware layer is the hardware layer with the fastest rendering speed in the previous cycle. The embodiment of the present invention renders the hardware layer with the fastest rendering speed in the previous cycle in each cycle when all hardware layers do not need to be rendered, so that when a time gap occurs, the target hardware layer with the fastest rendering speed in the previous cycle can be used to render to fill the time gap, thereby increasing the rendering times of the target hardware layer, so as to avoid the situation where some hardware layers are rendered too many times and other hardware layers are rendered insufficiently. The embodiments of the present invention can improve the rendering effect and rendering efficiency of the hardware layer, and in the use scenario of multiple hardware layers, the development efficiency can be improved through the GUI class library, without having to rely on multi-threading for development, which greatly improves the development cycle and improves the resource utilization of the embedded platform. The technical problem that the GUI class library in the prior art can only use one thread to render multiple hardware layers, resulting in poor rendering effect of the hardware layer, is solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 This is a structural diagram of the hardware layer in a usage scenario.
[0039] Figure 2 A method flow chart of a hardware layer rendering scheduling method provided by an embodiment of the present invention.
[0040] Figure 3 A schematic diagram of a hardware layer rendering scheduling method provided in an embodiment of the present invention.
[0041] Figure 4 A device structure diagram of a hardware layer rendering scheduling device provided in an embodiment of the present invention.
[0042] Figure 5 A device structure diagram of a hardware layer rendering scheduling device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0043] The following description and accompanying drawings fully illustrate the specific embodiments of the present application so that those skilled in the art can practice them. The examples represent possible variations only. Unless explicitly required, separate components and functions are optional, and the order of operation can vary. The parts and features of some embodiments may be included in or replace the parts and features of other embodiments. The scope of the embodiments of the present application includes the entire scope of the claims, and all available equivalents of the claims. In this article, each embodiment may be represented individually or generally by the term "invention", which is only for convenience, and if more than one invention is disclosed in fact, it is not intended to automatically limit the scope of the application to any single invention or inventive concept. In this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, without requiring or implying any actual relationship or order between these entities or operations. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method or device including a series of elements includes not only those elements, but also other elements that are not explicitly listed. The various embodiments are described in a progressive manner herein, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. As for the structures, products, etc. disclosed in the embodiments, since they correspond to the parts disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method part.
[0044] Embodiment 1
[0045] Figure 2 A method flow chart of a hardware layer rendering scheduling method provided in an embodiment of the present invention. The hardware layer rendering method provided in the embodiment of the present invention can be executed by a hardware layer rendering device, which can be implemented by software and / or hardware. The hardware layer rendering device can be composed of two or more physical entities, or can be composed of one physical entity. For example, the hardware layer rendering device can be a computer, a mobile phone, a tablet, or a smart interactive tablet.
[0046] Step 101: Periodically perform rendering polling on the hardware layer to confirm the rendering time of the currently queried hardware layer. The hardware layer includes at least two types.
[0047] In this embodiment, the hardware layer is periodically polled for rendering, all the hardware layers are traversed, and for each hardware layer queried, the rendering time of the hardware layer needs to be confirmed, so as to judge whether the hardware layer needs to be rendered in this cycle based on the rendering time. In one embodiment, the hardware layer includes at least two types, and the types of hardware layers can be divided according to the interface displayed by the hardware layer. Exemplarily, in one embodiment, the hardware layer includes two types, one type of hardware layer is used to display the operation interface, and the other type of hardware layer is used to display the video. It can be understood that if there is only one hardware layer, the single-threaded GUI class library can directly control the refresh rate of the hardware layer without the need to subsequently allocate the rendering computing power. Therefore, this embodiment is suitable for the use scenario where the hardware layer is at least two types. The type of hardware layer can be set according to actual needs, and the number of hardware layers is not limited in this embodiment.
[0048] Step 102: If the currently queried time is the rendering time of the currently queried hardware layer, the hardware layer is rendered, and the rendering time is updated according to the type of the hardware layer.
[0049] In this embodiment, in one cycle, for each hardware layer polled, if the current query time reaches the rendering time of the currently queried hardware layer, the hardware layer is rendered, and after rendering the hardware layer, the next rendering time of the hardware layer is calculated according to the type of the hardware layer, and the rendering time of the hardware layer is updated to the next rendering time.
[0050] In one embodiment, updating the rendering time according to the type of the hardware layer is specifically performed by steps 1021 and 1022, as follows:
[0051] Step 1021: Determine the time when the hardware layer starts rendering, and determine the number of times the hardware layer needs to be rendered within one second according to the type of the hardware layer.
[0052] First, determine the time when the hardware layer starts rendering in this cycle. Afterwards, since different types of hardware layers are used to display different interfaces, the number of rendering times set for different types of hardware layers within one second is different. Therefore, it is necessary to determine the number of rendering times of the hardware layer within one second according to the type of the hardware layer. In one embodiment, the number of frames of the hardware layer within one second can be determined to determine the number of times the hardware layer needs to be rendered within one second. Exemplarily, for a hardware layer, if the preset number of frames of the hardware layer within one second is 60 frames, the hardware layer needs to be rendered 60 times within one second. It can be understood that the number of times the hardware layer needs to be rendered within one second can be preset as needed. In this embodiment, the number of times the hardware layer needs to be rendered within one second is not limited. Afterwards, determine the time when the hardware layer starts rendering in this cycle.
[0053] Step 1022: Calculate the next rendering time of the hardware layer according to the number of renderings required within one second and the time when the rendering starts, and update the rendering time of the hardware layer.
[0054] After obtaining the number of times the hardware layer needs to be rendered within one second, the frame rate of the hardware layer can be calculated based on the number of times it needs to be rendered within one second. Afterwards, the next rendering time of the hardware layer can be calculated based on the calculated frame rate and the time to start rendering, and the rendering time of the hardware layer can be updated.
[0055] In one embodiment, the next rendering time of the hardware layer is calculated according to the number of renderings required within one second and the time when the rendering starts. The rendering time of the hardware layer is updated by steps 10221-10222:
[0056] Step 10221: Calculate the time interval between two adjacent renderings of the hardware layer according to the number of renderings required within one second.
[0057] First, the time interval between two adjacent renderings of the hardware layer is calculated according to the number of renderings required in one second. For example, if a hardware layer needs to be rendered 60 times in one second, 1000ms / 60 frames = 16ms / frame, that is, rendering once every 16ms, that is, the time interval between two adjacent renderings of the hardware layer is 16ms.
[0058] Step 10222: Add the time interval to the start time of rendering to obtain the next rendering time of the hardware layer, and update the rendering time of the hardware layer.
[0059] Since the hardware layer has been rendered in this cycle, the time interval is added to the start rendering time to get the next rendering time of the hardware layer, and the rendering time of the hardware layer is updated. For example, if the start rendering time in the cycle is 20ms, 20ms is added to 16ms to get the next rendering time of the hardware layer, which is 36ms, and the rendering time of the hardware layer is updated.
[0060] Step 103: If the currently queried time is not the rendering time of the currently queried hardware layer, then the next hardware layer is queried until all hardware layers are queried.
[0061] If the current query time is not the rendering time of the hardware layer currently being queried, then continue to query the next hardware layer to determine whether the next hardware layer needs to be rendered, until all hardware layers are traversed and queried. For example, if there are 10 hardware layers, in this cycle, if only 2 hardware layers need to be rendered, then only these 2 hardware layers are rendered, and other hardware layers are not rendered, thereby reducing the amount of calculation in this cycle, improving the operating efficiency, allowing more cycles to be executed in the same period of time, and increasing the number of rendering times of each hardware layer.
[0062] Step 104: Determine whether all hardware layers do not need to be rendered in this cycle.
[0063] After all hardware layers are rendered and polled in this cycle, it is determined whether all hardware layers do not need to be rendered in this cycle.
[0064] Step 105: If yes, render the target hardware layer in this cycle, the target hardware layer being the hardware layer with the fastest rendering speed in the previous cycle. If no, enter the next cycle.
[0065] If all hardware layers do not need to be rendered in this cycle, the rendering computing power will enter a dormant state, thereby wasting rendering time, causing time gaps, and reducing rendering efficiency. Therefore, when the target hardware layer is rendered in this cycle, when a time gap occurs, the hardware layer with the fastest rendering speed can be used to render to fill the time gap, thereby quickly entering the next cycle. In this embodiment, the target hardware layer is the hardware layer with the fastest rendering speed in the previous cycle. Since the target hardware layer has the fastest rendering speed in the previous cycle, the rendering computing power required by the target hardware layer is relatively small, which can increase the number of main loop rendering times. Therefore, in this embodiment, the rendering computing power corresponding to the hardware layer that does not need to be rendered in this cycle is allocated to the target hardware layer in this cycle, so that when a time gap occurs, the target hardware layer with the fastest rendering speed can be used to render to fill the time gap, so that the rendering computing power does not enter a dormant state, and the number of rendering times of the target hardware layer is increased, thereby increasing the frame rate of the target hardware layer.
[0066] Based on the above embodiment, the target hardware layer is the hardware layer with the fastest rendering speed in the previous cycle, which has a redraw area request and has not reached the preset frame rate.
[0067] The fastest rendering speed indicates that the target hardware layer requires the least rendering computing power. If there is a redraw area request, it indicates that the target hardware layer still needs to be rendered. If the preset frame rate is not reached, it indicates that the target hardware layer has not yet reached the frame rate requirement. If the target hardware layer has reached the preset frame rate, then rendering the target hardware layer again will cause the target hardware layer to exceed the preset frame rate, resulting in a waste of rendering computing power. Therefore, in this embodiment, the hardware layer with the most rendering times in the previous cycle, the redraw area request, and the hardware layer that has not yet reached the preset frame rate is used as the hardware layer.
[0068] In one embodiment, if the currently queried time is the rendering time of the currently queried hardware layer, the specific process is:
[0069] If the current query time is greater than the rendering time of the hardware layer currently being queried, the current query time is the rendering time of the hardware layer currently being queried.
[0070] In this embodiment, if the current query time is greater than the rendering time of the hardware layer currently being queried, the current query time is the rendering time of the hardware layer currently being queried. Exemplarily, for a hardware layer, if the time of the first cycle is 10ms, the rendering time of the hardware layer currently being queried is 16ms. In the first cycle, the hardware layer currently being queried has been rendered for 10 milliseconds, so the next rendering time of the hardware layer is 0+16ms=16ms. If the current query time in the second cycle is 18ms, since the rendering time of the hardware layer currently being queried is 16ms, that is, the current query time 18ms is greater than the rendering time 16ms of the hardware layer currently being queried, it means that the hardware layer needs to be rendered, and the current query time is the rendering time of the hardware layer currently being queried.
[0071] In one embodiment, if the currently queried time is the rendering time of the currently queried hardware layer, the specific process of rendering the hardware layer is:
[0072] If the currently queried time is the rendering time of the currently queried hardware layer, determine whether the hardware layer reaches the preset frame rate; if not, render the hardware layer; if so, query the next hardware layer.
[0073] In this embodiment, if the current queried time is the rendering time of the hardware layer currently queried, it is necessary to further determine whether the hardware layer should reach the preset frame rate. If it has reached it, if the hardware layer continues to be rendered, the frame rate of the hardware layer will exceed the preset frame rate, wasting rendering computing power and rendering time, and reducing rendering efficiency.
[0074] Based on the above embodiment, in the first rendering polling cycle, the currently queried time is the rendering time of the currently queried hardware layer.
[0075] In the first rendering polling cycle, the current queried time is the rendering time of the currently queried hardware layer, that is, each hardware layer needs to be rendered once, and for each hardware layer, the start time of rendering needs to be recorded and the next rendering time needs to be calculated. After that, the rendering time of each hardware layer is updated according to the next rendering time, so that in the next cycle, it can be determined whether each hardware layer needs to be rendered according to the rendering time of each hardware layer.
[0076] In one embodiment, the video player includes three hardware layers, and the three hardware layers correspond to one type, and the refresh rates required by the three hardware layers are: 30 frames (about 33.3ms / frame) for the operation interface layer, 60 frames (about 16.6ms / frame) for the bullet screen layer, and 24 frames (about 41.6ms / frame) for the video layer, and the rendering time of the operation interface layer is 10ms / frame, the rendering time of the bullet screen layer is 5ms / frame, and the rendering time of the video layer is 20ms / frame, and there will be dirty rectangles in each cycle (each cycle needs to be refreshed and redrawn);
[0077] If the hardware layer rendering method provided by the embodiment of the present invention is not used, and the hardware layer is rendered directly according to the single thread of the GUI class library, the frame rate of each hardware layer is approximately 28.6 frames = 1000ms / (5ms+10ms+20ms), and the frame rate of the barrage layer is far from the requirement, while the frame rate of the video layer is 4.6 frames more than the requirement, resulting in a waste of computing power.
[0078] If the hardware layer rendering method provided by the embodiment of the present invention is used, for example, Figure 3 As shown, in the first cycle, the operation interface layer, the bullet screen layer and the video layer are rendered respectively, and the next rendering time of the operation interface layer, the bullet screen layer and the video layer is calculated, and the rendering time of the operation interface layer, the bullet screen layer and the video layer is updated. In the second cycle, if each layer does not need to be rendered, and the bullet screen layer is the target hardware layer, the bullet screen layer is rendered in the second cycle, thereby increasing the rendering times of the bullet screen layer. By rendering the target hardware layer with the fastest rendering speed in the previous cycle and which has not reached the preset frame rate in each cycle when all hardware layers do not need to be rendered, the rendering times of the target hardware layer are increased. The result is: the frame rate of the operation interface layer is 26 frames, the frame rate of the bullet screen layer is 60 frames, and the frame rate of the video layer is 22 frames. Each hardware layer can meet the use requirements. By scheduling the rendering of the target hardware layer with the fastest rendering speed in the previous cycle to fill the time gap, the rendering computing power does not enter the dormant state, so that the next round of inquiry can be quickly entered, and the frame rates between the various hardware layers can be balanced, so that the frame rates of some hardware layers are not too low and the frame rates of some hardware layers are not too high. At the same time, since rendering is performed in each cycle, in a single-core embedded platform (a single-core embedded platform can only execute one thread at a time at a microscopic level, and threads cannot be executed in parallel), even if multiple threads are opened to render the hardware layer, due to the problems of saving and restoring the stack in multi-thread scheduling, its rendering efficiency is lower than the hardware layer rendering method provided in the embodiment of the present invention.
[0079] As described above, the embodiment of the present invention performs rendering polling on the hardware layer periodically to confirm the rendering time of the currently queried hardware layer, and the hardware layer includes at least two types; if the currently queried time is the rendering time of the currently queried hardware layer, the hardware layer is rendered, and the rendering time is updated according to the type of the hardware layer; if the currently queried time is not the rendering time of the currently queried hardware layer, the next hardware layer is queried until all hardware layers are queried; it is determined whether all hardware layers do not need to be rendered in this cycle; if so, the target hardware layer is rendered in this cycle, and the target hardware layer is the hardware layer with the fastest rendering speed in the previous cycle. The embodiment of the present invention renders the hardware layer with the fastest rendering speed in the previous cycle in each cycle when all hardware layers do not need to be rendered, so that when a time gap occurs, the target hardware layer with the fastest rendering speed in the previous cycle can be used to render to fill the time gap, thereby increasing the rendering times of the target hardware layer, so as to avoid the situation where some hardware layers are rendered too many times and other hardware layers are rendered insufficiently. The embodiments of the present invention can improve the rendering effect and rendering efficiency of the hardware layer, and in the use scenario of multiple hardware layers, the development efficiency can be improved through the GUI class library, without having to rely on multi-threading for development, which greatly improves the development cycle and improves the resource utilization of the embedded platform. The technical problem that the GUI class library in the prior art can only use one thread to render multiple hardware layers, resulting in poor rendering effect of the hardware layer, is solved.
[0080] Embodiment 2
[0081] like Figure 4 As shown, Figure 4 The present invention also provides a hardware layer rendering scheduling device, including:
[0082] The polling module 201 is used to periodically poll the hardware layer for rendering to confirm the rendering time of the currently queried hardware layer, where the hardware layer includes at least two types;
[0083] A rendering module 202, for rendering the hardware layer if the currently queried time is the rendering time of the currently queried hardware layer, and updating the rendering time according to the type of the hardware layer;
[0084] The traversal module 203 is used to query the next hardware layer if the current query time is not the rendering time of the hardware layer currently being queried, until all hardware layers are queried;
[0085] The judgment module 204 is used to judge whether all the hardware layers do not need to be rendered in this cycle;
[0086] The scheduling module 205 is used to render a target hardware layer in the current cycle when all hardware layers do not need to be rendered in the current cycle. The target hardware layer is the hardware layer with the fastest rendering speed in the previous cycle.
[0087] Based on the above embodiment, the specific process of the rendering module 202 for updating the rendering time according to the type of the hardware layer is:
[0088] Determine the time within one second at which the hardware layer starts rendering, and determine the number of times the hardware layer needs to be rendered according to the type of the hardware layer;
[0089] According to the number of renderings required within the one second and the time when the rendering starts, the next rendering time of the hardware layer is calculated, and the rendering time of the hardware layer is updated.
[0090] Based on the above embodiment, the specific process of the rendering module 202 for calculating the next rendering time of the hardware layer according to the number of rendering times required within one second and the time when the rendering starts is as follows:
[0091] Calculating the time interval between two adjacent renderings of the hardware layer according to the number of renderings required within one second;
[0092] The time interval is added to the rendering start time to obtain the next rendering time of the hardware layer, and the rendering time of the hardware layer is updated.
[0093] Based on the above embodiment, the target hardware layer is the hardware layer with the fastest rendering speed in the previous cycle, which has a redraw area request and has not reached a preset frame number.
[0094] Based on the above embodiment, the specific process of the rendering module 202 for determining if the currently queried time is the rendering time of the currently queried hardware layer is as follows:
[0095] If the current query time is greater than the rendering time of the hardware layer currently being queried, the current query time is the rendering time of the hardware layer currently being queried.
[0096] Based on the above embodiment, the rendering module 202 is used to render the hardware layer if the current query time is the rendering time of the hardware layer currently queried. The specific process is:
[0097] If the currently queried time is the rendering time of the currently queried hardware layer, determine whether the hardware layer reaches the preset frame rate; if not, render the hardware layer; if so, query the next hardware layer.
[0098] Based on the above embodiment, in the first rendering polling cycle, the currently queried time is the rendering time of the currently queried hardware layer.
[0099] Embodiment 3
[0100] This embodiment also provides a hardware layer rendering scheduling device, such as Figure 5 As shown, a hardware layer rendering scheduling device 30 includes a processor 300 and a memory 301;
[0101] The memory 301 is used to store program code 302 and transmit the program code 302 to the processor;
[0102] The processor 300 is used to execute the steps in the above-mentioned embodiment of the hardware layer rendering scheduling method according to the instructions in the program code 302.
[0103] Exemplarily, the computer program 302 may be divided into one or more modules / units, which are stored in the memory 301 and executed by the processor 300 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 302 in the terminal device 30.
[0104] The terminal device 30 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device may include, but is not limited to, a processor 300 and a memory 301. Those skilled in the art will appreciate that Figure 5 It is only an example of the terminal device 30 and does not constitute a limitation of the terminal device 30. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device may also include input and output devices, network access devices, buses, etc.
[0105] The processor 300 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.
[0106] The memory 301 may be an internal storage unit of the terminal device 30, such as a hard disk or memory of the terminal device 30. The memory 301 may also be an external storage device of the terminal device 30, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 30. Further, the memory 301 may also include both an internal storage unit of the terminal device 30 and an external storage device. The memory 301 is used to store the computer program and other programs and data required by the terminal device. The memory 301 may also be used to temporarily store data that has been output or is to be output.
[0107] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0108] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0109] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0110] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0111] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0112] Embodiment 4
[0113] An embodiment of the present invention further provides a storage medium containing computer executable instructions, wherein the computer executable instructions are used to execute a hardware layer rendering scheduling method when executed by a computer processor, the method comprising the following steps:
[0114] Periodically poll the hardware layer for rendering to confirm the rendering time of the currently queried hardware layer. The hardware layer includes at least two types;
[0115] If the currently queried time is the rendering time of the currently queried hardware layer, the hardware layer is rendered, and the rendering time is updated according to the type of the hardware layer;
[0116] If the currently queried time is not the rendering time of the currently queried hardware layer, the next hardware layer will be queried until all hardware layers have been queried;
[0117] Determine whether all hardware layers do not need to be rendered in this cycle;
[0118] If so, the target hardware layer is rendered in this cycle, and the target hardware layer is the hardware layer with the fastest rendering speed in the previous cycle.
[0119] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the embodiments of the present invention are not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the embodiments of the present invention. Therefore, although the embodiments of the present invention are described in more detail through the above embodiments, the embodiments of the present invention are not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the embodiments of the present invention, and the scope of the embodiments of the present invention is determined by the scope of the appended claims.
Claims
1. A hardware layer rendering scheduling method, characterized in that: The following steps are involved: Periodically polling the hardware layer for rendering to confirm the rendering time of the currently queried hardware layer, wherein the hardware layer includes at least two types; If the currently queried time is the rendering time of the currently queried hardware layer, the hardware layer is rendered, and the rendering time is updated according to the type of the hardware layer; If the currently queried time is not the rendering time of the currently queried hardware layer, the next hardware layer will be queried until all hardware layers have been queried; Determine whether all hardware layers do not need to be rendered in this cycle; If so, the target hardware layer is rendered in this cycle, and the target hardware layer is the hardware layer with the fastest rendering speed in the previous cycle, which has a redraw area request and has not reached the preset frame number.
2. A method for scheduling hardware layer rendering according to claim 1, characterized in that: The specific process of updating the rendering time according to the type of the hardware layer is: Determine the time when the hardware layer starts rendering, and determine the number of times the hardware layer needs to be rendered within one second according to the type of the hardware layer; According to the number of renderings required within the one second and the time when the rendering starts, the next rendering time of the hardware layer is calculated, and the rendering time of the hardware layer is updated.
3. A method for scheduling hardware layer rendering according to claim 2, characterized in that: The specific process of calculating the next rendering time of the hardware layer according to the number of rendering times required within one second and the time when the rendering starts is as follows: Calculating the time interval between two adjacent renderings of the hardware layer according to the number of renderings required within one second; The time interval is added to the rendering start time to obtain the next rendering time of the hardware layer, and the rendering time of the hardware layer is updated.
4. A method for scheduling hardware layer rendering according to claim 1, characterized in that: The specific process of if the currently queried time is the rendering time of the currently queried hardware layer is: If the current query time is greater than the rendering time of the hardware layer currently being queried, the current query time is the rendering time of the hardware layer currently being queried.
5. The method for scheduling hardware layer rendering according to claim 1, characterized in that: If the currently queried time is the rendering time of the currently queried hardware layer, the specific process of rendering the hardware layer is as follows: If the currently queried time is the rendering time of the currently queried hardware layer, determine whether the hardware layer reaches the preset frame rate; If not, render the hardware layer; If yes, then ask for the next hardware layer.
6. A method for scheduling hardware layer rendering according to claim 1, characterized in that: In the first rendering polling cycle, the currently queried time is the rendering time of the currently queried hardware layer.
7. A hardware layer rendering scheduling device, characterized in that: include: A polling module, used for periodically polling the hardware layer for rendering, and confirming the rendering time of the currently queried hardware layer, wherein the hardware layer includes at least two types; A rendering module, for rendering the hardware layer if the currently queried time is the rendering time of the currently queried hardware layer, and updating the rendering time according to the type of the hardware layer; The traversal module is used to query the next hardware layer if the current query time is not the rendering time of the hardware layer currently being queried, until all hardware layers are queried; A judgment module is used to judge whether all hardware layers do not need to be rendered in this cycle; The scheduling module is used to render the target hardware layer in this cycle when all hardware layers do not need to be rendered in this cycle. The target hardware layer is the hardware layer with the fastest rendering speed in the previous cycle, which has a redraw area request and has not reached a preset frame number.
8. A hardware layer rendering scheduling device, characterized in that: The device comprises a processor and a memory; The memory is used to store program code and transmit the program code to the processor; The processor is used to execute a hardware layer rendering scheduling method as described in any one of claims 1-6 according to the instructions in the program code.
9. A storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the hardware layer rendering method as described in any one of claims 1 to 6 when executed by a computer processor.
