An icon rendering method, device, equipment, storage medium and program product

By acquiring and presenting dynamic graph data in volatile storage devices, the problem of large consumption of icon rendering resources in the prior art is solved, and the icon rendering efficiency is improved.

CN114119331BActive Publication Date: 2025-07-18TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111333047.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-11
Publication Date
2025-07-18
Estimated Expiration
2041-11-11

AI Technical Summary

Technical Problem

In the prior art, the application loading all icons during operation results in a large resource consumption and low icon rendering efficiency.

Method used

By obtaining dynamic graph data in a volatile storage device, only the most recently requested icon data is loaded, and corresponding icons are presented in the target application interface. Combining the update mechanism of non-volatile storage devices and dynamic graph data, the storage and loading process of icon data is optimized.

Benefits of technology

Reduces resource consumption in the icon rendering process, improves icon rendering efficiency, and reduces the loading of icon data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114119331B_ABST
    Figure CN114119331B_ABST
Patent Text Reader

Abstract

The present application provides an icon rendering method, apparatus, device, storage medium and program product; the icon rendering method includes: during the running of a target application, in response to an icon rendering request, obtaining an icon identifier to be rendered; obtaining, from the dynamic graph data of a volatile storage device, the icon data to be rendered corresponding to the icon identifier to be rendered, where the volatile storage device includes a video memory or a memory, the dynamic graph data is the rendering data of an image, and the dynamic graph data is used to store at least one icon data of the most recently requested; by rendering the icon data to be rendered, presenting, in a target application interface of the target application, a target icon corresponding to the icon identifier to be rendered. Through the present application, the icon rendering efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to image rendering technology in the field of computer applications, and particularly to an icon rendering method, apparatus, device, storage medium, and program product. Background Art

[0002] With the rapid development of computer applications, applications that can implement various functions have emerged. Generally, an application includes various icons, such as a search icon, a communication icon, and an attack icon, etc.; during the process of running an application, all icons of the application are usually loaded by loading multiple pre-made icon sets, and then the icon rendering of the application is realized; however, in the above icon rendering process, all icons are loaded, while the icons actually required to be rendered during the running process are often less than all icons, so the resource consumption during icon rendering is large, resulting in low icon rendering efficiency. Summary of the Invention

[0003] Embodiments of this application provide an icon rendering method, apparatus, device, computer-readable storage medium, and computer program product, which can reduce the resource consumption during icon rendering and improve the icon rendering efficiency.

[0004] The technical solution of the embodiments of this application is implemented as follows:

[0005] Embodiments of this application provide an icon rendering method, including:

[0006] During the process of running a target application, in response to an icon rendering request, obtain an icon identifier to be rendered;

[0007] Obtain icon data to be rendered corresponding to the icon identifier to be rendered from the dynamic icon data of a volatile storage device, where the volatile storage device includes video memory or memory, the dynamic icon data is the rendering data of an image, and the dynamic icon data is used to store at least one icon data of the most recently requested;

[0008] Render the icon data to be rendered, and present a target icon corresponding to the icon identifier to be rendered in a target application interface of the target application.

[0009] Embodiments of this application provide an icon rendering apparatus, including:

[0010] An identifier obtaining module, configured to obtain an icon identifier to be rendered in response to an icon rendering request during the process of running a target application;

[0011] An icon acquisition module, configured to acquire to-be-rendered icon data corresponding to the to-be-rendered icon identifier from the dynamic graph data of the volatile storage device, where the volatile storage device includes video memory or memory, the dynamic graph data is the rendering data of an image, and the dynamic graph data is used to store at least one icon data of the most recently requested;

[0012] An icon rendering module, configured to present a target icon corresponding to the to-be-rendered icon identifier in a target application interface of the target application by rendering the to-be-rendered icon data.

[0013] In an embodiment of the present application, the icon rendering device further includes a data update module, configured to, when the dynamic graph data does not include the to-be-rendered icon data corresponding to the to-be-rendered icon identifier, determine the to-be-rendered icon data corresponding to the to-be-rendered icon identifier in a non-volatile storage device; determine a target block in the dynamic graph data based on the size of the to-be-rendered icon data; load the to-be-rendered icon data into the target block; and present the target icon corresponding to the to-be-rendered icon identifier in the target application interface by rendering the to-be-rendered icon data in the target block.

[0014] In an embodiment of the present application, the data update module is further configured to update the request times of the to-be-rendered icon data in the dynamic graph data; when the occupied space corresponding to the dynamic graph data is equal to the specified space, determine to-be-deleted icon data based on at least one of the lowest request times and the longest recent request duration, where the specified space is the maximum space corresponding to the dynamic graph data; and delete the to-be-deleted icon data to obtain an idle block, where the idle block is used to store new icon data.

[0015] In an embodiment of the present application, the icon rendering module is further configured to, when the dynamic graph data includes at least one idle block and the gear size corresponding to each idle block is smaller than the size of the to-be-rendered icon data, load the to-be-rendered icon data into a specified block of the volatile storage device; and present the target icon corresponding to the to-be-rendered icon identifier in the target application interface by rendering the to-be-rendered icon data in the specified block.

[0016] In an embodiment of the present application, the data update module is further configured to obtain a set of idle blocks in the dynamic graph data; and obtain the target block by traversing the set of idle blocks to obtain an idle block whose gear size is greater than or equal to the size of the to-be-rendered icon data and is closest to the size of the to-be-rendered icon data, where the gear size is the size of the idle block in the set of idle blocks.

[0017] In an embodiment of the present application, the icon rendering device further includes a data construction module, configured to construct an image file of a specified space in the memory; determine at least one gear size based on various icon sizes corresponding to the icon of the target application; divide the specified space of the image file into at least one subspace based on at least one of the gear sizes; divide the subspace in units of the gear size to obtain a gear block set including at least one gear block; when the volatile storage device includes the memory, determine the image file including at least one gear block set corresponding to at least one of the subspaces as the dynamic graph data, where the free block set is composed of the free gear blocks in at least one of the gear block sets; when the volatile storage device includes the video memory, determine the image file including at least one gear block set corresponding to at least one of the subspaces as the dynamic graph data, and load the dynamic graph data into the video memory.

[0018] In an embodiment of the present application, the data construction module is further configured to generate graphic resources for each gear block in each of the at least one gear block set in at least one gear block set corresponding to at least one of the subspaces, to obtain at least one graphic resource set corresponding to at least one of the subspaces, where the graphic resource is used to store one icon data, and each graphic resource set includes at least one of the graphic resources; determine the image file including at least one of the graphic resource sets as the dynamic graph data.

[0019] In an embodiment of the present application, the data construction module is further configured to divide, from the allocable blocks corresponding to the dynamic graph data, gear blocks with a gear size matching the size of the icon data to be rendered, to obtain the target blocks, where the allocable blocks are used to allocate the gear blocks for the icon data by dividing the gear blocks.

[0020] In an embodiment of the present application, the data construction module is further configured to construct an image file of a specified space in the memory; determine the free space in the specified space of the image file as the allocable blocks; when the volatile storage device includes the memory, determine the image file including the allocable blocks as the dynamic graph data; when the volatile storage device includes the video memory, determine the image file including the allocable blocks as the dynamic graph data, and load the dynamic graph data into the video memory.

[0021] In an embodiment of the present application, the data update module is further configured to load the icon data to be rendered into the video memory; or, load the icon data to be rendered into the memory and then load the icon data to be rendered in the memory into the video memory; or, load the icon data to be rendered into the memory, obtain a pixel set of the icon data to be rendered in the memory through a compatible memory to obtain a texture of the icon data to be rendered, and load the texture of the icon data to be rendered into the video memory through the memory; copy the texture of the icon data to be rendered from the video memory into the graphic resources of the target block.

[0022] In an embodiment of the present application, the data update module is further configured to generate graphic resources corresponding to the target block.

[0023] An icon rendering device provided by an embodiment of the present application includes:

[0024] A memory for storing executable instructions;

[0025] A processor, when executing the executable instructions stored in the memory, implements the icon rendering method provided by the embodiment of the present application.

