Resource data rendering method and device, storage medium and electronic equipment

By compiling pipeline state objects into hard disk space and storing them according to rendering levels, and only loading them into memory when needed, the problem of low resource data rendering efficiency is solved and more efficient resource data rendering is achieved.

CN119336483APending Publication Date: 2025-01-21TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310916273.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-21
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

In the prior art, the rendering efficiency of resource data is low, mainly due to the excessive use of memory space, resulting in the performance of terminal devices being degraded.

Method used

By compiling all pipeline state objects into the hard disk space of the terminal device and storing them according to the rendering level of each pipeline state object, only when needed, the matching pipeline state object is read from the hard disk space and loaded into the memory space for caching.

Benefits of technology

It reduces the memory space occupied by pipeline status objects, saves compilation steps, and improves the rendering efficiency of resource data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119336483A_ABST
    Figure CN119336483A_ABST
Patent Text Reader

Abstract

The invention discloses a resource data rendering method and device, a storage medium and electronic equipment. The method comprises the following steps: rendering target resource data in each rendering scene to obtain all pipeline state objects generated by the target resource data; compiling all the pipeline state objects into a hard disk space of the terminal equipment, and storing the pipeline state objects according to the rendering level allocated to each pipeline state object in all the pipeline state objects; obtaining a target rendering request triggered for the target resource data; in response to the target rendering request, reading a target pipeline state object matched with the target rendering level from a hard disk space, and loading the target pipeline state object into a memory space of the terminal device for caching; and reading the target pipeline state object from the memory space, and performing rendering of the target rendering level on the target resource data by using the target pipeline state object. The technical problem that the rendering efficiency of the resource data is low is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and in particular to a rendering method, device, storage medium and electronic device for resource data. Background Art

[0002] In resource data rendering scenarios, all pipeline state objects are usually compiled into the terminal device's memory space for caching to improve the terminal device's rendering efficiency of resource data. However, excessive memory space occupation will also reduce the performance of the terminal device, which will lead to low resource data rendering efficiency. Therefore, there is a problem of low resource data rendering efficiency.

[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0004] The embodiments of the present application provide a method, device, storage medium and electronic device for rendering resource data, so as to at least solve the technical problem of low efficiency in rendering resource data.

[0005] According to one aspect of an embodiment of the present application, a method for rendering resource data is provided, including: rendering target resource data in each rendering scene to obtain all pipeline state objects generated by the target resource data; compiling all pipeline state objects into the hard disk space of a terminal device, and storing them according to the rendering level assigned to each pipeline state object in all pipeline state objects; obtaining a target rendering request triggered by the target resource data, wherein the target rendering request is used to request the terminal device to render the target resource data at a target rendering level; in response to the target rendering request, reading a target pipeline state object matching the target rendering level from the hard disk space, and loading the target pipeline state object into the memory space of the terminal device for caching; reading the target pipeline state object from the memory space, and using the target pipeline state object to render the target resource data at the target rendering level.

[0006] According to another aspect of an embodiment of the present application, a rendering device for resource data is also provided, including: a first rendering unit, used to render target resource data in each rendering scene, and obtain all pipeline state objects generated by the above target resource data; a compilation unit, used to compile all the above pipeline state objects into the hard disk space of the terminal device, and store them according to the rendering level assigned to each pipeline state object in all the above pipeline state objects; an acquisition unit, used to obtain a target rendering request triggered by the above target resource data, wherein the above target rendering request is used to request the above terminal device to render the above target resource data at the target rendering level; a first cache unit, used to respond to the above target rendering request, read the target pipeline state object matching the above target rendering level from the above hard disk space, and load the above target pipeline state object into the memory space of the above terminal device for caching; a second rendering unit, used to read the above target pipeline state object from the above memory space, and use the above target pipeline state object to render the above target resource data at the above target rendering level.

[0007] As an optional solution, the above-mentioned device also includes: a second cache unit, which is used to read the above-mentioned target pipeline state object from the above-mentioned memory space and use the above-mentioned target pipeline state object to render the above-mentioned target resource data at the above-mentioned target rendering level, in response to a new rendering request triggered by the above-mentioned target resource data, read the pipeline state object matching the new rendering level from the above-mentioned hard disk space, and load the pipeline state object matching the new rendering level into the above-mentioned memory space for caching, wherein the above-mentioned new rendering request is used to request the above-mentioned terminal device to render the above-mentioned target resource data at the above-mentioned new rendering level; a third rendering unit, which is used to read the above-mentioned target pipeline state object from the above-mentioned memory space and use the above-mentioned target pipeline state object to render the above-mentioned target resource data at the above-mentioned target rendering level, and use the pipeline state object matching the new rendering level to render the above-mentioned target resource data at the above-mentioned target rendering level.

[0008] As an optional solution, the above-mentioned second cache unit includes: a first determination module, used to determine the first pipeline state object among the pipeline state objects matching the above-mentioned new rendering level that is not cached in the above-mentioned memory space; a second determination module, used to determine the second pipeline state object cached in the above-mentioned memory space that does not match the above-mentioned new rendering level; and a replacement module, used to use the above-mentioned first pipeline state object to replace the above-mentioned second pipeline state object in the above-mentioned memory space.

[0009] As an optional solution, the above-mentioned device also includes: a switching module, which is used to switch the above-mentioned current display interface to a non-process interface before or during the use of the above-mentioned first pipeline state object to replace the above-mentioned second pipeline state object in the above-mentioned memory space, when the data volume of the above-mentioned second pipeline state object is greater than or equal to a first preset threshold and the current display interface of the above-mentioned terminal device is a process interface.

[0010] As an optional scheme, the above-mentioned compilation unit includes: a first compilation module, which is used to compile all the above-mentioned pipeline state objects into the above-mentioned hard disk space in response to the first rendering request triggered by the above-mentioned target resource data, wherein the above-mentioned first rendering request is the first request for requesting the above-mentioned terminal device to render the above-mentioned target resource data, and the above-mentioned target rendering request is not the above-mentioned first rendering request.

[0011] As an optional solution, the above-mentioned device also includes: an allocation module, which is used to allocate a corresponding binary mask value to each pipeline state object in all the above-mentioned pipeline state objects before compiling all the above-mentioned pipeline state objects into the hard disk space of the terminal device, wherein different above-mentioned binary mask values ​​correspond to different above-mentioned rendering levels; the above-mentioned compilation module includes: a calculation submodule, which is used to set the target mask value to 0 in response to the above-mentioned first rendering request, and respectively calculate the first bitwise AND result between the above-mentioned target mask value and each above-mentioned binary mask value; a determination submodule, which is used to correspond the above-mentioned first bitwise AND result equal to the above-mentioned target mask value The above pipeline state object is determined as a compilation object; a compilation submodule is used to compile the above compilation object into the above hard disk space; the above first cache unit includes: a setting module, which is used to respond to the above target rendering request, set the above target mask value to the mask value corresponding to the above target rendering level, and respectively calculate the second bitwise AND result between the above target mask value and each of the above binary mask values; a third determination module is used to determine the above pipeline state object corresponding to the above second bitwise AND result equal to the above target mask value as a loading object; a cache module is used to read the above loading object from the above hard disk space and load it into the above memory space for caching.

[0012] As an optional solution, the above-mentioned device also includes at least one of the following: a whitelist unit, which is used to render the target resource data in each rendering scene and obtain all pipeline state objects generated by the target resource data, and then determine the first pipeline state object in the whitelist from all the above pipeline state objects, wherein the first pipeline state object is set to be compiled into the above-mentioned memory space for caching and is prohibited from being deleted from the above-mentioned memory space; a blacklist unit, which is used to render the target resource data in each rendering scene and obtain all pipeline state objects generated by the target resource data, and then determine the second pipeline state object in the blacklist from all the above pipeline state objects, wherein the second pipeline state object is set to be prohibited from being compiled or loaded into the above-mentioned hard disk space and the above-mentioned memory space.

