Rendering method and device, electronic equipment and storage medium

By storing precompiled data in the cache space and loading it on the GPU's callback function and application program interface to the GPU for rendering, the problem of too long loading time during traditional rendering is solved, and the system's response speed and rendering efficiency are improved.

CN120276800APending Publication Date: 2025-07-08BEIJING X RING TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510353883.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-24
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

Direct compilation of data during traditional rendering results in an increase in loading time, which reduces the system's response speed.

Method used

The data loading process is simplified by storing precompiled data in the cache space and loading it into the graphics processing unit GPU when the target application is started for rendering.

Benefits of technology

Reduces compilation time at each startup, improves rendering efficiency and application startup speed, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120276800A_ABST
    Figure CN120276800A_ABST
Patent Text Reader

Abstract

The invention provides a rendering method and device, electronic equipment and a storage medium, and the method comprises the steps: responding to the starting of a target application program, loading compiled data stored in a cache space into a GPU (Graphic Processing Unit), and enabling the compiled data to be pre-compiled data; and rendering the target application program based on the compiled data loaded by the GPU. By loading the pre-compiled data, the loading time is shortened, the response speed of the system is increased, and the operation efficiency of the system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular, to a rendering method, apparatus, electronic device, and storage medium. Background Art

[0002] Data plays an important role in application scenarios such as graphics rendering, and its compilation efficiency directly affects the running effect of the application. However, in the traditional rendering process, data is usually directly compiled, which increases the loading time and reduces the response speed of the system. Summary of the Invention

[0003] This application aims to at least solve one of the technical problems in the related art to some extent.

[0004] To this end, this application proposes a method, apparatus, electronic device, and storage medium to achieve real-time performance and...

[0005] An embodiment of one aspect of this application proposes a rendering method, including:

[0006] In response to the startup of a target application, load the compiled data stored in the cache space into the Graphics Processing Unit (GPU), where the compiled data is pre-compiled data;

[0007] Based on the compiled data loaded by the GPU, render the target application.

[0008] Optionally, the loading the compiled data stored in the cache space into the GPU includes:

[0009] Load the compiled data stored in the cache space into the GPU through a callback function stored in the GPU.

[0010] Optionally, the method further includes:

[0011] Obtain the callback function from the application framework layer through the application programming interface between the GPU driver module and the application framework layer, and store it in the GPU driver module.

[0012] Optionally, the loading the compiled data stored in the cache space into the GPU through a callback function stored in the GPU includes:

[0013] Obtain the target key data generated by the target application;

[0014] Retrieve the compiled data stored in the cache space according to the target key data;

[0015] In response to retrieving the compiled data corresponding to the target key data, load the compiled data corresponding to the target key data into the GPU.

[0016] Optionally, the method further includes:

[0017] In response to not retrieving the compiled data corresponding to the target key data, perform a value data retrieval on the compiled data in the cache space according to the target key data;

[0018] In response to retrieving the target value data corresponding to the target key data, load the target value data into the GPU.

[0019] Optionally, the method further includes:

[0020] In response to not retrieving the target value data corresponding to the target key data in the cache space, cause the GPU to compile the data of the target application and store it in the cache space.

[0021] An embodiment of one aspect of the present application provides a rendering method, including:

[0022] In response to the startup of a target application, use the GPU to compile the data of the target application to obtain compiled data;

[0023] Store the compiled data in a cache space, where the compiled data in the cache space is used for rendering when the target application is started subsequently.

[0024] Optionally, the method further includes:

[0025] In the case where there are multiple target applications, perform a merging operation on the compiled data corresponding to the multiple target applications.

[0026] Optionally, the performing a merging operation on the multiple compiled data includes:

[0027] Determine the corresponding payload data according to the key data in the compiled data;

[0028] Perform an alignment process on the payload data corresponding to the key data, where the alignment process is used to align the size of the payload data with a preset data type;

[0029] Perform a merging operation on the payload data.

[0030] Optionally, the obtaining the corresponding payload data according to the key data includes:

[0031] Obtain the starting position of the key data according to the index corresponding to the key data, and determine the size of the value data according to the starting position of the key data;

[0032] Determine the starting position of the value data according to the starting position of the key data;

[0033] Determine the end position of the value data according to the start position of the value data and the size of the value data.

[0034] Optionally, the alignment process for the payload data corresponding to the key data includes:

[0035] Increase the data size corresponding to the payload data;

[0036] Adjust the increased data size to determine the adjusted data size, wherein the adjusted data size is aligned with a preset data type;

[0037] Supplement the payload data according to the adjusted data size, and the data size of the supplemented payload data is aligned with the preset data type.

[0038] Optionally, the merging operation on the payload data includes: selecting payload data from the payload data corresponding to each key data and adding it to the cache space as data to be merged, wherein the payload data is different from any existing data to be merged in the cache space;

[0039] Perform a merging operation on at least two pieces of the data to be merged to obtain the merged compiled data;

[0040] Add corresponding header data to the merged compiled data.

[0041] Optionally, the adding of the corresponding header data to the merged compiled data includes:

[0042] Verify the merged compiled data to obtain verification data;

[0043] Count the total amount of data in the merged compiled data to determine the cache quantity identifier;

[0044] Determine the header data according to the verification data and the cache quantity identifier.

[0045] Another embodiment of the present application proposes a rendering device, including:

[0046] A loading module, configured to load the compiled data stored in the cache space into a graphics processing unit (GPU) in response to the startup of a target application, wherein the compiled data is pre-compiled data;

[0047] A rendering module, configured to render the target application based on the compiled data loaded by the GPU.

[0048] Another embodiment of the present application proposes a rendering device, including:

[0049] A compilation module, configured to compile data of the target application by using a GPU in response to the startup of the target application to obtain compiled data;

[0050] A storage module, configured to store the compiled data into a cache space, wherein the compiled data in the cache space is used for rendering when the target application is started subsequently.

[0051] Another embodiment of this application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the method described in the foregoing aspect is implemented.

[0052] Another embodiment of this application provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method described in the foregoing aspect is implemented.

[0053] Another embodiment of this application provides a chip, which includes a processing circuit configured to execute the method described in the foregoing aspect.

[0054] Another embodiment of this application provides a computer program product, on which a computer program is stored. When the program is executed by a processor, the method described in the foregoing aspect is implemented.

[0055] The rendering method, device, electronic device, chip, and storage medium provided in this application reduce the loading time, improve the response speed of the system, and improve the operating efficiency of the system by loading pre-compiled data.

[0056] Some of the additional aspects and advantages of this application will be given in the following description, some will become obvious from the following description, or will be understood through the practice of this application. Description of the Drawings

[0057] The above and / or additional aspects and advantages of this application will become obvious and easy to understand from the following description of the embodiments in conjunction with the drawings, where:

[0058] Figure 1 It is a schematic flowchart of a rendering method provided by an embodiment of this application;

[0059] Figure 2 It is a schematic flowchart of another rendering method provided by an embodiment of this application;

[0060] Figure 3 It is a schematic diagram of the compiled data structure provided by an embodiment of this application;

[0061] Figure 4A schematic diagram of the compiled data structure provided in an embodiment of the present application;

[0062] Figure 5 A flowchart of another rendering method provided in an embodiment of the present application;

[0063] Figure 6 A schematic diagram of the structure of a rendering device provided in an embodiment of the present application;

[0064] Figure 7 A schematic diagram of the structure of a rendering device provided in an embodiment of the present application;

[0065] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0066] Figure 9 It is a schematic diagram of the structure of a chip proposed in an embodiment of the present application. DETAILED DESCRIPTION

[0067] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0068] The rendering method, device, electronic device, chip and storage medium of the embodiments of the present application are described below with reference to the accompanying drawings.

[0069] In the related art, during the application startup process, the system will load various resources required by the application, including data. The application will read the shader source code from the resource file and pass it to the GPU for subsequent processing. After receiving the shader source code, the GPU will compile it. The compilation process converts the shader code written in a high-level language into machine code that the GPU can directly execute. This step is the key in the rendering process, because only the shader that has been compiled successfully can be used by the GPU for subsequent rendering operations. After the shader is compiled successfully, the application needs to set the rendering state of the GPU, including specifying the shader program to be used, setting the rendering target (such as screen or texture), and configuring various parameters of the rendering pipeline. After the above processing, the rendering result will be output to the specified rendering target. If it is rendered directly to the screen, the user can see the picture presented by the application. Since the compilation process is time-consuming, it will cause the application to start slowly, affecting the user experience.

[0070] Figure 1 A flowchart of a rendering method provided in an embodiment of the present application.