[0026] A computer-readable storage medium provided by an embodiment of the present application stores executable instructions, and the executable instructions are used to implement the icon rendering method provided by the embodiment of the present application when being executed by a processor.

[0027] A computer program product provided by an embodiment of the present application includes a computer program or instruction, and when the computer program or instruction is executed by a processor, it implements the icon rendering method provided by the embodiment of the present application.

[0028] The embodiment of the present application has at least the following beneficial effects: By making the recently requested icon data into a dynamic graph data, the icon data to be requested is dynamically stored in the dynamic graph data, so that during the running of the target application, the icon rendering during the running of the target application can be completed through the dynamic graph data, and the dynamic graph data is the rendering data of an image; in this way, the loading amount of the icon data can be reduced, the resource consumption during the icon rendering process can be reduced, and thus the efficiency of icon rendering can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 is an exemplary atlas schematic diagram;

[0030] Figure 2 is a schematic diagram of the architecture of the icon rendering system provided by the embodiment of the present application;

[0031] Figure 3 is provided by the embodiment of the present application Figure 2Schematic diagram of the composition structure of a terminal in

[0032] Figure 4 It is a flowchart of the icon rendering method provided by an embodiment of the present application Figure 1 ;

[0033] Figure 5 It is a flowchart of the icon rendering method provided by an embodiment of the present application Figure 2 ;

[0034] Figure 6 It is a flowchart of the icon rendering method provided by an embodiment of the present application Figure 3 ;

[0035] Figure 7 It is a schematic diagram of an exemplary division of a specified space of an image file provided by an embodiment of the present application;

[0036] Figure 8 It is an analysis diagram of the result of creating graphic resources provided by an embodiment of the present application;

[0037] Figure 9 It is a schematic diagram of the result of dividing a target block from allocable blocks provided by an embodiment of the present application;

[0038] Figure 10 It is a schematic diagram of an exemplary icon rendering method provided by an embodiment of the present application;

[0039] Figure 11 It is a schematic diagram of an exemplary determination of gear blocks provided by an embodiment of the present application;

[0040] Figure 12 It is a schematic diagram of exemplary gear blocks provided by an embodiment of the present application;

[0041] Figure 13 It is a schematic diagram of an exemplary dynamic atlas provided by an embodiment of the present application;

[0042] Figure 14 It is a schematic diagram of an exemplary text copy provided by an embodiment of the present application. Detailed implementation manners

[0043] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be construed as limitations on the present application. All other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of the present application.

[0044] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments. However, it should be understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict.

[0045] Unless otherwise defined, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by those skilled in the technical field to which this application belongs. The terms used in the embodiments of this application are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0046] Before further elaborating on the embodiments of this application, the nouns and terms involved in the embodiments of this application are described. The nouns and terms involved in the embodiments of this application are subject to the following explanations.

[0047] 1) Functional application, abbreviated as application, is used to implement a specified function through a computer program. It can be a native program or software module in an operating system, and can be a local (Native) application (APP, Application), that is, a program that needs to be installed in the operating system to run, such as a game APP, a live broadcast APP, or an instant messaging APP; it can also be a mini-program, that is, a program that only needs to be downloaded to the browser environment to run; it can also be a mini-program that can be embedded in any APP; in short, the above computer program can be any form of application program, module, or plug-in. In the embodiments of this application, the application involved is the target application.

[0048] 2) Graph data is a data file corresponding to a set of images including multiple icons (i.e., an image), abbreviated as an image set; among them, the icon data of each icon includes data such as icon identification, position, and size; the dynamic graph data in the embodiments of this application is a graph data. Since the icon data in the dynamic graph data is continuously updated based on the currently rendered icons, it is called dynamic graph data. Among them, one graph data corresponds to one rendering process (Draw Call), so all the icon data included in the graph data corresponds to one rendering process in total; while a single icon data outside the graph data corresponds to a secondary rendering process.

[0049] Exemplarily, refer to Figure 1 , Figure 1 is an exemplary schematic diagram of an image set; as Figure 1 described, the image set 1-1 is an image, including 16 icons (exemplarily, icons 1-11 are marked).

[0050] It should be noted that each application includes a large number of icons. When rendering the icons in an application, if all the icons corresponding to the application are made into an atlas (for example, an image of 2048*2048), then all the icons will be made into multiple atlases. And when the application is running, these multiple atlases all need to be loaded into the memory. As a result, the memory occupancy is relatively large, so the resource consumption is large, leading to relatively large resource consumption and low efficiency in icon rendering during the running of the application.

[0051] The embodiments of the present application provide an icon rendering method, device, equipment, computer-readable storage medium and computer program product, which can reduce the resource consumption of icon rendering during the running of an application and improve the icon rendering efficiency. The following describes the exemplary application of the icon rendering device provided by the embodiments of the present application. The icon rendering device provided by the embodiments of the present application can be implemented as various types of terminals such as smart phones, smart watches, laptop computers, tablet computers, desktop computers, smart TVs, set-top boxes, intelligent vehicle-mounted devices, portable music players, personal digital assistants, dedicated messaging devices, portable game devices and smart speakers, or can also be implemented as a server. Next, the exemplary application when the icon rendering device is implemented as a terminal will be described.

[0052] See Figure 2 , Figure 2 is the schematic architecture diagram of the icon rendering system provided by the embodiments of the present application; as Figure 2 shown, to support an icon rendering application, in the icon rendering system 100, the terminal 200 (referred to as the icon rendering device, and the terminal 200-1 and the terminal 200-2 are exemplarily shown) is connected to the server 400 through the network 300. The network 300 can be a wide area network or a local area network, or a combination of the two. The server 400 is used to provide computing services to the terminal 200, and the computing services are, for example, the running data required to run the target application. In addition, the icon rendering system 100 further includes a database 500 for providing data support to the server 400; and, Figure 1 shown in is a case where the database 500 is independent of the server 400. In addition, the database 500 can also be integrated in the server 400, and the embodiments of the present application do not make any limitations in this regard.

[0053] The terminal 200 is configured to, during the running of a target application, in response to an icon rendering request, obtain an icon identifier to be rendered; obtain icon data to be rendered corresponding to the icon identifier to be rendered from dynamic graph data in a volatile storage device, where the volatile storage device includes a video memory or a memory, the dynamic graph data is rendering data of an image, and the dynamic graph data is used to store at least one icon data of the most recently requested; and present a target icon corresponding to the icon identifier to be rendered in a target application interface of the target application by rendering the icon data to be rendered (for example, the flag icon in the page shown in the terminal 200-1, and the acceleration icon in the page shown in the terminal 200-2).

[0054] In some embodiments, the server 400 may be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers. It may also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The terminal 200 may be a smart phone, a smart watch, a laptop computer, a tablet computer, a desktop computer, a smart TV, a set-top box, a smart vehicle-mounted device, a portable music player, a personal digital assistant, a dedicated messaging device, a portable game device, and a smart speaker, etc., but is not limited thereto. The terminal and the server may be directly or indirectly connected through wired or wireless communication methods, which are not limited in the embodiments of the present application.

[0055] See Figure 3 , Figure 3 is a schematic structural diagram of a composition of a terminal provided in the embodiments of the present application Figure 2 in which, Figure 3 The terminal 200 shown in includes: at least one processor 210, a memory 250, at least one network interface 220, and a user interface 230. Each component in the terminal 200 is coupled together through a bus system 240. It can be understood that the bus system 240 is used to realize the connection and communication between these components. The bus system 240 includes, in addition to a data bus, a power bus, a control bus, and a status signal bus. However, for the sake of clear illustration, in Figure 3 all kinds of buses are labeled as the bus system 240.

[0056] The processor 210 may be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or any conventional processor, etc.

[0057] The user interface 230 includes one or more output devices 231 enabling the presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 230 also includes one or more input devices 232, including user interface components facilitating user input, such as a keyboard, a mouse, a microphone, a touch screen display, a camera, other input buttons, and controls.