[0013] As an optional solution, the above-mentioned whitelist unit includes: an acquisition module for obtaining the usage frequency of each of the above-mentioned pipeline status objects in the above-mentioned terminal device; and a placement module for placing the pipeline status objects corresponding to the above-mentioned usage frequency greater than or equal to the second preset threshold into the above-mentioned whitelist.

[0014] As an optional solution, the compilation unit includes: a second compilation module, which is used to compile all the pipeline state objects into the hard disk space in the form of program binary cache.

[0015] According to another aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above resource data rendering method.

[0016] According to another aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the resource data rendering method through the computer program.

[0017] In an embodiment of the present application, the target resource data in each rendering scene is rendered to obtain all pipeline state objects generated by the target resource data; all the pipeline state objects are compiled into the hard disk space of the terminal device, and stored according to the rendering level assigned to each pipeline state object in all the pipeline state objects; a target rendering request triggered by the target resource data is obtained, wherein the target rendering request is used to request the terminal device to render the target resource data at a target rendering level; in response to the target rendering request, a target pipeline state object matching the target rendering level is read from the hard disk space, and the target pipeline state object is loaded into the memory space of the terminal device for caching; the target pipeline state object is read from the memory space, and the target resource data is rendered at the target rendering level using the target pipeline state object.

[0018] Considering that excessive memory space occupancy will reduce the performance of the terminal device, this embodiment does not compile all pipeline state objects directly into the memory space, but first compiles all the above pipeline state objects into the hard disk space, and then reads some pipeline state objects that match the current rendering level from the hard disk space through the rendering level assigned to each pipeline state object in all the above pipeline state objects, and loads them into the memory space, thereby achieving the purpose of reducing the amount of pipeline state objects occupied in the memory space. In addition, since the pipeline state objects have been pre-compiled into the hard disk space, the pipeline state objects loaded into the memory space also save the compilation steps, thereby achieving the technical effect of improving the rendering efficiency of resource data, thereby solving the technical problem of low rendering efficiency of resource data. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0020] Figure 1 is a schematic diagram of an application environment of an optional resource data rendering method according to an embodiment of the present application;

[0021] Figure 2 is a schematic diagram of a process of an optional resource data rendering method according to an embodiment of the present application;

[0022] Figure 3 is a schematic diagram of an optional resource data rendering method according to an embodiment of the present application;

[0023] Figure 4 is a schematic diagram of another optional resource data rendering method according to an embodiment of the present application;

[0024] Figure 5 is a schematic diagram of another optional resource data rendering method according to an embodiment of the present application;

[0025] Figure 6 is a schematic diagram of another optional resource data rendering method according to an embodiment of the present application;

[0026] Figure 7 is a schematic diagram of another optional resource data rendering method according to an embodiment of the present application;

[0027] Figure 8 is a schematic diagram of another optional resource data rendering method according to an embodiment of the present application;

[0028] Fig. 9 is a schematic diagram of another optional resource data rendering method according to an embodiment of the present application;

[0029] Fig.10 is a schematic diagram of another optional resource data rendering method according to an embodiment of the present application;

[0030] Fig.11 is a schematic diagram of an optional resource data rendering device according to an embodiment of the present application;

[0031] Fig.12 It is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0032] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0034] According to one aspect of an embodiment of the present application, a method for rendering resource data is provided. Optionally, as an optional implementation, the method for rendering resource data can be but is not limited to being applied to: Figure 1 In the environment shown, it may include but is not limited to a user device 102 (terminal device), and the user device 102 may include but is not limited to a display 104, a processor 106 and a memory 108, wherein the memory 108 may include but is not limited to a hard disk space 110 and a memory space 112.

[0035] The specific process can be as follows:

[0036] Step S102, the user device 102 renders the target resource data in each rendering scene through the processor 106 to obtain all pipeline state objects generated by the target resource data;

[0037] Step S104, the user device 102 compiles all pipeline state objects into the hard disk space 110 of the terminal device through the processor 106, and stores them according to the rendering level assigned to each pipeline state object in all pipeline state objects;

[0038] Steps S106-S108, the user device 102 obtains a target rendering request triggered by the target resource data, and responds to the target rendering request through the processor 106, reads a target pipeline state object matching the target rendering level from the hard disk space 110, and loads the target pipeline state object into the memory space 112 of the terminal device for caching;

[0039] In step S110 , the user device 102 reads a target pipeline state object from the memory space 112 via the processor 106 , and uses the target pipeline state object to render target resource data at a target rendering level.

[0040] remove Figure 1In addition to the examples shown, the above steps can be completed independently by the user device or the server, or by the user device and the server working together. The user device 102 includes but is not limited to a handheld device (such as a mobile phone), a laptop, a tablet computer, a desktop computer, a vehicle-mounted device, a smart TV, etc., and the present application does not limit the specific implementation of the user device 102. The server can be a single server or a server cluster consisting of multiple servers, or a cloud server.

[0041] Optionally, as an optional implementation, as Figure 2 As shown, the resource data rendering method can be executed by an electronic device, such as a server, or Figure 1 The user equipment shown in the figure comprises the following specific steps:

[0042] S202, rendering the target resource data in each rendering scene to obtain all pipeline state objects generated by the target resource data;

[0043] S204, compiling all pipeline state objects into the hard disk space of the terminal device, and storing them according to the rendering level assigned to each pipeline state object in all pipeline state objects;

[0044] S206, obtaining a target rendering request triggered by the target resource data, wherein the target rendering request is used to request the terminal device to render the target resource data at a target rendering level;

[0045] S208, responding to the target rendering request, reading a target pipeline state object that matches the target rendering level from the hard disk space, and loading the target pipeline state object into the memory space of the terminal device for caching;

[0046] S210, reading a target pipeline state object from the memory space, and rendering target resource data at a target rendering level using the target pipeline state object.

[0047] Optionally, in this embodiment, the rendering method of the above-mentioned resource data can be but is not limited to being applied in a scenario in which a pipeline state object (PSO) cache is added to a virtual engine (Unreal Engine for short UE) project. Adding a PSO cache to a UE project can reduce the jamming that occurs during the loading process, such as obtaining all resource data of the game application in each scene in advance, and then creating a list of all shaders (Shaders) used by materials in a UE project through all the resource data. The shader list will be used to speed up the compilation process of the UE4 project when it encounters these shaders for the first time. Among them, shaders can be but are not limited to being used to implement image rendering, and are editable programs used to replace fixed rendering pipelines, which are also a type of pipeline state objects.

[0048] To further illustrate, optionally, for example, on the basis of adding a PSO cache to a UE project, this embodiment provides a processing flow for grading the PSO cache based on the rendering level, and combines hard disk space and memory space for assisting caching, which not only saves compilation time, but also reduces the memory space occupied by the program when the terminal device is running.

[0049] Optionally, in this embodiment, the rendering scene can be understood but not limited to being a scene that can be presented through a rendering operation. Taking the game scene as an example, rendering the target resource data under each rendering scene can be understood but not limited to being understood as covering all game scenes in the process of rendering the target resource data, or in other words, completely calculating and rendering all visible objects or environments in all game scenes.

[0050] Optionally, in this embodiment, all pipeline state objects generated by the target resource data can be understood but not limited to all pipeline state objects generated when the target resource data is rendered, wherein the target resource data can be understood but not limited to resource data of visible objects or environments in the rendering scene, and the resource data can be understood but not limited to various materials and information that can be used for rendering, such as image resource data (character models, prop models, scene maps, UI interfaces, icons and other image files, etc.), model resource data (three-dimensional character models, prop models, environment models, etc.), etc.

[0051] Optionally, in this embodiment, in order to obtain all pipeline state objects generated when the target resource data is rendered in each rendering scene, the corresponding rendering toolkit can be executed through the terminal device but is not limited to, and the target resource data in each rendering scene is rendered in sequence. The target resource data can be map resources, character resources, skill effect resources, etc. In this way, the target resource data in each rendering scene can be rendered in sequence to generate materials, shaders, primitives, etc., and the elements involved in rendering can be determined as pipeline state objects. Subsequently, the corresponding target resource data can be quickly obtained by rendering through the pipeline state object, which will not cause the processor load, thereby improving the rendering efficiency of resource data.