[0071] As an implementation, the rendering method according to the embodiments of the present application can be configured in a rendering device, and the rendering device can be applied to any electronic device so that the electronic device can perform the rendering function.

[0072] Among them, the electronic device can be any device with computing power. For example, it can be a mobile terminal, and the mobile terminal can be a hardware device such as a mobile phone, a tablet computer, a personal digital assistant, a wearable device, etc. with various operating systems, touch screens, and / or display screens.

[0073] As another implementation, the rendering method according to the embodiments of the present application can also be executed by a chip with processing capabilities. The chip includes an Image Signal Processor (ISP), a Central Processing Unit (CPU), an Application-Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Field-Programmable Gate Array (FPGA), a System On A Chip (SOC), a Reduced Instruction Set Computer (RISC), etc., which will not be listed one by one here.

[0074] As Figure 1 shown, the method may include the following steps:

[0075] Step 101: In response to the startup of the target application, load the compiled data stored in the cache space into the Graphics Processing Unit (GPU), where the compiled data is pre-compiled data.

[0076] Step 102: Render the target application based on the compiled data loaded by the GPU.

[0077] In this embodiment, by directly loading the pre-compiled data from the cache space into the GPU for rendering when the target application starts, the compilation time for each startup can be effectively reduced, the rendering efficiency can be improved, the startup speed of the application can be accelerated, and the user experience can be enhanced.

[0078] Optionally, the pre-compiled data is shader data, which can control the processing method of each vertex or pixel, including color calculation, lighting simulation, texture mapping, shadow effects, reflection, and other visual effects. Since the GPU has parallel processing capabilities, the shader can perform efficient operations on a large amount of data simultaneously, which is crucial for real-time rendering of complex 3D scenes.

[0079] Optionally, loading the compiled data stored in the cache space into the GPU includes:

[0080] Loading the compiled data stored in the cache space into the GPU through a callback function stored in the GPU.

[0081] In this embodiment, in order to load the compiled data stored in the cache space into the GPU, the callback function is transmitted to the GPU driver module, so that the GPU can use this callback function to transfer the compiled data stored in the cache space to the GPU.

[0082] Using the callback function stored in the GPU to load the compiled data in the cache space can simplify the data loading process, improve the reliability and efficiency of data loading, and also contribute to improving the stability and security of the system.

[0083] Optionally, the method further includes:

[0084] Obtaining the callback function from the application framework layer through the application programming interface between the GPU driver module and the application framework layer and storing it in the GPU driver module.

[0085] In this embodiment, in order to load the compiled data stored in the cache space into the GPU, an application programming interface API is constructed, which can transfer the callback function in the application framework layer to the GPU driver module, so that the GPU driver module can use the callback function to retrieve the compiled data in the cache space from the application framework layer and load it into the GPU.

[0086] In a possible embodiment, the GPU driver module is UMD (User Mode Driver), which runs in the same context and address space as the application. Its main responsibilities include: shader compilation (including syntax checking, conversion of legacy shader languages, high-level optimizations (loop optimization, redundant code elimination, constant folding, assertion conditions), low-level optimizations (register allocation, loop unrolling), conversion to intermediate language), shader optimization replacement, memory management (such as creating textures, which essentially reallocates large chunks of memory returned). All state changes and drawing operations will be converted by the UMD into instructions recognizable by the hardware, and there are also automatic operations: uploading textures and shaders to video memory.

[0087] Obtain the callback function from the application framework layer through the application programming interface and store it in the GPU driver module, enabling the GPU to more conveniently obtain the required callback function, further optimizing the data loading process, and improving the flexibility and maintainability of the system.

[0088] Optionally, loading the compiled data stored in the cache space into the GPU through the callback function stored in the GPU includes:

[0089] Obtain the target key data generated by the target application;

[0090] Retrieve the compiled data stored in the cache space according to the target key data;

[0091] In response to retrieving the compiled data corresponding to the target key data, load the compiled data corresponding to the target key data into the GPU.

[0092] In this embodiment, when the application initiates a compilation request, a key data will be generated. We refer to the key data generated by the target application as the target key data, and the target key data is used to identify the data corresponding to the target application.

[0093] If the compiled data corresponding to the target key data is retrieved in the cache space, then this compiled data is the compiled data corresponding to the target application. At this time, the compiled data can be loaded into the GPU driver module without compilation.