[0058] The memory 250 can be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid state memory, hard disk drives, optical disk drives, etc. The memory 250 optionally includes one or more storage devices physically located away from the processor 210.

[0059] The memory 250 includes volatile memory or non-volatile memory, and may also include both volatile and non-volatile memory. The non-volatile memory can be a read-only memory (ROM), and the volatile memory can be a random access memory (RAM). The memory 250 described in the embodiments of the present application is intended to include any suitable type of memory.

[0060] In some embodiments, the memory 250 is capable of storing data to support various operations. Examples of such data include programs, modules, and data structures, or subsets or supersets thereof, which are exemplarily described below.

[0061] The operating system 251 includes system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;

[0062] The network communication module 252 is used to reach other computer devices via one or more (wired or wireless) network interfaces 220. Exemplary network interfaces 220 include: Bluetooth, Wi-Fi (Wireless Fidelity), and USB (Universal Serial Bus), etc.;

[0063] The presentation module 253 is used to enable the presentation of information (such as a user interface for operating peripheral devices and displaying content and information) via one or more output devices 231 associated with the user interface 230 (e.g., a display screen, a speaker, etc.);

[0064] The input processing module 254 is used to detect and translate one or more user inputs or interactions from one of one or more input devices 232.

[0065] In some embodiments, the icon rendering device provided by the embodiments of the present application may be implemented in software. Figure 3 FIG. Figure 3 shows an icon rendering device 255 stored in a memory 250, which may be software in the form of a program, a plug-in, etc., including the following software modules: an identification acquisition module 2551, an icon acquisition module 2552, an icon rendering module 2553, a data update module 2554, and a data construction module 2555. These modules are logical, and thus can be combined arbitrarily or further split according to the functions implemented. The functions of each module will be described below.

[0066] In some embodiments, the icon rendering device provided by the embodiments of the present application may be implemented in hardware. As an example, the icon rendering device provided by the embodiments of the present application may be a processor in the form of a hardware decoding processor, which is programmed to execute the icon rendering method provided by the embodiments of the present application. For example, a processor in the form of a hardware decoding processor may employ one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs), or other electronic components.

[0067] Next, the icon rendering method provided by the embodiments of the present application will be described in conjunction with the exemplary applications and implementations of the icon rendering device provided by the embodiments of the present application.

[0068] Refer to Figure 4 , Figure 4 which is a flowchart of the icon rendering method provided by the embodiments of the present application Figure 1 and will be described in conjunction with the steps shown in Figure 4 .

[0069] S401. During the running of a target application, in response to an icon rendering request, obtain an identifier of an icon to be rendered.

[0070] In the embodiments of the present application, a target application can run on an icon rendering device; during the running of the target application, when the icon rendering device determines an icon to be rendered based on the icon rendering logic of the target application, an icon rendering request is obtained; thus, in response to the icon rendering request, the icon rendering device obtains the identifier corresponding to the icon to be rendered, and thus obtains the identifier of the icon to be rendered.

[0071] It should be noted that the target application refers to an application used to implement the target function. For example, instant messaging applications, video playback applications, game applications, and so on. The icon rendering device needs to render icons during the operation of the target application to implement corresponding functions (such as prompting, triggering, beautifying, etc.) based on the rendered icons. The icon rendering request is used to request the rendering of the icon corresponding to the to-be-rendered icon identifier, and the to-be-rendered icon is the identifier corresponding to the icon to be rendered by the icon rendering device, which is used to determine the icon to be rendered.

[0072] S402. Obtain the to-be-rendered icon data corresponding to the to-be-rendered icon identifier from the dynamic graph data of the volatile storage device.

[0073] In the embodiment of the present application, during the operation of the target application, the icon rendering device has loaded the dynamic graph data into the volatile storage device to implement icon rendering based on the dynamic graph data in the above storage device; since the dynamic graph data is used to store at least one icon data of the most recently requested, therefore, the icon rendering device matches based on the to-be-rendered icon identifier in the dynamic graph data, and the icon data obtained by the matching is the to-be-rendered icon data corresponding to the to-be-rendered icon identifier.

[0074] It should be noted that the volatile storage device includes video memory or memory; when the volatile storage device includes video memory, the icon rendering device realizes the rendering of icons through the memory and the video memory. The icon rendering device responds to the running request of the target application, constructs dynamic graph data in the memory, and loads the dynamic graph data in the memory into the video memory to realize the rendering of icons based on the dynamic graph data in the video memory; and when the volatile storage device includes memory, the icon rendering device only realizes the rendering of icons through the memory. The icon rendering device responds to the running request of the target application, constructs dynamic graph data in the memory to realize the rendering of icons based on the dynamic graph data in the memory; among them, constructing dynamic graph data in the memory can be achieved by constructing an image file in the memory, or by loading the image file pre-constructed in the non-volatile storage device into the memory. The embodiment of the present application does not limit this; and when rendering the first icon of the target application, the dynamic graph data in the volatile storage device may include the icon data with a relatively high estimated rendering frequency, or may not include any icon data. The embodiment of the present application does not limit this, and with the dynamic update of the dynamic graph data by each subsequent icon data to be rendered, the dynamic graph data stores at least one icon data of the most recently requested to be rendered; in addition, the dynamic graph data includes at least one icon data of the most recently requested, and may also include icon data with a relatively high request frequency.

[0075] It should also be noted that the dynamic graph data is the rendering data of an image; here, the icon rendering device can also implement the icon rendering method provided in the embodiments of the present application through multiple dynamic graph data; and when the number of icon data is large, the size of the dynamic graph data can also be adjusted to carry more icon data. For example, the size of the dynamic graph data can be adjusted from 1024*1024 to 2048*2048.

[0076] S403. By rendering the icon data to be rendered, present the target icon corresponding to the identifier of the icon to be rendered in the target application interface of the target application.

[0077] In the embodiments of the present application, after the icon rendering device obtains the icon data to be rendered, by rendering the icon data to be rendered, the icon corresponding to the identifier of the icon to be rendered is also rendered. Here, it is called the target icon; and it is easy to know that when the target application interface appears during the running of the target application, the target icon is presented in the target application interface. Among them, the target icon is the icon to be rendered.

[0078] It should be noted that the target application interface can be a function page of the target application, and the target icon is an icon in the target application interface; for example, when the target application interface is a combat page of a virtual scene, the target icon can be a shooting icon in the combat page of the virtual scene; when the target application interface is a login page, the target icon can be the application icon of the target application in the login page. Among them, the target application is used to implement a specified function by rendering the target application interface.

[0079] It can be understood that by making the recently requested icon data into a dynamic graph data to dynamically store the icon data to be requested in the dynamic graph data, so that during the running of the target application, the icon rendering during the running of the target application can be completed through the dynamic graph data, and the dynamic graph data is the rendering data of an image; in this way, the loading amount of the icon data can be reduced, the resource consumption during the icon rendering process can be reduced, and thus the efficiency of icon rendering can be improved.

[0080] See Figure 5 , Figure 5 is the flowchart of the icon rendering method provided by the embodiments of the present application Figure 2 ; as Figure 5 shown, in the embodiments of the present application, after S401, S404 to S407 are further included; that is to say, during the running of the target application by the icon rendering device, in response to the icon rendering request, after obtaining the identifier of the icon to be rendered, the icon rendering method further includes S404 to S407, and each step will be described separately below.

[0081] S404. When the dynamic graph data does not include the to-be-rendered icon data corresponding to the to-be-rendered icon identifier, in the non-volatile storage device, determine the to-be-rendered icon data corresponding to the to-be-rendered icon identifier.

[0082] In the embodiment of the present application, when the icon rendering device fails to match the icon data based on the to-be-rendered icon identifier in the dynamic graph data, it indicates that the dynamic graph data does not include the to-be-rendered icon data corresponding to the to-be-rendered icon identifier; at this time, the icon rendering device reads the to-be-rendered icon data corresponding to the to-be-rendered icon identifier from the non-volatile storage device, so as to implement icon rendering based on the to-be-rendered icon data read from the non-volatile storage device.