[0052] Optionally, in this embodiment, the memory space (Memory) of the terminal device is also called internal memory, which is used to temporarily store the calculation data in the CPU and the data exchanged with the external memory such as the hard disk. As long as the computer is running, the CPU will transfer the data to be calculated to the memory for calculation. When the calculation is completed, the CPU will transmit the result. The operation of the memory also determines the stable operation of the computer. The hard disk space of the terminal device is the data storage device of the computer, which is used to save data that is not temporarily used for calculation. For data processing, the hard disk space mainly affects the data search speed, but has less impact on the operation performance. The memory space directly communicates with the CPU and directly displays the data generated by the conversation, so it has more impact on the operation performance of the terminal device. In other words, storing all pipeline state objects in the hard disk space has less impact on the operation performance of the terminal device than storing all pipeline state objects in the memory space.

[0053] Optionally, in this embodiment, the rendering level assigned to each pipeline state object in all pipeline state objects can be understood, but not limited to, as a plurality of rendering levels that can be provided by the corresponding terminal device, such as a high-quality rendering level, a medium-quality rendering level, and a low-quality rendering level, and there are also differences in the pipeline state objects corresponding to the rendering levels of different qualities, such as a high-quality rendering level involves a larger number of pipeline state objects, and a low-quality rendering level involves a smaller number of pipeline state objects, or a high-quality rendering level involves a pipeline state object that consumes more rendering resources, and a low-quality rendering level involves a pipeline state object that consumes fewer rendering resources, etc.;

[0054] In addition, the pipeline state object corresponding to the high-quality rendering level can completely contain the pipeline state object corresponding to the low-quality rendering level, or it can be, but not limited to, incompletely contained, but an overlay relationship. For example, if a special effect is shared by the low-quality rendering level and the medium-quality rendering level, and the performance effect is the same, then the pipeline state object used for rendering this special effect should be the intersection of the pipeline state objects belonging to the low-quality rendering level and the medium-low quality rendering level, such as Figure 3 As shown in the figure, the pipeline state objects corresponding to the high-quality rendering level, medium-quality rendering level, and low-quality rendering level are in an overlapping relationship. If a special effect is exclusive to the low-quality rendering level, then the pipeline state object used when rendering this special effect is exclusive to the low-quality rendering level.

[0055] It should be noted that if all pipeline state objects are compiled into the memory space for storage, the operating performance of the terminal device will be reduced due to the excessive memory space occupancy, which will in turn reduce the rendering efficiency of the resource data; and if some pipeline state objects are selectively compiled into the memory space for storage, under various rendering requirements, the rendering success rate of the pipeline state objects cannot be guaranteed, or there is a certain probability that the corresponding pipeline state object cannot be found in the memory space for rendering. If the corresponding pipeline state object cannot be found, the PSO cache mechanism cannot be implemented, and the rendering efficiency of the resource data will also be reduced.

[0056] It can be seen that whether all pipeline state objects are compiled into the memory space for storage or some pipeline state objects are selectively compiled into the memory space for storage, the rendering efficiency of resource data cannot be improved. Further, in this embodiment, in order to truly improve the rendering efficiency of resource data, all pipeline state objects are first compiled into the hard disk space, and then, through the rendering level assigned to each pipeline state object in all pipeline state objects, some pipeline state objects matching the current rendering level are read from the hard disk space and loaded into the memory space, thereby achieving the purpose of reducing the amount of pipeline state objects occupied in the memory space. In addition, since the pipeline state objects have been pre-compiled into the hard disk space, the pipeline state objects loaded into the memory space also save the compilation steps, thereby achieving the technical effect of improving the rendering efficiency of resource data.

[0057] To further illustrate, the optional Figure 4 As shown, the target resource data 402 in each rendering scene is rendered to obtain all pipeline state objects 404 generated when the target resource data 402 is rendered; all pipeline state objects 404 are compiled into the hard disk space 408-1 of the terminal device 406, and stored according to the rendering level assigned to each pipeline state object 404 in all pipeline state objects 404; a target rendering request 410 triggered on the target resource data 402 is obtained, wherein the target rendering request 410 is used to request the terminal device 406 to render the target resource data 402 at a target rendering level 412; in response to the target rendering request 410, a target pipeline state object 414 matching the target rendering level 412 is read from the hard disk space 408-1, and the target pipeline state object 414 is loaded into the memory space 408-2 of the terminal device 406 for caching; the target pipeline state object 414 is read from the memory space 408-2, and the target resource data 402 is rendered at the target rendering level 412 using the target pipeline state object 414.

[0058] Through the embodiments provided by the present application, the target resource data in each rendering scene is rendered to obtain all pipeline state objects generated by the target resource data; all pipeline state objects are compiled into the hard disk space of the terminal device, and stored according to the rendering level assigned to each pipeline state object in all pipeline state objects; a target rendering request triggered by the target resource data is obtained, wherein the target rendering request is used to request the terminal device to render the target resource data at a target rendering level; in response to the target rendering request, a target pipeline state object matching the target rendering level is read from the hard disk space, and the target pipeline state object is loaded into the memory space of the terminal device for caching; the target pipeline state object is read from the memory space, and the target resource data is rendered at a target rendering level using the target pipeline state object. Considering that excessive memory space occupation will reduce the performance of the terminal device, this embodiment does not compile all pipeline state objects directly into the memory space, but first compiles all pipeline state objects into the hard disk space, and then reads some pipeline state objects that match the current rendering level from the hard disk space through the rendering level assigned to each pipeline state object in all pipeline state objects, and loads them into the memory space, thereby achieving the purpose of reducing the amount of pipeline state objects occupied in the memory space. In addition, since the pipeline state objects have been pre-compiled into the hard disk space, the pipeline state objects loaded into the memory space also save the compilation steps, thereby achieving the technical effect of improving the rendering efficiency of resource data.

[0059] As an optional solution, after reading the target pipeline state object from the memory space and rendering the target resource data at the target rendering level using the target pipeline state object, the method further includes:

[0060] S1-1, in response to a new rendering request triggered by target resource data, read a pipeline state object matching a new rendering level from a hard disk space, and load the pipeline state object matching the new rendering level into a memory space for caching, wherein the new rendering request is used to request a terminal device to render the target resource data at a new rendering level;

[0061] S1-2, read a new pipeline state object that matches the rendering level from the memory space, and use the new pipeline state object that matches the rendering level to render the target resource data at the target rendering level.

[0062] Optionally, in this embodiment, rendering requests corresponding to different rendering levels can be understood, but not limited to, as the user of the terminal device actively or passively adjusting the rendering level. Taking a virtual game as an example, the user can determine different rendering levels by adjusting the picture quality of the virtual game.

[0063] It should be noted that, when rendering level A has been determined and the pipeline state object corresponding to rendering level A has been cached in the memory space, the rendering efficiency of the target resource data of rendering level A can be improved. However, if the new rendering request requests the rendering of the target resource data of rendering level B, the pipeline state object cached in the memory space may not meet the requirements of rendering level B. However, if the pipeline state object corresponding to rendering level B is recompiled, the time taken for compilation will reduce the rendering efficiency of the resource data. Furthermore, in this embodiment, the pipeline state object corresponding to rendering level B is determined from all pipeline state objects compiled in the hard disk space in advance, and then the pipeline state object corresponding to rendering level B is loaded into the memory space to improve the rendering efficiency of the target resource data of the new rendering level (rendering level B).

[0064] Through the embodiments provided by the present application, in response to a new rendering request triggered by target resource data, a pipeline state object matching a new rendering level is read from a hard disk space, and the pipeline state object matching the new rendering level is loaded into a memory space for caching, wherein the new rendering request is used to request a terminal device to render the target resource data at a new rendering level; the pipeline state object matching the new rendering level is read from the memory space, and the target resource data is rendered at a target rendering level using the pipeline state object matching the new rendering level, thereby achieving the purpose of reducing the time used to recompile the pipeline state object corresponding to the new rendering level, thereby achieving the technical effect of improving the rendering efficiency of the target resource data of the new rendering level.