[0094] In a possible embodiment, a piece of compiled data only contains one key data and the corresponding value data, that is, only contains the value data corresponding to one application. If the key data in this piece of compiled data is the target key data, it means that this piece of compiled data is the compiled data corresponding to the target application, and then this piece of compiled data can be directly loaded into the GPU driver module to complete the rendering process.

[0095] By obtaining the target key data generated by the target application to retrieve the compiled data in the cache space, the compiled data related to the current application can be found more accurately, avoiding loading irrelevant data, and improving the accuracy and efficiency of data loading.

[0096] Optionally, the method further includes:

[0097] In response to not retrieving the compiled data corresponding to the target key data, retrieve the value data of the compiled data in the cache space according to the target key data;

[0098] In response to retrieving the target value data corresponding to the target key data, load the target value data into the GPU.

[0099] In this embodiment, if the compiled data corresponding to the target key data is not retrieved from the cache space, considering the case where a piece of compiled data is composed of multiple value data, in this case, the compiled data contains multiple value data corresponding to multiple application programs, and there is a one-to-one correspondence between the value data and the key data. Retrieve the key data from the compiled data. If the target key data is retrieved, load the corresponding target value data into the GPU to complete the rendering process.

[0100] When the compiled data corresponding to the target key data is not retrieved, the target value data is obtained through value data retrieval and loaded into the GPU, which further improves the success rate of data retrieval and ensures the smooth progress of the rendering process.

[0101] Optionally, the method further includes:

[0102] In response to the target value data corresponding to the target key data not being retrieved from the cache space, instruct the GPU to compile the data of the target application program and store it in the cache space.

[0103] In this embodiment, when the target key data is not retrieved, it means that the target application program has not been compiled yet and the compilation process must be carried out. The GPU compiles the data of the target application program to generate compiled data to complete the rendering process. And store the compiled data in the cache space, so that when the target application program is started next time, there is no need to compile again and the compiled data can be directly called.

[0104] If the corresponding data is not found in the cache space, let the GPU compile the data of the target application program and store it in the cache space, so that the required compiled data can be obtained every time it is started, which further improves the reliability and stability of the system.

[0105] Based on the above embodiment, Figure 2 is a schematic flowchart of another rendering method provided by an embodiment of the present application. As Figure 2 shown, the method includes the following steps:

[0106] Step 201, in response to the start of the target application program, use the GPU to compile the data of the target application program to obtain compiled data;

[0107] Step 202, store the compiled data in the cache space, where the compiled data in the cache space is used for rendering when the target application program is started subsequently.

[0108] In this embodiment, when the target application program is started, the GPU is used to compile data to obtain compiled data and store it in the cache space for direct use subsequently, which can effectively reduce the compilation time during subsequent startups and improve the rendering efficiency.

[0109] Optionally, the method further includes:

[0110] When there are multiple target applications, performing a merging operation on the compilation data corresponding to the multiple target applications.

[0111] In this embodiment, performing a merging operation on the compilation data corresponding to multiple target applications can optimize the use of the cache space, reduce the waste of storage space, and improve the resource utilization rate of the system.

[0112] Optionally, the performing a merging operation on the multiple compilation data includes:

[0113] Determining corresponding payload data according to the key data in the compilation data;

[0114] Performing alignment processing on the payload data corresponding to the key data, where the alignment processing is used to align the size of the payload data with a preset data type;

[0115] Performing a merging operation on the payload data.

[0116] Figure 3 Schematic diagram of the compilation data structure provided by the embodiment of the present application, as Figure 3 shown, in this embodiment, the compilation data in the cache space includes Header header data and Payload payload data. The Header data mainly covers header identification, crc32_c checksum, version information, cache cache quantity, and other parameters. Among these parameters, the crc32_c checksum and the cache quantity are particularly crucial. When performing data merging operations, these two parameters, the crc32_c checksum (whose length is fixed at 4 bytes) and the cache quantity (length fixed at 8 bytes), will change. This is because data merging may involve integrating data from different sources or different states. The crc32_c checksum is used to ensure the integrity of the data during transmission or storage. When the data changes, its checksum value necessarily needs to be recalculated and updated; the cache quantity may change due to the increase or decrease of the cache content during the merging operation, and thus the quantity changes.

[0117] The payload data includes the size of the key data (length fixed at 8 bytes), the size of the value data (length fixed at 8 bytes), the key data, and the value data value data.