[0083] It should be noted that all the icons of the target application are stored in the non-volatile storage device. Among them, the non-volatile storage device can be the hard disk of the icon rendering device, or the optical disc or USB flash drive in the icon rendering device, etc. The embodiment of the present application does not limit this.

[0084] S405. Based on the size of the to-be-rendered icon data, determine the target block in the dynamic graph data.

[0085] S406. Load the to-be-rendered icon data into the target block.

[0086] In the embodiment of the present application, in order to update the to-be-rendered icon data read from the non-volatile storage device to the dynamic graph data, the icon rendering device first determines the storage block in the dynamic graph data that can carry the to-be-rendered icon data based on the size of the to-be-rendered icon data, and thus obtains the target block; then loads the to-be-rendered icon data into the target block; at this time, the to-be-rendered icon data is updated to the dynamic graph data.

[0087] S407. By rendering the to-be-rendered icon data in the target block, present the target icon corresponding to the to-be-rendered icon identifier in the target application interface.

[0088] In the embodiment of the present application, after the icon rendering device updates the to-be-rendered icon data to the dynamic graph data, the dynamic graph data includes the to-be-rendered icon data. Therefore, by rendering the to-be-rendered icon data in the target block of the dynamic icon data, the icon rendering device realizes the rendering of the target icon corresponding to the to-be-rendered icon identifier in the target application interface.

[0089] It should be noted that S402 and S403 describe the icon rendering process in which the icon rendering device hits the icon data based on the to-be-rendered icon identifier in the dynamic graph data, and S404 to S407 describe the icon rendering process in which the icon rendering device fails to hit the icon data based on the to-be-rendered icon identifier in the dynamic graph data.

[0090] It can be understood that when the icon rendering device fails to hit the icon data to be rendered in the dynamic graph data, the dynamic graph data is updated by reading the icon data to be rendered from the non-volatile storage device and loading it into the dynamic graph data, so that the icon data stored in the dynamic graph data is the most recently requested icon data.

[0091] In the embodiment of the present application, after the icon rendering device completes the rendering of the target icon, it will also update the request information of the icon data to be rendered in the dynamic graph data, so as to update the dynamic graph data based on the updated request information. Thus, after S403 or after S407, the icon rendering method further includes S408 to S410 (not shown in the figure); that is to say, after the icon rendering device renders the icon data to be rendered and presents the target icon corresponding to the identifier of the icon to be rendered in the target application interface of the target application, or, after the icon rendering device renders the icon data to be rendered in the target block and presents the target icon corresponding to the identifier of the icon to be rendered in the target application interface, the icon rendering device method further includes S408 to S410, and the following will explain each step separately.

[0092] S408: Update the request count of the icon data to be rendered in the dynamic graph data.

[0093] It should be noted that the request information of the icon data to be rendered updated by the icon rendering device includes the request count; wherein, the request count is the number of times of requesting the icon data to be rendered. After this rendering is completed, the request information is updated, that is, the request count is incremented by 1.

[0094] S409: When the occupied space corresponding to the dynamic graph data is equal to the specified space, determine the icon data to be deleted based on at least one of the lowest request count and the longest recent request duration.

[0095] It should be noted that the specified space is the maximum space corresponding to the dynamic graph data; when the occupied space corresponding to the dynamic graph data is equal to the specified space, or when the difference between the specified space and the occupied space is less than the specified value, it indicates that the icon data in the dynamic graph data is full. At this time, the icon rendering device clears the icon data in the dynamic graph data; when clearing, the icon rendering device clears the icon data based on at least one of the request times and the most recent request duration. Thus, the icon rendering device can clear the icon data with the fewest request times, can also clear the icon data with the longest most recent request duration, and can also clear the icon data with the fewest request times and the longest most recent request duration. The embodiments of the present application do not limit this; correspondingly, the icon data to be deleted can be the icon data with the fewest request times, can also be the icon data with the longest most recent request duration, and can also be the icon data with the fewest request times and the longest most recent request duration. Among them, the most recent request duration refers to the duration between the time when the icon data was most recently requested and the current time.

[0096] S410. Delete the icon data to be deleted to obtain a free block.

[0097] In the embodiments of the present application, after the icon rendering device determines the icon data to be deleted, it deletes the icon data to be deleted from the dynamic graph data, and thus obtains a free block in the dynamic graph data. Among them, the free block is used to store new icon data, and the size of the free block is greater than or equal to the icon data to be deleted.

[0098] It can be understood that when the dynamic graph data is full, the icon rendering device clears the dynamic graph data to obtain a free block for storing the most recently requested (new) icon data. Since the clearing is based on at least one of the request times and the most recent request duration, the hit rate of the icon data in the dynamic graph data can be improved.

[0099] See Figure 6 , Figure 6 is the flowchart of the icon rendering method provided by the embodiments of the present application Figure 3 ; as Figure 6 shown, in the embodiments of the present application, after S404, S411 and S412 are further included; that is to say, after the icon rendering device determines the icon data to be rendered corresponding to the icon identifier to be rendered in the non-volatile storage device, the icon rendering method further includes S411 and S412, which will be described separately below.

[0100] S411. When the dynamic graph data includes at least one free block and the gear size corresponding to each free block is less than the size of the icon data to be rendered, load the icon data to be rendered into the specified block of the volatile storage device.

[0101] In an embodiment of the present application, after the icon rendering device determines the icon data to be rendered in the non-volatile storage device, it loads the icon data to be rendered into the dynamic graph data and first determines whether the dynamic graph data can store the icon data to be rendered. Here, when the dynamic graph data includes at least one free block and the gear size corresponding to each free block is smaller than the size of the icon data to be rendered, it indicates that although there is free space in the dynamic graph data, the free space is not sufficient to store the icon data to be rendered. At this time, in order to ensure the rendering of the icon data to be rendered, the icon rendering device loads the icon data to be rendered into a specified block in the volatile storage device.

[0102] It should be noted that the specified block can be a storage block in another graph data created based on the icon data to be rendered in the volatile storage device, independent of the dynamic graph data. Here, when the dynamic graph data can store the icon data to be rendered, the icon data to be rendered can be stored in the dynamic graph data again, or can continue to be stored in the specified block. The embodiment of the present application does not limit this.

[0103] S412. By rendering the icon data to be rendered in the specified block, in the target application interface, present the target icon corresponding to the identifier of the icon to be rendered.

[0104] In an embodiment of the present application, after the icon rendering device updates the icon data to be rendered to the specified block, the specified block also includes the icon data to be rendered. Thus, by rendering the icon data to be rendered in the specified block, the icon rendering device realizes the rendering of the target icon corresponding to the identifier of the icon to be rendered in the target application interface.

[0105] It should be noted that when the dynamic graph data is in a full state, the icon rendering device can also update the icon data to be rendered to the specified block.

[0106] It can be understood that when the dynamic graph data includes free blocks but the free blocks are not sufficient to carry the icon data to be rendered, the icon rendering device stores the icon data to be rendered through the specified block in the volatile storage device, ensuring the normal rendering of the target icon in the target application and improving the icon rendering effect.

[0107] In an embodiment of the present application, Figure 5 and Figure 6 S405 in

[0108] S4051. Obtain the set of free blocks in the dynamic graph data.

[0109] In the embodiment of the present application, the icon rendering device has previously divided the storage space in the dynamic graph data into storage blocks, so that the dynamic graph data corresponds to multiple storage blocks. When the icon rendering data loads the icon data to be rendered into the dynamic graph data, it first obtains a set of free blocks from the multiple storage blocks corresponding to the dynamic graph data.

[0110] It should be noted that the set of free blocks is a set composed of free storage blocks, where free means that no icon data is stored.

[0111] S4052. By traversing the set of free blocks, obtain a free block whose gear size is greater than or equal to the size of the icon data to be rendered and is closest to the size of the icon data to be rendered, and obtain the target block.