[0065] As an optional solution, load the pipeline state object matching the new rendering level into the memory space for caching, including:

[0066] S2-1, determining a first pipeline state object that is not cached in the memory space among pipeline state objects that match the new rendering level;

[0067] S2-2, determining a second pipeline state object that is cached in the memory space and does not match the new rendering level;

[0068] S2-3, use the first pipeline state object to replace the second pipeline state object in the memory space.

[0069] It should be noted that, in order to improve the processing efficiency of pipeline state objects, when some pipeline state objects currently required are cached in the memory space, only pipeline state objects that are not currently required will be replaced instead of replacing all pipeline state objects.

[0070] To further illustrate, the optional Figure 5As shown, it is assumed that the pipeline state objects that match the new rendering level include pipeline state object 1, pipeline state object 2, and pipeline state object 3, and the pipeline state objects cached in memory space 502 include pipeline state object 1, pipeline state object 4, and pipeline state object 5, then pipeline state object 4 and pipeline state object 5 cached in memory space 502 that do not match the new rendering level are determined, and pipeline state object 2 and pipeline state object 3 that match the new rendering level are used to replace pipeline state object 4 and pipeline state object 5 cached in memory space 502.

[0071] Through the embodiments provided by the present application, a first pipeline state object that is not cached in the memory space and matches the new rendering level is determined; a second pipeline state object that is cached in the memory space and does not match the new rendering level is determined; and the first pipeline state object is used to replace the second pipeline state object in the memory space, thereby achieving the purpose of replacing only pipeline state objects that are not currently needed, thereby realizing the technical effect of improving the efficiency of pipeline state object processing.

[0072] As an optional solution, before or during the process of using the first pipeline state object to replace the second pipeline state object in the memory space, the method further includes:

[0073] When the data volume of the second pipeline state object is greater than or equal to the first preset threshold and the current display interface of the terminal device is a process interface, the current display interface is switched to a non-process interface.

[0074] It should be noted that the process interface can be but is not limited to being understood as an interface that is more sensitive to user perception. In the process interface, if a jamming problem occurs due to the use of the first pipeline state object to replace the second pipeline state object in the memory space, the user will perceive the jamming problem more clearly and aggravate the negative impact on the user experience. Therefore, in order to reduce the negative impact (assuming it is negative impact A), this embodiment switches the process interface to a non-process interface, so that the user can suddenly feel the above jamming problem in the non-process interface.

[0075] In addition, switching the process interface to the non-process interface will also make the user feel disconnected, or the interface switching will also have a negative impact (assuming it is negative impact B). Therefore, this embodiment determines that the data volume of the second pipeline state object is greater than or equal to the first preset threshold and the current display interface of the terminal device is the process interface as a situation with a higher probability of a lag problem. Only in this case will the interface switch be performed to simultaneously eliminate negative impact A and negative impact B.

[0076] To further illustrate, the optional Figure 6As shown, the process interface 602 is the process interface of the virtual game. During the display of the process interface, the user adjusted the image quality and further triggered the use of the first pipeline state object to replace the second pipeline state object in the memory space. When the data volume of the second pipeline state object is greater than or equal to the first preset threshold, the process interface 602 is switched to the non-process interface 604, wherein the non-process interface 604 is the login interface of the virtual game.

[0077] Through the embodiments provided by the present application, when the data volume of the second pipeline status object is greater than or equal to the first preset threshold and the current display interface of the terminal device is a process interface, the current display interface is switched to a non-process interface, thereby achieving the purpose of reducing the negative impact caused by the change of the pipeline status object, thereby realizing the technical effect of improving the user experience.

[0078] As an optional solution, compile all pipeline state objects to the hard disk space of the terminal device, including:

[0079] In response to the first rendering request triggered by the target resource data, all pipeline state objects are compiled into the hard disk space, wherein the first rendering request is the first request for requesting the terminal device to render the target resource data, and the target rendering request is not the first rendering request.

[0080] It should be noted that in order to improve the processing efficiency of pipeline state objects, rendering requests are divided into two cases: the first pipeline state object and the non-pipeline state object. Specifically, when the first rendering request is obtained, the target resource data under each rendering scene is rendered, and all pipeline state objects generated by the target resource data are obtained, and all pipeline state objects are compiled into the hard disk space; when a non-first rendering request is obtained, the pipeline state object that matches the current rendering level is read from the hard disk space, and the pipeline state object that matches the current rendering level is loaded into the memory space of the terminal device for caching to achieve the rendering of the target resource data.

[0081] Through the embodiments provided by the present application, in response to the first rendering request triggered by the target resource data, all pipeline state objects are compiled into the hard disk space, wherein the first rendering request is the first request for requesting the terminal device to render the target resource data, and the target rendering request is not the first rendering request, thereby achieving the purpose of dividing the rendering request into two cases: the first pipeline state object and the non-pipeline state object, thereby achieving the technical effect of improving the processing efficiency of pipeline state objects.

[0082] As an optional solution, before compiling all pipeline state objects into the hard disk space of the terminal device, the method further includes: assigning a corresponding binary mask value to each pipeline state object in all pipeline state objects, wherein different binary mask values ​​correspond to different rendering levels;

[0083] In response to the first render request triggered for the target resource data, all pipeline state objects are compiled into disk space, including:

[0084] S3-1, in response to the first rendering request, setting the target mask value to 0, and respectively calculating the first bitwise AND result between the target mask value and each binary mask value;

[0085] S3-2, determining the pipeline state object corresponding to the first bitwise AND result equal to the target mask value as the compilation object;

[0086] S3-3, compile the compilation object into the hard disk space;

[0087] In response to the target rendering request, the target pipeline state object matching the target rendering level is read from the hard disk space, including:

[0088] S4-1, responding to the target rendering request, setting the target mask value to the mask value corresponding to the target rendering level, and respectively calculating the second bitwise AND result between the target mask value and each binary mask value;

[0089] S4-2, determining the pipeline state object corresponding to the second bitwise AND result equal to the target mask value as the load object;

[0090] S4-3, read the loading object from the hard disk space and load it into the memory space for caching.

[0091] It should be noted that different binary mask values ​​(mask) correspond to different rendering levels, and the bitwise AND results between the target mask value and each binary mask value are calculated respectively. The pipeline state object to be compiled or loaded can be determined by judging whether the bitwise AND result is equal to the target mask value, and then different pipeline state object processing methods can be flexibly implemented by setting different target mask values. For example, the target mask value is set to 0, and the bitwise AND result between 0 and any binary mask value is 0, and then all pipeline state objects can be obtained to meet the response requirements of the first rendering request.

[0092] Through the embodiments provided by the present application, a corresponding binary mask value is assigned to each pipeline state object in all pipeline state objects, wherein different binary mask values ​​correspond to different rendering levels; in response to the first rendering request, the target mask value is set to 0, and the first bitwise AND result between the target mask value and each binary mask value is calculated respectively; the pipeline state object corresponding to the first bitwise AND result equal to the target mask value is determined as a compiled object; the compiled object is compiled into the hard disk space; in response to the target rendering request, the target mask value is set to the mask value corresponding to the target rendering level, and the second bitwise AND result between the target mask value and each binary mask value is calculated respectively; the pipeline state object corresponding to the second bitwise AND result equal to the target mask value is determined as a loaded object; the loaded object is read from the hard disk space and loaded into the memory space for caching, thereby achieving the purpose of determining the pipeline state object to be compiled or loaded by judging whether the bitwise AND result is equal to the target mask value, thereby achieving the technical effect of flexibly implementing different pipeline state object processing methods.

[0093] As an optional solution, after rendering the target resource data in each rendering scene and obtaining all pipeline state objects generated by the target resource data, the method further includes at least one of the following:

[0094] Determine a first pipeline state object in the whitelist from all pipeline state objects, wherein the first pipeline state object is set to be compiled into the memory space for caching and is prohibited from being deleted from the memory space;