[0118] It should be noted particularly that the value data must be aligned before the merging operation. This is because in computer storage and data processing, aligning by specific bytes can improve data access efficiency, reduce the number of memory reads, and thus enhance the overall performance. If alignment is not performed, it may lead to chaos in data storage and reading, affecting the accuracy and efficiency of data processing.

[0119] By aligning and merging the payload data corresponding to the key data, it can be ensured that the merged data format is unified and standardized, facilitating subsequent management and use. At the same time, it also helps to improve the efficiency of data processing.

[0120] Optionally, obtaining the corresponding payload data according to the key data includes:

[0121] Obtaining the starting position of the key data according to the index corresponding to the key data, and determining the size of the value data according to the starting position of the key data;

[0122] Determining the starting position of the value data according to the starting position of the key data;

[0123] Determining the ending position of the value data according to the starting position of the value data and the size of the value data.

[0124] Figure 4 This is a schematic diagram of the compiled data structure provided by the embodiment of the present application. As Figure 4 shown, in this embodiment, the position of the key data can be located in the cache data by using the key. Specifically, obtaining the starting position of the key data according to the index keydata_index corresponding to the key data, offsetting 8 bytes forward from keydata_index, the value size data can be obtained, which clarifies the length information of the value; offsetting 8 bytes backward from keydata_index, the starting position of the valuedata can be determined. Finally, by adding the value size to the valuedata_index, the entire value data can be obtained completely.

[0125] Optionally, aligning the payload data corresponding to the key data includes:

[0126] Increasing the data size corresponding to the payload data;

[0127] Adjusting the increased data size to determine the adjusted data size, where the adjusted data size is aligned with the preset data type;

[0128] Supplement the payload data according to the adjusted data size, and the data size of the supplemented payload data is aligned with the preset data type.

[0129] In this embodiment, the corresponding value data is obtained through specific key data. However, when performing the data merging operation, it is necessary to perform alignment processing on the entire payload data associated with each individual key data.

[0130] In a possible embodiment, the payload data is aligned in four-byte units, and the valid data area of a single key-value pair is defined as: cache[keydata_index - 16:valuedata_index + value size].

[0131] First, add 3 to the original size of the payload data, that is, size + 3. The purpose of this step is to ensure that after the subsequent bitwise AND operation, the result will not be less than size and can be rounded up to the nearest multiple of 4.