[0112] In the embodiment of the present application, the icon rendering device traverses each storage block in the set of free blocks to determine a free block whose gear size is greater than or equal to the size of the icon data to be rendered, and selects the free block closest to the size of the icon data to be rendered from the determined free blocks, thus obtaining the target block for storing the icon data to be rendered. Among them, the gear size is the size of the free blocks in the set of free blocks. Here, the gear size of the target block is greater than or equal to the size of the icon data to be rendered.

[0113] In the embodiment of the present application, before S404, there is also a process of obtaining the dynamic graph data; thus, before S404, there are also S413 to S418 (not shown in the figure); that is to say, when the dynamic graph data does not include the icon data to be rendered corresponding to the icon identifier to be rendered, before the icon rendering device determines the icon data to be rendered corresponding to the icon identifier to be rendered in the non-volatile storage device, this icon rendering method also includes S413 to S418, and the following will explain each step separately.

[0114] S413. Build an image file of a specified space in the memory.

[0115] It should be noted that the image file of the specified space built by the icon rendering device in the memory is used to obtain the dynamic graph data. It is easy to know that the space size corresponding to this image file is the specified space, for example, 1024*1024, 1024*2048, 2048*2048, and so on.

[0116] S414. Based on various icon sizes corresponding to the icons of the target application, determine at least one gear size.

[0117] In an embodiment of the present application, the icon rendering device may divide an image file before storing icon data in the image file; here, the icon rendering device may divide the image file based on various icon sizes corresponding to the icon of the target application; thus, the icon rendering device determines at least one gear size corresponding to each storage block when dividing the image file based on various icon sizes. Wherein, one gear size is the size of one storage block.

[0118] Exemplarily, when the various icon sizes corresponding to the icon of the target application include 80*80 and 128*128, it can be determined that at least one gear size is 80*80 and 128*128.

[0119] S415. Divide the specified space of the image file into at least one subspace based on at least one gear size.

[0120] It should be noted that the at least one subspace divided by the icon rendering device corresponds one-to-one with the at least one gear size, and each gear size is used to divide the corresponding subspace.

[0121] S416. Divide the subspace in units of the gear size to obtain a gear block set including at least one gear block.

[0122] In an embodiment of the present application, when the icon rendering device divides the subspace in units of the gear size, it can obtain at least one gear block corresponding to one subspace; here, the icon rendering device combines the at least one gear block into a gear block set; thus, for the at least one subspace, at least one gear block set can be obtained. It is easy to know that the at least one subspace corresponds one-to-one with the at least one gear block set. Here, one gear block is one storage block.

[0123] Exemplarily, referring to Figure 7 , Figure 7 is a schematic diagram showing an exemplary division of the specified space of an image file provided by an embodiment of the present application; as Figure 7 shown, the at least one subspace includes subspace 7-1,..., subspace 7-n, and subspace 7-n+1, where n is a positive integer greater than 1; here, subspace 7-1 is divided into 16 64*64 gear blocks, subspace 7-n is divided into 4 256*256 gear blocks, and subspace 7-n+1 is divided into 2 512*512 gear blocks; here, the 16 64*64 gear blocks, the 4 256x256 gear blocks, and the 2 512*512 gear blocks are respectively a gear block set.

[0124] S417. When the volatile storage device includes a memory, determine the image file including at least one gear block set corresponding to at least one subspace as dynamic graph data.

[0125] S418. When the volatile storage device includes video memory, an image file including at least one set of gear blocks corresponding to at least one subspace is determined as dynamic graph data, and the dynamic graph data is loaded into the video memory.

[0126] In the embodiment of the present application, when the volatile storage device includes video memory, after the icon rendering device determines an image file including at least one set of gear blocks as dynamic graph data, since the dynamic graph data is in the memory at this time and the icon rendering device renders through the data in the video memory, it is also necessary to load the dynamic graph data into the video memory here.

[0127] It should be noted that when the dynamic graph data includes at least one set of gear blocks, and the set of gear blocks includes at least one gear block, the set of free blocks is composed of the free gear blocks in at least one set of gear blocks.

[0128] It can be understood that before the icon rendering device stores icon data in the dynamic graph data, the specified space corresponding to the dynamic graph data is divided into gear blocks in advance based on various icon sizes, realizing the customization of the storage space of the icon data, and being able to reduce the fragmentation when storing the icon data and reduce the degree of fragmentation.

[0129] In the embodiment of the present application, the icon rendering device in S417 and S418 determines an image file including at least one set of gear blocks corresponding to at least one subspace as dynamic graph data, including: the icon rendering device generates graphic resources for each gear block in each set of gear blocks in at least one set of gear blocks corresponding to at least one subspace, and obtains at least one set of graphic resources corresponding to at least one subspace; and determines the image file including at least one set of graphic resources as dynamic graph data.

[0130] It should be noted that since the rendering of the icon data is realized based on the graphic resources, here, the icon rendering data creates graphic resources (Sprite Asset) for each divided gear block to pre-create the graphic resources of the image data and realize the offline creation of the graphic resources. Among them, the graphic resources are used to store an icon data, and each set of graphic resources includes at least one graphic resource. In addition, since the graphic resources of each gear block are pre-generated for the icon data, when storing the icon data into the gear block, the icon data can be directly stored into the graphic resources of the gear block.

[0131] Exemplarily, refer to Figure 8 , Figure 8 is an analysis diagram of the result of creating graphic resources provided by an embodiment of the present application; as Figure 8 shown, the result parameter 8-1 is the resource consumption of creating graphic resources 10 times.

[0132] It is understandable that before the icon rendering device stores the icon data in the dynamic graph data, not only does it pre-divide the specified space corresponding to the dynamic graph data into gear blocks based on various icon sizes, but it also completes the offline creation of graphic resources for the gear blocks. Since the creation process of graphic resources includes operations such as traversing pixels, it takes a long time and thus consumes a large amount of resources. Therefore, by creating graphic resources offline, the icon rendering efficiency can be improved.

[0133] In the embodiment of the present application, Figure 5 S405 in can also be implemented through S4053 (not shown in the figure); that is, the icon rendering device determines the target block in the dynamic graph data based on the size of the icon data to be rendered, including S4053. The following describes this step.

[0134] S4053: Divide out a gear block whose gear size matches the size of the icon data to be rendered from the allocable blocks corresponding to the dynamic graph data to obtain the target block.

[0135] In the embodiment of the present application, when the icon rendering device stores the icon data in the dynamic graph data, it divides the storage blocks of the allocable blocks corresponding to the dynamic graph data to divide out a gear block whose gear size matches the size of the icon data to be rendered; wherein, the allocable blocks are used to allocate gear blocks for the icon data by dividing the gear blocks. Here, the gear size of the target block is the same as the size of the icon data to be rendered.

[0136] Exemplarily, referring to Figure 9 , Figure 9 is a schematic diagram of the result of dividing the target block from the allocable block provided by the embodiment of the present application; as Figure 9 shown, in the dynamic graph data 9-1, the rectangular filled block is a gear block, the sizes of the gear blocks are not fixed, and each gear block is divided according to the size of the icon data, with high flexibility and versatility.

[0137] In the embodiment of the present application, another process of obtaining the dynamic graph data is also included before S404; thus, S419 to S422 (not shown in the figure) are also included before S404; that is, when the dynamic graph data does not include the icon data to be rendered corresponding to the icon identifier to be rendered, before the icon rendering device determines the icon data to be rendered corresponding to the icon identifier to be rendered in the non-volatile storage device, the icon rendering method further includes S419 to S422. The following describes each step separately.

[0138] S419: Construct an image file of the specified space in the memory.

[0139] It should be noted that the descriptions corresponding to S419 and S413 in terms of implementation are the same, and the embodiments of this application will not elaborate on them here.

[0140] S420. Determine the free space in the specified space of the image file as an allocable block.

[0141] It should be noted that the icon rendering device divides the storage block from the free space in the specified space of the image file. Thus, the icon rendering device determines the free space in the specified space of the image file as an allocable block.

[0142] S421. When the volatile storage device includes memory, determine the image file including the allocable block as dynamic graphic data.

[0143] S422. When the volatile storage device includes video memory, determine the image file including the allocable block as dynamic graphic data, and load the dynamic graphic data into the video memory.