[0095] A second pipeline state object in the blacklist is determined from all pipeline state objects, wherein the second pipeline state object is set to be prohibited from being compiled or loaded into the hard disk space and the memory space.

[0096] It should be noted that, although determining the required pipeline state objects by rendering level can control the amount of memory space occupied, it is not suitable for a variety of application scenarios. Therefore, by setting whitelists and blacklists, some specific pipeline state objects are set to be the first pipeline state objects that are not affected by the rendering level and remain in the memory space for a long time, or the second pipeline state objects that are not affected by the rendering level and are prohibited from being compiled or loaded into the hard disk space and memory space, so as to adapt to a variety of application scenarios and thereby improve the management efficiency of pipeline state objects.

[0097] Through the embodiments provided by the present application, a first pipeline state object located in a whitelist is determined from all pipeline state objects, wherein the first pipeline state object is set to be compiled into a memory space for caching and is prohibited from being deleted from the memory space; a second pipeline state object located in a blacklist is determined from all pipeline state objects, wherein the second pipeline state object is set to be prohibited from being compiled or loaded into a hard disk space and a memory space, thereby achieving the purpose of adapting to a variety of application scenarios through a variety of management methods of pipeline state objects, thereby achieving the technical effect of improving the management efficiency of pipeline state objects.

[0098] As an optional solution, determining the first pipeline state object in the whitelist from all pipeline state objects includes:

[0099] S5-1, obtaining the usage frequency of each pipeline status object in the terminal device;

[0100] S5-2, putting pipeline status objects corresponding to usage frequencies greater than or equal to a second preset threshold into a whitelist.

[0101] It should be noted that some pipeline state objects can be compiled into the memory space for caching in advance, and the selection criteria can be based on the frequency of use. The pipeline state objects with higher usage frequency can be compiled into the memory space for caching in advance. The condition of higher usage frequency also limits the number of objects compiled into the memory space for caching in advance, which not only does not occupy too much space in the memory space, but also saves the steps of reading from the hard disk space and then loading it into the memory space, so as to improve the overall rendering efficiency of resource data.

[0102] Through the embodiments provided in the present application, the usage frequency of each pipeline state object in the terminal device is obtained; the pipeline state objects corresponding to the usage frequency greater than or equal to the second preset threshold are placed in the whitelist, thereby achieving the purpose of not occupying too much space in the memory space and eliminating the steps of reading from the hard disk space and then loading it into the memory space, thereby achieving the technical effect of improving the overall rendering efficiency of resource data.

[0103] As an optional solution, compile all pipeline state objects to the hard disk space of the terminal device, including:

[0104] Compile all pipeline state objects into disk space in the form of program binary cache.

[0105] It should be noted that the Program Binary Cache is the program file output by the program object created after the platform compiles the Shader, which can support the subsequent direct loading of these program objects without recompilation. In other words, after all pipeline state objects are compiled into the hard disk space in the form of program binary cache, the recompilation step can be omitted in the process of loading the pipeline state objects in the hard disk into the memory space, so as to improve the overall rendering efficiency of resource data.

[0106] Through the embodiments provided in the present application, all pipeline state objects are compiled into the hard disk space in the form of program binary cache, thereby achieving the purpose of eliminating the recompilation step, thereby achieving the technical effect of improving the overall rendering efficiency of resource data.

[0107] As an optional solution, for ease of understanding, the rendering method of the above resource data is applied to the PSO process of the UE project. Optionally, in the PSO process, the existing mobile terminal package is run to cover all game scenes as much as possible. After these use cases are run, the PSO cache (file format is rec.upipelinecache) is collected, and these PSO caches and the material information files generated when building the mobile terminal package (UE format is scl.csv file, UE format is shk file) are compiled together to generate a new description file (file format is stablepc.csv). These description files will be entered into the package the next time the mobile terminal package is built and become PSO cache files (file format is stable.upipelinecache) available when this embodiment is running. The subsequent iterations are similar, collecting caches from the previous package, compiling and packaging, and taking effect in the next mobile terminal package.

[0108] In addition, the mobile platform can read the PSO cache file in the package at the beginning of each run, generate PSO objects that may be used in subsequent runs and store them in memory, reducing rendering jams during runtime. It can also generate a program binary cache when precompiling PSO for the first time and save it on the hard disk. When regenerating PSO objects in the future, these binary caches can be used to accelerate the construction, speed up the generation of PSO objects, and reduce compilation time.

[0109] Because PSO objects are resident in memory, if there are too many of them, it may cause a lot of memory overhead. Therefore, UE provides an LRU mechanism and opens some parameters to control the number of PSO objects and the memory they occupy. Among them, LRU is the abbreviation of Least Recently Used, which is a common page replacement algorithm that selects the pages that have not been used for the longest time and eliminates them. There is a similar management strategy in the PSO process, which selects the PSO that has not been used for the longest time and removes it from the memory.

[0110] However, the LRU related parameters of PSO are not easy to determine. If the LRU restriction is too strict, a large number of PSO objects will be removed from the memory. When these PSO objects are needed, they will have to be regenerated, resulting in unnecessary overhead. If the LRU restriction is too loose, the meaning of LRU is lost, and a large number of unnecessary PSO objects will still occupy memory space.

[0111] Moreover, LRU is only a memory replacement solution, which can only save memory at runtime. It cannot isolate some unnecessary PSOs from the root. That is, the mobile platform will still compile and read all PSO caches that are put into the package, which will cause users to have a long compilation waiting time. Moreover, this compilation is performed at a relatively early stage in each game process. If the compilation time is too long, it will seriously affect the user experience.

[0112] The SetUsageMask example provided by UE can be used to simply classify PSO. However, this application scenario does not take into account some special scenarios, such as abnormalities when users dynamically switch image quality, causing PSO function failure and runtime freezes.

[0113] This embodiment is a complete process for the design of the SetUsageMask function, which divides PSOs of different image qualities into different grades. Different PSOs can be read and compiled for different image quality levels during runtime, achieving true isolation of PSOs. And through the special process design and use of ProgramBinaryCache, users can dynamically switch image quality during runtime without affecting the use of PSOs.

[0114] Optionally, in this embodiment, normally, large-scale games will be graded in terms of rendering based on the actual performance of the mobile terminal. And PSO is strongly related to this rendering effect. If some special performances on high-end machines do not exist on low-end machines, then the PSOs corresponding to these special performances are useless during the entire operation of the low-end machine. Therefore, it is possible to consider setting different GameUsageMasks for PSOs under different image qualities. Grade PSOs of different rendering qualities.

[0115] Taking the UE project as an example, the rendering quality classification of this embodiment does not completely include low quality with high quality. They are in a cross-coverage relationship. For example, if a special effect is shared by low quality and medium quality, and the performance effect is the same, then the PSO when rendering this special effect should belong to the intersection of low-end PSO and medium-end PSO. If a special effect is exclusive to low-end machines, then the PSO when rendering this special effect is exclusive to low-end machines.

[0116] 2zqaIn addition, this Mask will associate the newly collected PSO objects in this run, so that the newly collected PSO objects in this embodiment can also be filtered out through the current GameUsageMask when they are built into the package next time.

[0117] To further illustrate, the following two interfaces are optionally used to set GameUsageMask in UE:

[0118] FPipelineFileCache::SetGameUsageMaskWithComparison

[0119] FShaderPipelineCache::SetGameUsageMaskWithComparison

[0120] Referred to as SetUsageMask of FPipelineFileCache and SetUsageMask of FShaderPipelineCache. The difference between the two is that SetUsageMask of FPipelineFileCache only modifies GameUsageMask without doing any other operations. SetUsageMask of FShaderPipelineCache will determine whether the newly assigned GameUsageMask of this embodiment has really changed. If the value of GameUsageMask has really changed, this function will modify GameUsageMask, and will filter out qualified PSO objects according to this new GameUsageMask and add them to the list to be compiled.