[0132] Perform a bitwise AND operation on the result after adding 3 with ~3, that is, (size + 3) & ~3. The binary representation of ~3 is...11111100 (in a computer, integers are stored in two's complement form, and the two's complement of a negative number is the one's complement of its absolute value plus 1, so ~3 is equivalent to the binary representation of -4). The bitwise AND operation will clear the low two bits of the result, thus achieving alignment to a multiple of 4.

[0133] In a possible embodiment, if the original size size of the payload data is 5, then after the +3 operation, it becomes 8; the bitwise AND operation: 8 & ~3. The binary representation of ~3 is 11111111 11111111 11111111 11111100 (taking 32 bits as an example), and the binary representation of 8 is 00000000 00000000 00000000 00001000. After the bitwise AND operation, the result is still 00000000 00000000 00000000 00001000, that is, 8. Therefore, after being processed by the four-byte alignment algorithm, the data size is adjusted to 8 bytes, meeting the requirement of 4-byte alignment. For the extra 3 bytes, for data consistency and integrity, their values are set to 0.

[0134] In this embodiment, by increasing the data size of the payload data and making adjustments to align it with the preset data type, the standardization and compatibility of the data can be ensured, facilitating subsequent processing and storage.

[0135] Optionally, the operation of merging the payload data includes: selecting payload data from the payload data corresponding to each key data and adding the selected payload data into the cache space as the data to be merged, where the payload data is different from any existing data to be merged in the cache space;

[0136] Performing a merging operation on at least two pieces of the data to be merged to obtain the merged compiled data;

[0137] Adding corresponding header data to the merged compiled data.

[0138] In this embodiment, after each piece of payload data is aligned, it is added to the new cache data. If the same data is found, that data is skipped. The specific steps are as follows:

[0139] Initializing a cache data list, which contains multiple sub-cache lists;

[0140] Initializing an empty list, called the total cache list, for storing all non-duplicate cache items;

[0141] Traversing each sub-cache list in the cache data list and each cache item in the current sub-cache list;

[0142] Checking whether the current cache item is not in the total cache list;

[0143] If it is not, adding the cache item to the total cache list; if it is, not adding the cache item to the total cache list.

[0144] In this embodiment, different payload data is selected from the payload data corresponding to each key data as the data to be merged, and a merging operation is performed on it, which can further optimize the merged data, reduce redundancy, and improve the integration and availability of the data.

[0145] Optionally, the adding of the corresponding header data to the merged compiled data includes:

[0146] Performing a check on the merged compiled data to obtain check data;

[0147] Counting the total amount of data in the merged compiled data to determine a cache quantity identifier;

[0148] Determining the header data according to the check data and the cache quantity identifier.

[0149] In this embodiment, after the cached data is successfully merged, the next step is to add header data to it. At this time, we have successfully obtained the merged compiled data. Subsequently, this part of the merged compiled data is passed into the crc32_c function for verification calculation, and the function will output the corresponding calculation result. At the same time, by counting the merged compiled data, we can know the total number of cached data contained in it.

[0150] Immediately afterwards, the two key pieces of information, namely the crc32_c calculation result obtained above and the total number of cached data, are filled into the header data area. Finally, the header data filled with information is integrated with the merged compiled data, so that the final compiled data that can be put into use can be obtained.

[0151] This embodiment adds header data to the merged compiled data, including information such as verification data and cache quantity identification, which can improve the integrity and identifiability of the data, facilitating subsequent data verification and management.

[0152] Figure 5 It is a schematic flowchart of another rendering method provided by an embodiment of the present application. As Figure 5 shown, this method includes the following steps:

[0153] Step 501, when the target application sends a compilation command, the compile shader in the GPU will immediately start the preliminary compilation operation.

[0154] Step 502, first execute the original load process, that is, the GPU first loads the data in the cache space. If the compiled file corresponding to the target application is loaded, the compilation stage is skipped.

[0155] Step 503, if the original load does not load the compiled file corresponding to the target application, then it will query whether there is target value data corresponding to the target key data in the cache space (shader cache) according to the target key data generated by the target application. If so, the target value data is loaded.

[0156] Step 504, if there is no target value data, the GPU will execute the compilation process to compile the shader data corresponding to the target application.

[0157] Step 505, then the compiled data will be stored under the directory corresponding to the application through the store function (only stored in the data collection stage).

[0158] To implement the above embodiment, an embodiment of the present application also proposes a rendering device.

[0159] Figure 6A structural schematic diagram of a rendering device provided by an embodiment of the present application.

[0160] As Figure 6 shown, the device may include:

[0161] A loading module 610, configured to load the compiled data stored in the cache space into a graphics processing unit (GPU) in response to the startup of a target application, where the compiled data is pre-compiled data;

[0162] A rendering module 620, configured to render the target application based on the compiled data loaded by the GPU.

[0163] It should be noted that the foregoing explanation of the method embodiment also applies to the device of this embodiment, and will not be elaborated here.

[0164] To implement the above embodiment, an embodiment of the present application also proposes a rendering device.

[0165] Figure 7 A structural schematic diagram of a rendering device provided by an embodiment of the present application.

[0166] As Figure 7 shown, the device may include:

[0167] A compilation module 710, configured to compile the data of the target application using the GPU to obtain compiled data in response to the startup of the target application;

[0168] A storage module 720, configured to store the compiled data in the cache space, where the compiled data in the cache space is used for rendering when the target application is started subsequently.

[0169] It should be noted that the foregoing explanation of the method embodiment also applies to the device of this embodiment, and will not be elaborated here.

[0170] To implement the above embodiment, the present application also proposes a non-transitory computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the method described in the foregoing method embodiment is implemented.

[0171] To implement the above embodiment, the present application also proposes a computer program product, on which a computer program is stored, and when the computer program is executed by a processor, the method described in the foregoing method embodiment is implemented.

[0172] To implement the above embodiment, the present application also proposes an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the program, the method described in the foregoing method embodiment is implemented.

[0173] Figure 8 This is a schematic structural diagram of an electronic device provided by an embodiment of the present application. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0174] Referring to Figure 8 , the electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.

[0175] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, telephone calls, data communication, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above methods. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0176] The memory 804 is configured to store various types of data to support the operation of the electronic device 800. Examples of these data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk, or an optical disk.