[0144] In the embodiments of this application, when the volatile storage device includes video memory, after the icon rendering device determines the image file including the allocable block as dynamic graphic data, since the dynamic graphic data is in the memory at this time, and the icon rendering device renders through the data in the video memory, it is also necessary to load the dynamic graphic data into the video memory here.

[0145] In the embodiments of this application, when the icon rendering device loads the texture of the icon data to be rendered into the target block, it includes: loading the icon data to be rendered into the video memory; or, loading the icon data to be rendered into the memory, and then loading the icon data to be rendered in the memory into the video memory; or, loading the icon data to be rendered into the memory, and obtaining the pixel set of the icon data to be rendered in the memory through the compatible memory to get the texture of the icon data to be rendered, and loading the texture of the icon data to be rendered into the video memory through the memory; copying the texture of the icon data to be rendered from the video memory to the graphic resource of the target block.

[0146] It should be noted that the icon rendering device can use three texture copy methods to load the texture of the icon data to be rendered into the graphic resource corresponding to the target block. One texture copy method is to directly load the icon data to be rendered into the video memory to copy the texture of the icon data to be rendered from the video memory to the graphic resource of the target block; another texture copy method is to load the icon data to be rendered into the video memory through the memory to copy the texture of the icon data to be rendered from the video memory to the graphic resource of the target block; and another texture copy method is to load the icon data to be rendered into the video memory through the memory and the compatible memory (Mono memory) to copy the texture of the icon data to be rendered from the video memory to the graphic resource of the target block. Here, the memory refers to the native memory, and the compatible memory is used to achieve compatibility between different program modules.

[0147] In an embodiment of the present application, when the icon rendering device copies the texture of the icon data to be rendered from the video memory to the graphic resources of the target block, if the target block is determined by traversing the set of free blocks, the determined target block already includes the corresponding graphic resources, so the icon rendering device can directly copy the texture of the icon data to be rendered from the video memory to the graphic resources of the target block; if the target block is determined by the allocable blocks, the icon rendering device needs to first generate the graphic resources corresponding to the target block, and then copy the texture of the icon data to be rendered from the video memory to the graphic resources of the target block.

[0148] Next, an exemplary application of the embodiment of the present application in an actual application scenario will be described. This exemplary application describes the process of rendering the icons of a game application (referred to as the target application) during the operation of the game application.

[0149] See Figure 10 , Figure 10 is a schematic diagram of an exemplary icon rendering method provided by an embodiment of the present application; as Figure 10 shown, this exemplary icon rendering method includes S1001 to S1006, and each step will be described separately below.

[0150] S1001. Request icon data (referred to as icon data to be rendered).

[0151] It should be noted that the game application 10-1 requests icon data from the dynamic atlas 10-2 (referred to as dynamic map data) according to the resource path through the icon rendering request; here, the game application 10-1 can request icon data through the icon identifier (referred to as the icon identifier to be rendered), and the resource path can be used to point to the dynamic atlas 10-2 in the memory, or can also be used to point to the dynamic atlas 10-2 in the video memory.

[0152] S1002. Obtain the request result.

[0153] It should be noted that when the request result is a hit, that is, the dynamic atlas 10-2 includes the requested icon data, at this time, the game application 10-1 renders the icon based on the requested icon data; when the request result is a miss, that is, the dynamic atlas 10-2 does not include the requested icon data, at this time, the game application 10-1 executes S1003.

[0154] S1003. Load icon data.

[0155] It should be noted that the game application 10-1 requests the hard disk 10-3 (referred to as the non-volatile storage device) in the terminal (referred to as the icon rendering device) to load the icon data.

[0156] S1004. Load the icon data for loading.

[0157] It should be noted that the terminal loads the loaded icon data into memory 10-4. Additionally, when the dynamic atlas 10-2 is loaded into the video memory, the terminal can add the loaded icon data to the dynamic atlas 10-2 through memory 10-4, or directly load the loaded icon data into the dynamic atlas 10-2.

[0158] S1005. Determine the gear block (referred to as the target block) and perform texture copying of the icon data.

[0159] It should be noted that the terminal determines the gear block in the dynamic atlas 10-2 for storing the loaded icon data and copies the loaded icon data into the gear block.

[0160] S1006. Return the icon data in the gear block.

[0161] It should be noted that the terminal sends the graphic resource (Sprite Asset) in the gear block of the dynamic atlas 10-2 to the target application 10-1, thus realizing the return of the icon data in the gear block.

[0162] Next, the determination and texture copying of the gear block in S1005 will be further described.

[0163] In the embodiment of the present application, the gear block can be determined using the allocation / release (Malloc / Free) mode, or the small object memory pool mode can be used to determine the gear block.

[0164] When using the allocation / release mode to determine the gear block, the remaining space of the dynamic atlas (referred to as the allocable block) is divided into blocks through binary space partitioning to determine the gear block. Here, after each block division, the remaining space is managed according to the binary space partitioning, and recursive space partitioning is performed on the managed remaining space during the next block division, thereby realizing the next block division; therefore, the allocation / release mode has high flexibility and strong versatility. For requests of any size, as long as the remaining space allows, it can be allocated to the game application; thus, the block size is not fixed, and on-demand allocation can be achieved, and the block size is the same as the request size. See Figure 9 . Additionally, when using the allocation / release mode to determine the gear block, it is necessary to create a graphic (Sprite) in real time to obtain the graphic resource corresponding to the gear block.

[0165] When determining the gear block in the small object memory pool mode, the customization of the gear block can be realized based on various icon sizes of the game application, and the offline creation of the graphics (Sprite) can also be realized. Among them, customizing the gear block based on various icon sizes refers to the process of determining the size of the gear block based on the icon size. For example, the icon sizes in the game application usually include two gears of 128*128 and 80*80 (referred to as gear sizes), and the dynamic atlas can be pre-divided into gear blocks corresponding to the two gears of 128*128 and 80*80.

[0166] See Figure 11 , Figure 11 is a schematic diagram of an exemplary method for determining the gear block provided by an embodiment of the present application; as Figure 11 shown, among the gear blocks 11-1, an exemplary 128*128 gear block 11-11, an 80*80 gear block 11-12, and another 80*80 gear block 11-13 are shown.

[0167] Here, the graphics (Sprite) of each gear block 11-1 in Figure 11 can also be created offline to obtain the graphic resources (Sprite Asset) corresponding to each gear block. See Figure 12 , Figure 12 is a schematic diagram of an exemplary method for each gear block provided by an embodiment of the present application; as Figure 12 shown, the area 12-1 includes Figure 11 the 80*80 gear block in Figure 11 , and the area 12-2 includes

[0168] the 128*128 gear block in Figure 11 - 12 , where each gear block includes the corresponding graphic resources (Sprite Asset). Figure 13 , Figure 13 Based on Figure 13As shown, in the dynamic atlas 13-1, the 80*80 gear block stores 80*80 icon data, and the 128*128 gear block stores 128*128 icon data. Additionally, when the size of the loaded icon data is 60*60, an 80*80 gear block is determined in the dynamic atlas 13-1. At this time, since the size of the icon data 60*60 does not match the size of the determined gear block 80*80, the vertices of the icon data are reloaded to make the size of the icon data match the size of the determined gear block. When all the 80*80 gear blocks in the dynamic atlas 13-1 are used up, a 128*128 gear block is determined in the dynamic atlas 13-1. When all the 80*80 and 128*128 gear blocks in the dynamic atlas 13-1 are used up, a new Sprite is created to ensure the correctness of icon rendering.

[0169] It should also be noted that in the dynamic atlas 13-1, when the dynamic atlas and icon data are in a compressed format (such as ETC2), the padding between icons can be set to a specified value (such as 4). Additionally, when the dynamic atlas 13-1 is full, the icon data in the dynamic atlas 13-1 can be cleared based on the request count and the recent request duration of the icon data.