[0121] If we follow the SetGameUsageMask example given by UE, this embodiment calls SetUsageMask of FShaderPipelineCache according to the current rendering quality before pre-compiling PSO. Filter out the PSOs that meet the conditions and compile them into memory for use. If the rendering quality does not change during the entire running period, the PSOs filtered out by this embodiment can run normally. If the user actively switches the rendering quality during the game, then the PSOs in the memory of this embodiment cannot meet the needs of the new rendering quality, and these PSOs can only be temporarily created at runtime. Creating PSO is also a very expensive operation, which will cause serious freezes and even block rendering. In extreme cases, the performance is similar to a game freeze.

[0122] The above description describes that when PSO is precompiled for the first time, it will generate a platform-related binary cache ProgramBinaryCache. This binary cache can speed up the process of creating PSO in this embodiment. Therefore, this embodiment combines the two to solve the problem of PSO failure caused by switching image quality at runtime.

[0123] It should be noted that this embodiment can be used in game products that use the PSO function of UE, which is beneficial to reduce the compilation time of the game PSO function and reduce memory overhead. The waiting time for users to enter the formal game process is shortened, the user experience is optimized, and user retention is increased. Specifically, the PSO pre-compilation of full rendering quality is performed during the first run to ensure that the ProgramBinaryCache generated by this pre-compilation is of full quality. When it is not the first run, the PSO of the current corresponding image quality is filtered out. This time, because there is only part of the PSO, the compilation speed is greatly improved. Even if the image quality is switched during subsequent games, when this embodiment needs to binary cache the PSO under the new image quality, because there is a binary cache on the disk, the generation speed is very fast and the user is basically unaware.

[0124] To further illustrate, the optional Figure 7 As shown, after the UE project is started, the game update process is started to further determine whether it is the first pre-compilation. If so, set GameUsageMask to 0 and filter all PSOs. If not, set GameUsageMask to the current rendering level and filter some PSOs; based on the filtered PSOs, perform PSO pre-compilation. Further determine whether the pre-compilation is completed. If not, continue pre-compilation. If so, determine whether it is the first pre-compilation. If so, set GameUsageMask to the current rendering level. If not, it is considered that the PSO process is completed and the game process is officially carried out.

[0125] Another example is the comparison of the optional first run and non-first run timing diagrams. Figure 8 As shown, the first is the first run timing step, specifically initialize UsgeMask = 0, set SetUsageMask = -1, and further filter out the full-quality PSO when the screening condition is SetUsageMask = 0, and return the list to be compiled, compile the full-quality PSO, and after the compilation is completed, set SetUsageMask to the current quality. Secondly, for non-first run timing steps, specifically initialize UsgeMask = 0, and further filter out the current quality PSO when the screening condition is SetUsageMask = current quality, and return the list to be compiled, and compile the full-quality PSO until the compilation is completed.

[0126] Optionally, in the above embodiment, by setting GameUsageMask to 0 to filter all PSOs, it can be understood, but not limited to, that the data of GameUsageMask is a uint64 data, using binary bit operations. Fig. 9 As shown, this embodiment divides the rendering quality into 3 levels (the same applies to other levels). The GameUsageMask corresponding to the low-quality image is 1ULL<<1, that is, 2. The mid-range machine is 1ULL<<2, that is, 4. The high-end machine is 1ULL<<3, that is, 8. If a PSO is used in both the low and mid-range levels, then this PSO will be merged when building the mobile package, and GameUsageMask will have a bitwise OR operation. Among them, uint64 should have 64-bit binary, Fig. 9 In the table shown in , only the last 6 digits are taken for illustration.

[0127] Optionally, in this embodiment, the operation of filtering PSOs according to GameUsageMask described above is actually a bitwise AND operation. If the bitwise AND of the corresponding PSO's UsageMask and the current GameUsageMask is equal to the current GameUsageMask, then it means that the current PSO needs to be compiled. Assuming that the current device is a low-end machine, its GameUsageMask is equal to 2, and the bitwise AND results of the PSOs of different gears are as follows Fig.10 As shown. It can be seen that, under the premise that the current image quality is set to low-end in this embodiment, the PSO of low-end machines and the PSO shared by low-end and mid-end machines can be filtered out (the same applies to the case of high-end machines). According to the above analysis, it can be known that only by setting the current GameUsageMask to 0 in this embodiment can the PSO under all image quality levels be filtered out. This is because the bitwise AND result of 0 and any number is 0 itself.

[0128] However, in order to set up the compilation of all PSOs in this embodiment, it is not as simple as setting GameUsageMask to 0, because SetUsageMask of FShaderPipelineCache will first have a judgment operation to determine whether it has changed. GameUsageMask is 0 by default. When this embodiment sets it to 0, the engine will think that the Mask has not changed, and this operation is considered a useless operation, and it cannot filter out all PSOs waiting for compilation. Therefore, this embodiment needs to call SetUsageMask of FPipelineFileCache to -1 first, and then call SetUsageMask of FShaderPipelineCache to 0. In this way, if GameUsageMask changes, all PSOs can be filtered out and wait for pre-compilation of this embodiment.

[0129] In addition, after the pre-compilation is completed, GameUsageMask needs to be set back to the current rendering quality. This step can be done by calling FPipelineFileCache. Since this embodiment has just compiled the full amount of PSO, the PSO of the current quality must have been compiled, and there is no need to re-screen tasks to add to the compilation queue. If SetUsageMask of FShaderPipelineCache is called, a crash may occur due to timing issues.

[0130] Optionally, in this embodiment, in order to solve the problem of dynamically switching image quality during the game, the core idea adopted in this embodiment is to perform a full compilation for the first time, and use binary cache to speed up the process of generating PSO after switching image quality, thereby reducing jamming. The details of the specific implementation can be adjusted in detail according to the process design of different projects. It can be considered that after the user switches the image quality, the user is forcibly kicked back to the login interface and the PSO pre-compilation process is re-performed. This pre-compilation needs to filter out the PSO under the new image quality level for compilation. Doing so can at least avoid jamming during the game. And the binary cache must be cleaned before the new pre-compilation. Otherwise, the binary cache under the new image quality will not be generated. However, this method will make the user experience feel fragmented, and whether it can be done needs to be discussed with the game operation side.

[0131] If the project has designed a new user experience process, you can consider precompiling only the PSO of the user's current image quality level during the experience process before the experience process. After the experience process, clean up the binary cache, and then perform a full precompilation as the first precompilation formal process of this embodiment. This allows new users to enter the game process faster, and generally speaking, there is strong guidance during the experience process, and the user will not be given a switch to actively switch the image quality. There is no problem of dynamically switching image quality. This optimization method is a combination of this embodiment and the game experience process. There are mandatory requirements for the process, but the user experience will be better.

[0132] Through the embodiments provided by the present application, the memory of PSO runtime is greatly optimized. And the situation of CacheMiss of PSO's LRU strategy is reduced. Even if the image quality is switched dynamically at runtime, there is no obvious lag. Taking the actual UE project as an example, the PSOs of all skill effects of the two protagonists at runtime are collected, and only the mid-range and high-end machines are compared. Among them, 448 PSOs were collected for mid-range machines, and 497 PSOs were collected for high-end machines. The Expand process merged 243 shared PSOs, totaling 702 PSOs. If the image quality is not graded, the mid-range machine will load all 702 PSOs at runtime. After the grade, only 448 PSOs of the current image quality need to be loaded. Under two grades of image quality, the memory usage is 63.8% of the original, which is a significant improvement. It is expected that after the low-end machine is also included in the image quality grade, the memory overhead of each model can be saved by more than 50%.

[0133] It is understandable that in the specific implementation of this application, related data such as user information is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0134] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0135] According to another aspect of the embodiment of the present application, a resource data rendering device for implementing the above resource data rendering method is also provided. Fig.11 As shown, the device comprises:

[0136] A first rendering unit 1102 is used to render target resource data in each rendering scene to obtain all pipeline state objects generated by the target resource data;

[0137] A compiling unit 1104, used to compile all pipeline state objects into the hard disk space of the terminal device, and store them according to the rendering level assigned to each pipeline state object in all pipeline state objects;