[0177] The power component 806 provides power to various components of the electronic device 800. The power component 806 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the electronic device 800.

[0178] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can sense not only the boundaries of touch or swipe actions but also detect the duration and pressure associated with the touch or swipe operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.

[0179] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC) that is configured to receive external audio signals when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, the audio component 810 further includes a speaker for outputting audio signals.

[0180] The I / O interface 812 provides an interface between the processing component 802 and a peripheral interface module, and the peripheral interface module can be a keyboard, a click wheel, buttons, etc. These buttons can include, but are not limited to: a home button, a volume button, a power button, and a lock button.

[0181] The sensor component 814 includes one or more sensors for providing a status assessment of various aspects of the electronic device 800. For example, the sensor component 814 can detect the on / off state of the electronic device 800, the relative positioning of components, such as the display and the keypad of the electronic device 800. The sensor component 814 can also detect a change in the position of the electronic device 800 or a component of the electronic device 800, the presence or absence of user contact with the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and a change in the temperature of the electronic device 800. The sensor component 814 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor component 814 can also include a light sensor, such as a CMOS or a CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 814 can further include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0182] The communication component 816 is configured to facilitate communication between the electronic device 800 and other devices in a wired or wireless manner. The electronic device 800 can access a communication standard-based wireless network, such as WiFi, 4G, or 5G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0183] In an exemplary embodiment, the electronic device 800 can be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the above method.

[0184] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the above instructions can be executed by a processor 820 of the electronic device 800 to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, Random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0185] To implement the above embodiments, the present application also proposes a chip, including: the chip includes a processing circuit, and the processing circuit is configured to execute the method provided in the foregoing embodiments.

[0186] Figure 9 It is a schematic structural diagram of a chip proposed by an embodiment of the present application. Reference can be made to Figure 9 the schematic structural diagram of the chip 1100 shown, but not limited thereto.

[0187] The chip 1100 includes a processing circuit 1101, and the processing circuit 1101 is configured to execute any of the above methods.

[0188] In some embodiments, the chip 1100 further includes one or more interface circuits 1102. Optionally, the interface circuit 1102 is connected to the memory 1103. The interface circuit 1102 can be used to receive signals from the memory 1103 or other devices, and the interface circuit 1102 can be used to send signals to the memory 1103 or other devices. For example, the interface circuit 1102 can read the instructions stored in the memory 1103 and send the instructions to the processing circuit 1101.

[0189] In some embodiments, the interface circuit 1102 performs at least one of the communication steps such as sending and / or receiving in the above method, and the processing circuit 1101 performs other steps.

[0190] In some embodiments, terms such as interface circuit, interface, transceiver pin, transceiver, etc. may be used interchangeably.

[0191] In some embodiments, the chip 1100 further includes one or more memories 1103 for storing instructions. Optionally, all or part of the memories 1103 may be outside the chip 1100.

[0192] In the description of this specification, the descriptions with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, without contradiction, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples.

[0193] In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present application, "a plurality of" means at least two, such as two, three, etc., unless otherwise specifically defined.

[0194] Any process or method description shown in the flowchart or described in other ways herein may be understood to represent a module, segment, or part of code including one or more executable instructions for implementing a customized logic function or process. The scope of the preferred embodiments of the present application includes additional implementations, where the functions may be executed in a manner that is not shown or discussed, including in a substantially simultaneous manner according to the involved functions or in a reverse order, which should be understood by those skilled in the art of the embodiments of the present application.

[0195] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a definable sequence list of executable instructions for implementing logical functions, which can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or in combination with these instruction execution systems, apparatus, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in combination with an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection part with one or more wirings (electronic device), a portable computer disk cartridge (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or other suitable processing as necessary, and then storing it in a computer memory.

[0196] It should be understood that various parts of the present application can be implemented using hardware, software, firmware, or combinations thereof. In the above-described embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application-specific integrated circuits having suitable combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.

[0197] Those of ordinary skill in the art of this technology can understand that all or part of the steps carried by the methods of the above embodiments can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiments.

[0198] In addition, each functional unit in various embodiments of the present application may be integrated into one processing module, may exist separately as individual physical units, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0199] The above-mentioned storage medium may be a read-only memory, a magnetic disk, an optical disc, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present application. Those of ordinary skill in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present application.