[0170] In the embodiments of this application, the texture copy method 1 from video memory to video memory (Graphics.CopyTexture) can be adopted, the texture copy method 2 from memory (Native memory) through compatible memory (Mono memory) to video memory (Texture.Get / SetPixels) can also be adopted, and the texture copy method 3 from memory (Native memory) to video memory (UploadTextureSubData2D) can also be adopted. The comparison results of the three texture copy methods are shown in Table 1.

[0171] Table 1

[0172]

[0173] Based on Table 1, it can be seen that the processing flow of texture copy method 1 is the copy from video memory to video memory, without storing icon data (Texture) in memory, with the highest efficiency, and supports compressed formats (such as DXT, ETC, etc.), which is implemented by calling the interface (glCopyImageSubData interface) in the Open Graphics Library (OpenGL). The processing flow of texture copy method 2 needs to be implemented through Mono memory, so the texture copy time is longer and the efficiency is the lowest; see Figure 14 , Figure 14 is an exemplary text copy schematic diagram provided by the embodiments of this application; as Figure 14As shown, when copying the texture of icon 14-1 to dynamic atlas 14-2 for rendering, the pixel array 14-5 (referred to as pixel set) of icon 14-1 in memory 14-3 (Native memory) is obtained through the pixel acquisition function (GetPixels) in the compatible memory 14-4 (Mono memory), and the pixel array 14-5 is set in the dynamic atlas 14-2 in memory 14-3 through the pixel setting function (SetPixels). Thus, the texture of icon 14-1 is uploaded to the video memory 14-6 by calling the interface (Apply interface) to achieve the rendering of icon 14-1. The texture copy method 3 is implemented by calling the interface (glTexSubImage2D interface) in the Open Graphics Library (OpenGL).

[0174] It can be understood that by dynamically updating the icon data to be rendered during the running of the game application into a shared dynamic atlas, texture sharing is achieved, which can reduce resource consumption (memory and Draw Call) and improve the efficiency of icon rendering.

[0175] The following continues to describe the exemplary structure of the icon rendering device 255 provided in the embodiment of the present application as a software module. In some embodiments, as Figure 3 shown, the software module in the icon rendering device 255 stored in the memory 250 may include:

[0176] An identifier acquisition module 2551, configured to acquire an icon identifier to be rendered in response to an icon rendering request during the running of a target application;

[0177] An icon acquisition module 2552, configured to acquire icon data to be rendered corresponding to the icon identifier to be rendered from the dynamic graph data of the volatile storage device, where the volatile storage device includes a video memory or a memory, the dynamic graph data is the rendering data of an image, and the dynamic graph data is used to store at least one icon data requested recently;

[0178] An icon rendering module 2553, configured to present a target icon corresponding to the icon identifier to be rendered in a target application interface of the target application by rendering the icon data to be rendered.

[0179] In an embodiment of the present application, the icon rendering device 255 further includes a data update module 2554, configured to, when the dynamic graph data does not include the icon data to be rendered corresponding to the icon identifier to be rendered, determine the icon data to be rendered corresponding to the icon identifier to be rendered in a non-volatile storage device; determine a target block in the dynamic graph data based on the size of the icon data to be rendered; load the icon data to be rendered into the target block; and present the target icon corresponding to the icon identifier to be rendered in the target application interface by rendering the icon data to be rendered in the target block.

[0180] In an embodiment of the present application, the data update module 2554 is further configured to update the request count of the icon data to be rendered in the dynamic graph data; when the occupied space corresponding to the dynamic graph data is equal to the specified space, determine the icon data to be deleted based on at least one of the lowest request count and the longest recent request duration, where the specified space is the maximum space corresponding to the dynamic graph data; and delete the icon data to be deleted to obtain an idle block, where the idle block is used to store new icon data.

[0181] In an embodiment of the present application, the icon rendering module 2553 is further configured to, when the dynamic graph data includes at least one idle block and the gear size corresponding to each idle block is smaller than the size of the icon data to be rendered, load the icon data to be rendered into a specified block in the volatile storage device; and present the target icon corresponding to the icon identifier to be rendered in the target application interface by rendering the icon data to be rendered in the specified block.

[0182] In an embodiment of the present application, the data update module 2554 is further configured to obtain a set of idle blocks in the dynamic graph data; and obtain the target block by traversing the set of idle blocks to obtain an idle block whose gear size is greater than or equal to the size of the icon data to be rendered and is closest to the size of the icon data to be rendered, where the gear size is the size of the idle block in the set of idle blocks.

[0183] In an embodiment of the present application, the icon rendering device 255 further includes a data construction module 2555, configured to construct an image file of a specified space in the memory; determine at least one gear size based on various icon sizes corresponding to the icon of the target application; divide the specified space of the image file into at least one sub-space based on at least one of the gear sizes; divide the sub-space in units of the gear size to obtain a gear block set including at least one gear block; when the volatile storage device includes the memory, determine the image file including at least one gear block set corresponding to at least one of the sub-spaces as the dynamic graph data, where the free block set is composed of the free gear blocks in at least one of the gear block sets; when the volatile storage device includes the video memory, determine the image file including at least one gear block set corresponding to at least one of the sub-spaces as the dynamic graph data, and load the dynamic graph data into the video memory.

[0184] In an embodiment of the present application, the data construction module 2555 is further configured to generate graphic resources for each gear block in each gear block set in at least one gear block set corresponding to at least one of the sub-spaces, to obtain at least one graphic resource set corresponding to at least one of the sub-spaces, where the graphic resources are used to store one icon data, and each graphic resource set includes at least one of the graphic resources; determine the image file including at least one of the graphic resource sets as the dynamic graph data.

[0185] In an embodiment of the present application, the data construction module 2555 is further configured to divide, from the allocable blocks corresponding to the dynamic graph data, gear blocks whose gear sizes match the size of the icon data to be rendered, to obtain the target blocks, where the allocable blocks are used to allocate the gear blocks for the icon data by dividing the gear blocks.

[0186] In an embodiment of the present application, the data construction module 2555 is further configured to construct an image file of a specified space in the memory; determine the free space in the specified space of the image file as the allocable blocks; when the volatile storage device includes the memory, determine the image file including the allocable blocks as the dynamic graph data; when the volatile storage device includes the video memory, determine the image file including the allocable blocks as the dynamic graph data, and load the dynamic graph data into the video memory.

[0187] In the embodiment of the present application, the data update module 2554 is further configured to load the icon data to be rendered into the video memory; or, load the icon data to be rendered into the memory and then load the icon data to be rendered in the memory into the video memory; or, load the icon data to be rendered into the memory, obtain a pixel set of the icon data to be rendered in the memory through a compatible memory to obtain a texture of the icon data to be rendered, and load the texture of the icon data to be rendered into the video memory through the memory; copy the texture of the icon data to be rendered from the video memory into the graphic resources of the target block.

[0188] In the embodiment of the present application, the data update module 2554 is further configured to generate graphic resources corresponding to the target block.

[0189] The embodiment of the present application provides a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device (referred to as an icon rendering 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 icon rendering method in the embodiment of the present application as described above.

[0190] The embodiment of the present application provides a computer-readable storage medium storing executable instructions, where the executable instructions are stored. When the executable instructions are executed by a processor, the processor will be caused to execute the icon rendering method provided by the embodiment of the present application. For example, as Figure 4 shown in the icon rendering method.

[0191] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disc, or CD-ROM; or may be various devices including one or any combination of the above memories.

[0192] In some embodiments, the executable instructions may be in the form of a program, software, software module, script, or code, and may be written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including being deployed as an independent program or being deployed as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0193] As an example, executable instructions may or may not correspond to files in a file system, and may be stored as part of a file that stores other programs or data. For example, they may be stored in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program under discussion, or in multiple cooperating files (e.g., files that store one or more modules, subroutines, or code portions).

[0194] As an example, executable instructions can be deployed to execute on one computer device (in this case, this one computer device is the icon rendering device), or on multiple computer devices located at one location (in this case, the multiple computer devices located at one location are the icon rendering devices), or on multiple computer devices distributed across multiple locations and interconnected by a communication network (in this case, the multiple computer devices distributed across multiple locations and interconnected by a communication network are the icon rendering devices).