[0138] An acquiring unit 1106 is configured to acquire a target rendering request triggered by the target resource data, wherein the target rendering request is used to request the terminal device to render the target resource data at a target rendering level;

[0139] The first cache unit 1108 is used to respond to the target rendering request, read the target pipeline state object matching the target rendering level from the hard disk space, and load the target pipeline state object into the memory space of the terminal device for caching;

[0140] The second rendering unit 1110 is used to read the target pipeline state object from the memory space, and use the target pipeline state object to render the target resource data at a target rendering level.

[0141] For a specific embodiment, reference may be made to the example shown in the above-mentioned device for rendering resource data, which will not be described in detail in this example.

[0142] As an optional solution, the device also includes:

[0143] A second cache unit is used for, after reading the target pipeline state object from the memory space and rendering the target resource data at the target rendering level using the target pipeline state object, in response to a new rendering request triggered by the target resource data, reading the pipeline state object matching the new rendering level from the hard disk space, and loading the pipeline state object matching the new rendering level into the memory space for caching, wherein the new rendering request is used to request the terminal device to render the target resource data at the new rendering level;

[0144] The third rendering unit is used to read the target pipeline state object from the memory space and render the target resource data at the target rendering level using the target pipeline state object, then read a new pipeline state object matching the rendering level from the memory space, and render the target resource data at the target rendering level using the new pipeline state object matching the rendering level.

[0145] For a specific embodiment, reference may be made to the example shown in the above-mentioned method for rendering resource data, which will not be described in detail in this example.

[0146] As an optional solution, the second cache unit includes:

[0147] A first determination module is used to determine a first pipeline state object that is not cached in the memory space among pipeline state objects that match the new rendering level;

[0148] A second determination module, used to determine a second pipeline state object that is cached in the memory space and does not match the new rendering level;

[0149] The replacement module is used to replace the second pipeline state object in the memory space with the first pipeline state object.

[0150] For a specific embodiment, reference may be made to the example shown in the above-mentioned method for rendering resource data, which will not be described in detail in this example.

[0151] As an optional solution, the device also includes:

[0152] The switching module is used to switch the current display interface to a non-process interface before or during the process of using the first pipeline state object to replace the second pipeline state object in the memory space, if the data volume of the second pipeline state object is greater than or equal to the first preset threshold and the current display interface of the terminal device is a process interface. For specific embodiments, reference can be made to the example shown in the above-mentioned resource data rendering method, which will not be repeated in this example.

[0153] As an optional solution, the compiling unit 1104 includes:

[0154] The first compilation module is used to compile all pipeline state objects into the hard disk space in response to the first rendering request triggered by the target resource data, wherein the first rendering request is the first request for requesting the terminal device to render the target resource data, and the target rendering request is not the first rendering request.

[0155] For a specific embodiment, reference may be made to the example shown in the above-mentioned method for rendering resource data, which will not be described in detail in this example.

[0156] As an optional solution, the apparatus further includes: an allocation module, which is used to allocate a corresponding binary mask value to each pipeline state object in all pipeline state objects before compiling all pipeline state objects into the hard disk space of the terminal device, wherein different binary mask values ​​correspond to different rendering levels;

[0157] Compile modules, including:

[0158] A calculation submodule, used for setting the target mask value to 0 in response to the first rendering request, and respectively calculating the first bitwise AND result between the target mask value and each binary mask value;

[0159] A determination submodule, configured to determine the pipeline state object corresponding to the first bitwise AND result equal to the target mask value as a compilation object;

[0160] The compilation submodule is used to compile the compilation object into the hard disk space;

[0161] The first cache unit 1108 includes:

[0162] A setting module, used for responding to a target rendering request, setting a target mask value to a mask value corresponding to a target rendering level, and respectively calculating a second bitwise AND result between the target mask value and each binary mask value;

[0163] A third determination module is used to determine the pipeline state object corresponding to the second bitwise AND result equal to the target mask value as the load object;

[0164] The cache module is used to read the loaded object from the hard disk space and load it into the memory space for caching.

[0165] For a specific embodiment, reference may be made to the example shown in the above-mentioned method for rendering resource data, which will not be described in detail in this example.

[0166] As an optional solution, the device further includes at least one of the following:

[0167] A whitelist unit is used to render the target resource data in each rendering scene, and after obtaining all pipeline state objects generated by the target resource data, determine a first pipeline state object in the whitelist from all pipeline state objects, wherein the first pipeline state object is set to be compiled into the memory space for caching, and is prohibited from being deleted from the memory space;

[0168] The blacklist unit is used to render the target resource data in each rendering scene, obtain all pipeline state objects generated by the target resource data, and then determine the second pipeline state object in the blacklist from all pipeline state objects, wherein the second pipeline state object is set to prohibit compilation or loading into the hard disk space and memory space.

[0169] For a specific embodiment, reference may be made to the example shown in the above-mentioned method for rendering resource data, which will not be described in detail in this example.

[0170] As an optional solution, whitelist units include:

[0171] An acquisition module, used to acquire the usage frequency of each pipeline status object in the terminal device;

[0172] The putting module is used to put the pipeline status objects corresponding to the usage frequency greater than or equal to the second preset threshold into the whitelist.

[0173] For a specific embodiment, reference may be made to the example shown in the above-mentioned method for rendering resource data, which will not be described in detail in this example.

[0174] As an optional solution, the compiling unit 1104 includes:

[0175] The second compiling module is used to compile all pipeline state objects into the hard disk space in the form of program binary cache.

[0176] For a specific embodiment, reference may be made to the example shown in the above-mentioned method for rendering resource data, which will not be described in detail in this example.

[0177] According to another aspect of the embodiment of the present application, an electronic device for implementing the above resource data rendering method is also provided. The electronic device can be, but is not limited to, a server or Figure 1 The user equipment 102 shown in FIG. 1 is used as an example in this embodiment. Further, Fig.12 As shown, the electronic device includes a memory 1202 and a processor 1204. The memory 1202 stores a computer program, and the processor 1204 is configured to execute the steps in any of the above method embodiments through the computer program.

[0178] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.

[0179] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0180] S1, rendering the target resource data in each rendering scene to obtain all pipeline state objects generated by the target resource data;

[0181] S2, compile all pipeline state objects into the hard disk space of the terminal device, and store them according to the rendering level assigned to each pipeline state object in all pipeline state objects;

[0182] S3, obtaining a target rendering request triggered by the target resource data, wherein the target rendering request is used to request the terminal device to render the target resource data at a target rendering level;

[0183] S4, responding to the target rendering request, reading the target pipeline state object matching the target rendering level from the hard disk space, and loading the target pipeline state object into the memory space of the terminal device for caching;

[0184] S5, reading the target pipeline state object from the memory space, and rendering the target resource data at the target rendering level using the target pipeline state object.

[0185] Alternatively, a person skilled in the art may understand that: Fig.12 The structure shown is for illustration only. Fig.12 The structure of the electronic device is not limited. Fig.12 More or fewer components (such as network interfaces, etc.) as shown in, or with Fig.12 Different configurations shown.

[0186] Among them, the memory 1202 can be used to store software programs and modules, such as the program instructions / modules corresponding to the resource data rendering method and device in the embodiment of the present application. The processor 1204 executes various functional applications and data processing by running the software programs and modules stored in the memory 1202, that is, realizing the above-mentioned resource data rendering method. The memory 1202 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1202 may further include a memory remotely located relative to the processor 1204, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 1202 can be specifically, but not limited to, used to store information such as target resource data, pipeline state objects, and rendering levels. As an example, such as Fig.12 As shown, the memory 1202 may include, but is not limited to, the first rendering unit 1102, the compiling unit 1104, the acquiring unit 1106, the first cache unit 1108, and the second rendering unit 1110 in the resource data rendering device. In addition, other module units in the resource data rendering device may also be included but are not limited to, which will not be described in detail in this example.