Claims

1. A rendering method, characterized in that, Including: In response to the startup of the target application, load the compiled data stored in the cache space into the Graphics Processing Unit (GPU), where the compiled data is pre-compiled data; Based on the compiled data loaded by the GPU, render the target application.

2. The method according to claim 1, characterized in that, The step of loading the compiled data stored in the cache space into the GPU includes: Load the compiled data stored in the cache space into the GPU through a callback function stored in the GPU.

3. The method according to claim 2, wherein The method further includes: Obtain the callback function from the application framework layer through the application programming interface between the GPU driver module and the application framework layer and store it in the GPU driver module.

4. The method according to claim 2, wherein The step of loading the compiled data stored in the cache space into the GPU through the callback function stored in the GPU includes: Obtain the target key data generated by the target application; Retrieve the compiled data stored in the cache space according to the target key data; In response to retrieving the compiled data corresponding to the target key data, load the compiled data corresponding to the target key data into the GPU.

5. The method according to claim 4, wherein The method further includes: In response to not retrieving the compiled data corresponding to the target key data, perform value data retrieval on the compiled data in the cache space according to the target key data; In response to retrieving the target value data corresponding to the target key data, load the target value data into the GPU.

6. The method according to claim 5, characterized in that, The method further includes: In response to not retrieving the target value data corresponding to the target key data in the cache space, cause the GPU to compile the data of the target application and store it in the cache space.

7. A rendering method, characterized in that, Including: In response to the startup of the target application, use the GPU to compile the data of the target application to obtain compiled data; Store the compiled data in the cache space, where the compiled data in the cache space is used for rendering when the target application is started subsequently.

8. The method according to claim 7, wherein The method further includes: In the case where there are multiple target applications, perform a merging operation on the compiled data corresponding to the multiple target applications.

9. The method according to claim 8, wherein The step of performing a merging operation on the multiple compiled data includes: Determine the corresponding payload data according to the key data in the compiled data; Perform alignment processing on the payload data corresponding to the key data, where the alignment processing is used to align the size of the payload data with a preset data type; Perform a merging operation on the payload data.

10. The method according to claim 9, wherein The step of obtaining the corresponding payload data according to the key data includes: Obtain the starting position of the key data according to the index corresponding to the key data, and determine the size of the value data according to the starting position of the key data; Determine the starting position of the value data according to the starting position of the key data; Determine the ending position of the value data according to the starting position of the value data and the size of the value data.

11. The method according to claim 9, characterized in that, The step of performing alignment processing on the payload data corresponding to the key data includes: Increase the data size corresponding to the payload data; Adjust the increased data size to determine the adjusted data size, where the adjusted data size is aligned with a preset data type. Supplement the payload data according to the adjusted data size, and align the data size of the supplemented payload data with the preset data type.

12. The method according to claim 9, wherein The merging operation on the payload data includes: selecting payload data from the payload data corresponding to each key data and adding it to the cache space as the data to be merged, where the payload data is different from any existing data to be merged in the cache space; Perform a merging operation on at least two pieces of the data to be merged to obtain the merged compiled data; Add corresponding header data to the merged compiled data.

13. The method according to claim 12, wherein The adding of corresponding header data to the merged compiled data includes: Perform a check on the merged compiled data to obtain check data; Count the total amount of data in the merged compiled data to determine the cache quantity identifier; Determine the header data according to the check data and the cache quantity identifier.

14. A rendering device, characterized in that, It includes: A loading module, configured to load the compiled data stored in the cache space into the Graphics Processing Unit (GPU) in response to the startup of the target application, where the compiled data is pre-compiled data; A rendering module, configured to render the target application based on the compiled data loaded by the GPU.

15. A rendering device, characterized in that, It includes: A compilation module, configured to compile the data of the target application using the GPU to obtain compiled data in response to the startup of the target application; A storage module, configured to store the compiled data in the cache space, where the compiled data in the cache space is used for rendering when the target application is started subsequently.

16. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the method according to any one of claims 1-6 or claims 7-12.

17. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the method according to any one of claims 1-6 or claims 7-12.

18. A chip, characterized in that, The chip includes a processing circuit configured to execute the method according to any one of claims 1-6 or claims 7-12.

19. A computer program product, characterized in that, It includes a computer program that, when executed by the processor, implements the method according to any one of claims 1-6 or claims 7-12.