[0195] In summary, through the embodiments of the present application, by making the most recently requested icon data into a dynamic graph data to dynamically store the icon data to be requested in the dynamic graph data, during the running of the target application, the icon rendering during the running of the target application can be completed through the dynamic graph data, and the dynamic graph data is the rendering data of an image; thus, the loading amount of the icon data can be reduced, the resource consumption during the icon rendering process can be reduced, and thus, the efficiency of icon rendering can be improved; in addition, by updating the dynamic graph data based on the request count and the most recent request duration, the hit rate of the icon data in the dynamic graph data can be improved.

[0196] The above description is only for the embodiments of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent replacements, and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims

1. An icon rendering method, characterized in that, The method includes: During the running of the target application, in response to an icon rendering request, obtain the icon identifier to be rendered; When the dynamic graph data in the volatile storage device includes the icon data to be rendered corresponding to the icon identifier to be rendered, obtain, from the dynamic graph data, the icon data to be rendered corresponding to the icon identifier to be rendered, where the volatile storage device includes video memory or memory, the dynamic graph data is the rendering data of an image, and the dynamic graph data is used to store at least one icon data requested recently; By rendering the icon data to be rendered, present, in the target application interface of the target application, the target icon corresponding to the icon identifier to be rendered; When the dynamic graph data does not include the icon data to be rendered corresponding to the icon identifier to be rendered, determine, in the non-volatile storage device, the icon data to be rendered corresponding to the icon identifier to be rendered; Divide, from the allocable block corresponding to the dynamic graph data, a gear block whose gear size matches the size of the icon data to be rendered, to obtain a target block; Load the icon data to be rendered into the target block; By rendering the icon data to be rendered in the target block, present, in the target application interface, the target icon corresponding to the icon identifier to be rendered.

2. The method according to claim 1, characterized in that, After presenting, in the target application interface of the target application, the target icon corresponding to the icon identifier to be rendered by rendering the icon data to be rendered, or after presenting, in the target application interface, the target icon corresponding to the icon identifier to be rendered by rendering the icon data to be rendered in the target block, the method further includes: Update the request count of the icon data to be rendered in the dynamic graph data; When the occupied space corresponding to the dynamic graph data is equal to the specified space, determine the icon data to be deleted based on at least one of the lowest request count and the longest recent request duration, where the specified space is the maximum space corresponding to the dynamic graph data; Delete the icon data to be deleted to obtain a free block, where the free block is used to store new icon data.

3. The method according to claim 1, wherein After determining, in the non-volatile storage device, the icon data to be rendered corresponding to the icon identifier to be rendered, the method further includes: When the dynamic graph data includes at least one free block and the gear size corresponding to each free block is smaller than the size of the icon data to be rendered, load the icon data to be rendered into a specified block in the volatile storage device; By rendering the icon data to be rendered in the specified block, present, in the target application interface, the target icon corresponding to the icon identifier to be rendered.

4. The method according to claim 1, wherein Before determining, in the non-volatile storage device, the icon data to be rendered corresponding to the icon identifier to be rendered when the dynamic graph data does not include the icon data to be rendered corresponding to the icon identifier to be rendered, the method further includes: Construct an image file of the specified space in the memory; Determine the free space in the specified space of the image file as an allocable block; When the volatile storage device includes the memory, determine the image file including the allocable block as the dynamic graph data; When the volatile storage device includes the video memory, determine the image file including the allocable block as the dynamic graph data, and load the dynamic graph data into the video memory.

5. The method according to claim 1, characterized in that, When the volatile storage device includes the video memory, loading the icon data to be rendered into the target block includes: Loading the icon data to be rendered into the video memory; Alternatively, loading the icon data to be rendered into the memory, and then loading the icon data to be rendered in the memory into the video memory; Alternatively, loading the icon data to be rendered into the memory, obtaining a pixel set of the icon data to be rendered in the memory through a compatible memory to obtain a texture of the icon data to be rendered, and loading the texture of the icon data to be rendered into the video memory through the memory; Copying the texture of the icon data to be rendered from the video memory to the graphic resources of the target block.

6. The method according to claim 5, characterized in that, When the target block is obtained by dividing the allocable block, before copying the texture of the icon data to be rendered from the video memory to the graphic resources of the target block, the method further includes: Generating graphic resources corresponding to the target block.

7. An icon rendering device, characterized in that, The icon rendering device includes: An identification acquisition module, configured to acquire an icon identification to be rendered in response to an icon rendering request during the running of a target application; An icon acquisition module, configured to, when the dynamic graph data of the volatile storage device includes the icon data to be rendered corresponding to the icon identification to be rendered, acquire the icon data to be rendered corresponding to the icon identification to be rendered from the dynamic graph data, where the volatile storage device includes a video memory or a memory, the dynamic graph data is rendering data of an image, and the dynamic graph data is used to store at least one icon data requested recently; An icon rendering module, configured to present a target icon corresponding to the icon identification to be rendered in a target application interface of the target application by rendering the icon data to be rendered; when the dynamic graph data does not include the icon data to be rendered corresponding to the icon identification to be rendered, determine the icon data to be rendered corresponding to the icon identification to be rendered in a non-volatile storage device; dividing a gear block with a gear size matching the size of the icon data to be rendered from the allocable block corresponding to the dynamic graph data to obtain a target block; loading the icon data to be rendered into the target block; and presenting the target icon corresponding to the icon identification to be rendered in the target application interface by rendering the icon data to be rendered in the target block.

8. The device according to claim 7, characterized in that, The icon rendering device further includes: A data update module, configured to update the request times of the to-be-rendered icon data in the dynamic graph data; when the occupied space corresponding to the dynamic graph data is equal to the specified space, determine the to-be-deleted icon data based on at least one of the lowest request times and the longest recent request duration, where the specified space is the maximum space corresponding to the dynamic graph data; delete the to-be-deleted icon data to obtain a free block, where the free block is used to store new icon data.

9. The device according to claim 7, wherein the icon rendering module is further configured to, when the dynamic graph data includes at least one free block and the gear size corresponding to each free block is smaller than the size of the to-be-rendered icon data, load the to-be-rendered icon data into a specified block of the volatile storage device; by rendering the to-be-rendered icon data in the specified block, present the target icon corresponding to the to-be-rendered icon identifier in the target application interface.

10. The device according to claim 7, characterized in that The icon rendering device further includes: A data construction module, configured to construct an image file with a specified space in the memory; determine the free space in the specified space of the image file as an allocable block; when the volatile storage device includes the memory, determine the image file including the allocable block as the dynamic graph data; when the volatile storage device includes the video memory, determine the image file including the allocable block as the dynamic graph data and load the dynamic graph data into the video memory.

11. The device according to claim 7, wherein The icon rendering device further includes: A data update module, configured to load the to-be-rendered icon data into the video memory; or load the to-be-rendered icon data into the memory and then load the to-be-rendered icon data in the memory into the video memory; or load the to-be-rendered icon data into the memory, obtain the pixel set of the to-be-rendered icon data in the memory through a compatible memory to obtain the texture of the to-be-rendered icon data, and load the texture of the to-be-rendered icon data into the video memory through the memory; copy the texture of the to-be-rendered icon data from the video memory to the graphic resources of the target block.

12. The device according to claim 11, wherein the data update module is further configured to generate the graphic resources corresponding to the target block.

13. An icon rendering device, characterized in that, The icon rendering device includes: A memory, configured to store executable instructions; A processor, configured to implement the method according to any one of claims 1 to 6 when executing the executable instructions stored in the memory.

14. A computer-readable storage medium stores executable instructions, characterized in that, The executable instructions are configured to implement the method according to any one of claims 1 to 6 when being executed by the processor.

15. A computer program product comprising a computer program or instructions, characterized in that, When the computer program or instruction is executed by the processor, it implements the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Rendering system and method

    CN103295257A

  • Game rendering method and apparatus, storage device and terminal

    CN107463398A

  • Picture rendering method and device, equipment and storage medium

    CN112233009A