[0187] Optionally, the transmission device 1206 is used to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one example, the transmission device 1206 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 1206 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0188] In addition, the electronic device further includes: a display 1208 for displaying the target resource data, pipeline state objects, rendering levels and other information; and a connection bus 1210 for connecting various module components in the electronic device.

[0189] In other embodiments, the user device or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes through network communication. Among them, a peer-to-peer network may be formed between the nodes, and any form of computing device, such as a server, user device, or other electronic device, may become a node in the blockchain system by joining the peer-to-peer network.

[0190] According to one aspect of the present application, a computer program product is provided, the computer program product comprising a computer program / instruction, the computer program / instruction comprising a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium. When the computer program is executed by a central processing unit, various functions provided by the embodiments of the present application are executed.

[0191] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0192] It should be noted that the computer system of the electronic device is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0193] The computer system includes a central processing unit (CPU), which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) or the program loaded from the storage part to the random access memory (RAM). In the random access memory, various programs and data required for system operation are also stored. The central processing unit, the read-only memory and the random access memory are connected to each other through a bus. The input / output interface (I / O interface) is also connected to the bus.

[0194] The following components are connected to the input / output interface: an input part including a keyboard, a mouse, etc.; an output part including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage part including a hard disk, etc.; and a communication part including a network interface card such as a local area network card, a modem, etc. The communication part performs communication processing via a network such as the Internet. A drive is also connected to the input / output interface as needed. Removable media, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., are installed on the drive as needed so that the computer program read therefrom is installed into the storage part as needed.

[0195] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium. When the computer program is executed by a central processing unit, various functions defined in the system of the present application are executed.

[0196] According to one aspect of the present application, a computer-readable storage medium is provided, and a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the above-mentioned various optional implementations.

[0197] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:

[0198] S1, rendering the target resource data in each rendering scene to obtain all pipeline state objects generated by the target resource data;

[0199] S2, compile all pipeline state objects into the hard disk space of the terminal device, and store them according to the rendering level assigned to each pipeline state object in all pipeline state objects;

[0200] S3, obtaining a target rendering request triggered by the target resource data, wherein the target rendering request is used to request the terminal device to render the target resource data at a target rendering level;

[0201] S4, responding to the target rendering request, reading the target pipeline state object matching the target rendering level from the hard disk space, and loading the target pipeline state object into the memory space of the terminal device for caching;

[0202] S5, reading the target pipeline state object from the memory space, and rendering the target resource data at the target rendering level using the target pipeline state object.

[0203] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the electronic device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0204] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0205] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, 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, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to execute all or part of the steps of the methods of each embodiment of the present application.

[0206] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0207] In the several embodiments provided in the present application, it should be understood that the disclosed user equipment can be implemented in other ways. Among them, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, for example, 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 through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0208] 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.

[0209] In addition, each functional unit in each embodiment of the present application 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.

[0210] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for rendering resource data, characterized in that: include: Rendering the target resource data in each rendering scene to obtain all pipeline state objects generated by the target resource data; Compiling all pipeline state objects into a hard disk space of a terminal device, and storing them according to a rendering level assigned to each pipeline state object in all pipeline state objects; Obtaining a target rendering request triggered by the target resource data, wherein the target rendering request is used to request the terminal device to render the target resource data at a target rendering level; In response to the target rendering request, read a target pipeline state object matching the target rendering level from the hard disk space, and load the target pipeline state object into the memory space of the terminal device for caching; The target pipeline state object is read from the memory space, and the target resource data is rendered at the target rendering level using the target pipeline state object.

2. The method according to claim 1, characterized in that After reading the target pipeline state object from the memory space and rendering the target resource data at the target rendering level using the target pipeline state object, the method further includes: In response to a new rendering request triggered by the target resource data, the pipeline state object matching the new rendering level is read from the hard disk space, and the pipeline state object matching the new rendering level is loaded into the memory space for caching, wherein the new rendering request is used to request the terminal device to render the target resource data at the new rendering level; The pipeline state object matching the new rendering level is read from the memory space, and the target resource data is rendered at the target rendering level using the pipeline state object matching the new rendering level.

3. The method according to claim 2, characterized in that The step of loading the pipeline state object matching the new rendering level into the memory space for caching includes: Determine a first pipeline state object that is not cached in the memory space among pipeline state objects that match the new rendering level; Determining a second pipeline state object cached in the memory space that does not match the new rendering level; The first pipeline state object is used to replace the second pipeline state object in the memory space.

4. The method according to claim 3, characterized in that Before or during the use of the first pipeline state object to replace the second pipeline state object in the memory space, the method further includes: When the data volume of the second pipeline state object is greater than or equal to a first preset threshold and the current display interface of the terminal device is a process interface, the current display interface is switched to a non-process interface.

5. The method according to claim 1, characterized in that: The step of compiling all pipeline state objects into the hard disk space of the terminal device includes: In response to the first rendering request triggered by the target resource data, all pipeline state objects are compiled into the hard disk space, wherein the first rendering request is the first request for requesting the terminal device to render the target resource data, and the target rendering request is not the first rendering request.

6. The method according to claim 5, characterized in that Before compiling all the pipeline state objects into the hard disk space of the terminal device, the method further includes: assigning a corresponding binary mask value to each pipeline state object among all the pipeline state objects, wherein different binary mask values ​​correspond to different rendering levels; The step of compiling all pipeline state objects into the hard disk space in response to the first rendering request triggered by the target resource data includes: In response to the first rendering request, setting a target mask value to 0, and respectively calculating a first bitwise AND result between the target mask value and each of the binary mask values; Determine the pipeline state object corresponding to the first bitwise AND result equal to the target mask value as a compilation object; Compile the compiled object into the hard disk space; The step of responding to the target rendering request and reading a target pipeline state object matching the target rendering level from the hard disk space includes: In response to the target rendering request, the target mask value is set to the mask value corresponding to the target rendering level, and a second bitwise AND result between the target mask value and each of the binary mask values ​​is calculated respectively; Determine the pipeline state object corresponding to the second bitwise AND result equal to the target mask value as a load object; The loading object is read from the hard disk space and loaded into the memory space for caching.

7. The method according to claim 1, characterized in that After rendering the target resource data in each rendering scene to obtain all pipeline state objects generated by the target resource data, the method further includes at least one of the following: Determine a first pipeline state object in the whitelist from all pipeline state objects, wherein the first pipeline state object is set to be compiled into the memory space for caching and is prohibited from being deleted from the memory space; A second pipeline state object in the blacklist is determined from all the pipeline state objects, wherein the second pipeline state object is set to be prohibited from being compiled or loaded into the hard disk space and the memory space.

8. The method according to claim 7, characterized in that The determining, from among all the pipeline state objects, a first pipeline state object in a whitelist includes: Obtaining the usage frequency of each pipeline status object in the terminal device; The pipeline status objects corresponding to the usage frequency greater than or equal to the second preset threshold are put into the whitelist.

9. The method according to any one of claims 1 to 8, characterized in that The step of compiling all pipeline state objects into the hard disk space of the terminal device includes: All pipeline state objects are compiled into the hard disk space in the form of program binary cache.

10. A rendering device for resource data, characterized in that: include: A first rendering unit, configured to render target resource data in each rendering scene, and obtain all pipeline state objects generated by the target resource data; A compiling unit, used for compiling all the pipeline state objects into a hard disk space of a terminal device, and storing them according to a rendering level assigned to each of the pipeline state objects; An acquisition unit, configured to acquire a target rendering request triggered by the target resource data, wherein the target rendering request is used to request the terminal device to render the target resource data at a target rendering level; A first cache unit, configured to respond to the target rendering request, read a target pipeline state object matching the target rendering level from the hard disk space, and load the target pipeline state object into the memory space of the terminal device for caching; The second rendering unit is used to read the target pipeline state object from the memory space, and use the target pipeline state object to render the target resource data at the target rendering level.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 9 when executed by an electronic device.

12. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method described in any one of claims 1 to 9 are implemented.

13. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 9 through the computer program.

Citation Information

Cited By

  • Rendering method, device and equipment of in-vehicle interactive interface and medium

    CN121070491A