Data processing method and device, electronic equipment and storage medium

By adjusting and caching the bitmaps in the application interface, the interface rendering lag and delay problems are solved, and the interface update efficiency is improved.

CN118939352APending Publication Date: 2024-11-12DOUYIN VISION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310518681.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-09
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

In terminal devices, when an application updates the interface, it may cause lag and delay in the interface rendering, resulting in unresponsiveness of the interface.

Method used

By obtaining the bitmap collection used to render the application interface, adjusting the bitmap with a size exceeding the preset size, and converting the bitmap with appropriate size in the bitmap collection into texture data cache space to periodically clear the texture data to avoid cache saturation.

Benefits of technology

It improves the interface rendering efficiency of the operating system, reduces lag and delays during interface updates, and avoids the situation where the interface is unresponsive.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939352A_ABST
    Figure CN118939352A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data processing method and device, electronic equipment and a storage medium. The method comprises the steps that a bitmap set used for rendering an interface of an application program is obtained; for a first bitmap with the size exceeding a preset size in the bitmap set, adjusting the size of the first bitmap; respectively converting a second bitmap of which the size does not exceed a preset size in the bitmap set and the first bitmap of which the size is adjusted into texture data, and caching the texture data in a first texture cache space; wherein the first texture cache space is used for caching texture data corresponding to a third bitmap of each application program; the texture data corresponding to the third bitmap in the first texture cache space is periodically cleared; and based on the texture data corresponding to the first bitmap and the texture data corresponding to the second bitmap cached in the first texture cache space, rendering the interface of the application program. Through the embodiment, the interface rendering efficiency of the operating system can be improved, the interface updating efficiency is improved, and no response of the interface is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a data processing method, device, electronic device and storage medium. Background Art

[0002] In a terminal device, when an application needs to update the interface based on user operations, the application needs to cooperate with the operating system of the terminal device to complete the interface update. Specifically, the main thread of the application will hand over the interface rendering task to the operating system, which will render the interface. However, the interface update may be stuck and delayed, resulting in an unresponsive interface. Summary of the invention

[0003] The embodiments of the present disclosure provide a data processing method, device, electronic device and storage medium, which can improve the interface rendering efficiency of the operating system, improve the interface update efficiency, alleviate the freeze and delay during interface update, and avoid interface unresponsiveness.

[0004] In a first aspect, an embodiment of the present disclosure provides a data processing method, including:

[0005] Get the bitmap collection used to render the application's interface;

[0006] For a first bitmap in the bitmap set whose size exceeds a preset size, adjusting the size of the first bitmap;

[0007] Converting the second bitmap in the bitmap set whose size does not exceed the preset size and the first bitmap after the size adjustment into texture data respectively and caching them in a first texture cache space; wherein the first texture cache space is used to cache texture data corresponding to the third bitmap of each application; and the texture data corresponding to the third bitmap in the first texture cache space is periodically cleared;

[0008] The interface of the application is rendered based on the texture data corresponding to the first bitmap and the texture data corresponding to the second bitmap cached in the first texture cache space.

[0009] In a second aspect, an embodiment of the present disclosure provides a data processing device, including:

[0010] An acquisition unit, used for acquiring a bitmap set used for rendering an interface of an application program;

[0011] An adjusting unit, configured to adjust the size of a first bitmap in the bitmap set whose size exceeds a preset size;

[0012] A conversion unit, used for converting the second bitmap in the bitmap set whose size does not exceed the preset size and the first bitmap after the size adjustment into texture data respectively and caching them in a first texture cache space; wherein the first texture cache space is used for caching texture data corresponding to the third bitmap of each application; and the texture data corresponding to the third bitmap in the first texture cache space is periodically cleared;

[0013] A rendering unit is used to render the interface of the application based on the texture data corresponding to the first bitmap and the texture data corresponding to the second bitmap cached in the first texture cache space.

[0014] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising: a processor; and a memory configured to store computer-executable instructions, wherein the computer-executable instructions, when executed, enable the processor to implement the steps of the method described in the first aspect above.

[0015] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store computer-executable instructions, and the computer-executable instructions implement the steps of the method described in the first aspect when executed by a processor.

[0016] In one or more embodiments of the present disclosure, a bitmap set for rendering an application interface is obtained, and for a first bitmap in the bitmap set whose size exceeds a preset size, the size of the first bitmap is adjusted, and the second bitmap in the bitmap set whose size does not exceed the preset size and the first bitmap after the size adjustment are respectively converted into texture data and cached in a first texture cache space, and the first texture cache space is used to cache the texture data corresponding to the third bitmap of each application, and the texture data corresponding to the third bitmap in the first texture cache space is periodically cleared, and the interface of the application is rendered based on the texture data corresponding to the first bitmap and the texture data corresponding to the second bitmap cached in the first texture cache space. It can be seen that through this embodiment, the size of a bitmap with too large a size can be adjusted in the process of rendering the interface of the application, so that the bitmap size meets the requirements of interface rendering, and the failure of bitmap caching caused by the excessive size of the bitmap is avoided, and the problems such as interface rendering jamming or interface unresponsiveness are avoided, and the interface rendering efficiency of the operating system is improved, and the interface update efficiency is improved. Moreover, through this embodiment, the texture data corresponding to the third bitmap of each application cached in the first texture cache space can be periodically cleared, thereby avoiding the storage saturation of the first texture cache space leading to bitmap caching failure, avoiding problems such as slow interface rendering speed or unresponsive interface, and further improving the interface rendering efficiency of the operating system and improving the interface update efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate one or more embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present disclosure. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative labor.

[0018] Figure 1 A flowchart of a data processing method provided by an embodiment of the present disclosure;

[0019] Figure 2 A schematic diagram of the structure of a data processing device provided by an embodiment of the present disclosure;

[0020] Figure 3 A schematic diagram of the structure of an electronic device provided in one embodiment of the present disclosure. DETAILED DESCRIPTION

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

[0022] The embodiments of the present disclosure provide a data processing method, which can improve the interface rendering efficiency of the operating system and improve the interface update efficiency. To facilitate understanding of the methods in various embodiments of the present disclosure, the background knowledge involved in the embodiments of the present disclosure is briefly introduced here.

[0023] The terminal devices involved in various embodiments of the present disclosure include but are not limited to mobile phones, computers, tablet computers, car computers, wearable devices and other terminal devices. An operating system and an application program are running on the terminal device. The operating system can be any operating system such as Android, IOS, etc. The application program can be any program that can update the interface, such as a short video program, an instant messaging program, a shopping program, etc. The application program can also be a small program, such as a short video small program, an instant messaging small program, a shopping small program, etc. The application program can be used as long as it can update the interface during user use.

[0024] During the interface update process, the application obtains the bitmap required for the updated interface from its installation package or the corresponding server. The bitmap is converted into texture data and stored in the corresponding cache space. The GPU (graphics processing unit) reads the texture data from the cache space and renders the interface based on the read texture data. The GPU cannot process the bitmap directly, so it needs to convert the bitmap into texture data to be recognized and processed by the GPU. Therefore, it can be considered that texture data is a data format corresponding to the bitmap that can be understood and recognized by the GPU.

[0025] According to the research on existing technologies, an important factor affecting the efficiency of the operating system in rendering the screen is whether the texture data can be successfully cached in the cache space of the operating system. Specifically, the main thread of the application will hand over the drawing and rendering tasks to the operating system and wait for the message returned by the operating system. It can only release the wait and execute other tasks after receiving the release wait message returned by the operating system. When the texture data can be successfully cached in the cache space of the operating system, the operating system can quickly return the release wait message to the main thread of the application. Conversely, if the cache fails, it will cause the main thread of the application to wait for the return message of the operating system for a long time, causing the interface update to be stuck and delayed, resulting in an unresponsive interface.

[0026] Based on the above, an embodiment of the present disclosure provides a data processing method, which can be applied to a terminal device and executed by the terminal device. Figure 1 A flowchart of a data processing method provided by an embodiment of the present disclosure is shown in FIG. Figure 1 As shown, the method includes:

[0027] Step S102, obtaining a bitmap set for rendering the interface of the application program;

[0028] Step S104, adjusting the size of the first bitmap in the bitmap set whose size exceeds a preset size;

[0029] Step S106, converting the second bitmap whose size does not exceed the preset size and the first bitmap after the size adjustment in the bitmap set into texture data respectively and caching them in the first texture cache space; wherein the first texture cache space is used to cache the texture data corresponding to the third bitmap of each application; the texture data corresponding to the third bitmap in the first texture cache space is periodically cleared;

[0030] Step S108, rendering the interface of the application based on the texture data corresponding to the first bitmap and the texture data corresponding to the second bitmap cached in the first texture cache space.

[0031] It can be seen that through this embodiment, the size of the bitmap that is too large can be adjusted during the process of rendering the interface of the application, so that the bitmap size meets the requirements of the interface rendering, avoiding the failure of the bitmap cache due to the excessive size of the bitmap, avoiding the problems of interface rendering jamming or interface unresponsiveness, improving the interface rendering efficiency of the operating system, and improving the interface update efficiency. In addition, through this embodiment, the texture data corresponding to the third bitmap of each application cached in the first texture cache space can also be periodically cleared, thereby avoiding the failure of the bitmap cache due to the storage saturation of the first texture cache space, avoiding the problems of slow interface rendering or interface unresponsiveness, further improving the interface rendering efficiency of the operating system, and improving the interface update efficiency.

[0032] The method in this embodiment may be specifically executed by a specific plug-in, which is integrated into an installation package of the operating system and is installed into the terminal device together with the operating system.

[0033] In the above step S102, a bitmap set for rendering the interface of the application is obtained. Specifically, for each interface of the application, it is necessary to render through a corresponding bitmap set. A plurality of bitmaps are stored in the bitmap set. These bitmaps are the various graphics in the interface. For example, the bitmap may be the top logo or the bottom logo in the interface, or the graphics clicked by the user, etc. These bitmaps need to be rendered on the interface, and other text parts are added to form the entire interface. There can be a one-to-one correspondence between the interface and the bitmap set, and the same bitmap may exist in the bitmap sets corresponding to different interfaces. In this embodiment, a bitmap set for rendering the interface of the application can be obtained when the application is initialized, or when it is determined based on user operations that the interface of the application needs to be updated. The bitmap set includes a plurality of bitmaps, among which there may be bitmaps whose sizes are too large and exceed the preset size.

[0034] It can be understood that when caching texture data, there are certain requirements for the bitmap size, such as requiring the bitmap size to be equal to or less than the preset size. If the bitmap is too large, it will cause the texture data corresponding to the bitmap to fail to be cached, thereby causing problems such as interface rendering jams or unresponsive interfaces. Therefore, it is necessary to adjust the size of the bitmap that is too large so that it can be cached successfully. Based on this, in the above step S104, for the first bitmap in the bitmap set whose size exceeds the preset size, the size of the first bitmap is adjusted, and the size of the first bitmap is adjusted to within or equal to the preset size. The preset size may include the maximum width and maximum height of the bitmap. Here, the first bitmap can be scaled proportionally to ensure that the size of the first bitmap is adjusted to within or equal to the preset size while ensuring that the aspect ratio of the first bitmap remains unchanged, thereby ensuring that the image content is not deformed while adjusting the size.

[0035] It can be seen that through this embodiment, the size of a bitmap that is too large can be adjusted during the process of rendering the interface of the application, so that the bitmap size meets the requirements of interface rendering, avoiding the failure of bitmap caching due to the bitmap being too large, and avoiding problems such as interface rendering jams or interface unresponsiveness.

[0036] In one embodiment, the first bitmap is determined in the bitmap set in the following manner:

[0037] When the interface of the application is rendered based on the bitmap collection in the past, the call link of the bitmap in the bitmap collection is printed by printing the stack;

[0038] An identifier of a first bitmap is obtained based on the call link, and a first bitmap is determined in the bitmap set according to the identifier of the first bitmap.

[0039] Specifically, each interface of the application needs to be rendered through a corresponding bitmap set. Since each interface of the application may be presented repeatedly based on user operations, each interface of the application may be rendered repeatedly. Therefore, before rendering the interface of the application based on the bitmap set this time, when the interface of the application was rendered based on the above-mentioned bitmap set in history, the call link of the bitmaps in the bitmap set was printed by printing a stack, that is, printing a stack. The stack records the call link of the bitmaps in the bitmap set. The call link refers to the link of the function that calls the bitmap, which at least includes the name of the function that calls the bitmap, the calling relationship between multiple functions that call the bitmap, the identifier of the called bitmap, etc.

[0040] Then, based on the call link, the identifier of the first bitmap is obtained, and the first bitmap is determined in the bitmap set through the identifier of the first bitmap, so that before rendering the interface of the application based on the bitmap set this time, the first bitmap that is too large can be determined and marked, so that in the process of rendering the interface this time, there is no need to repeatedly determine the first bitmap, and the size of the first bitmap can be directly adjusted, thereby reducing the workload of rendering the interface and improving the efficiency of rendering the interface.

[0041] It can be seen that through this embodiment, before the interface of the application is rendered based on the bitmap set this time, when the interface of the application is rendered based on the above-mentioned bitmap set in the past, the first bitmap can be determined by means of a call link of a printing bitmap. On the one hand, before the interface of the application is rendered based on the bitmap set this time, the effect of determining that the first bitmap that is too large is obtained and marking it is achieved, so that in the process of rendering the interface this time, there is no need to repeatedly determine the first bitmap, and the size of the first bitmap can be directly adjusted, thereby reducing the workload of rendering the interface and improving the efficiency of rendering the interface. On the other hand, the first bitmap is determined by printing the stack, and the determination method is simple, efficient, and easy to implement.

[0042] In one embodiment, printing the call link of the bitmap in the bitmap set by printing a stack includes:

[0043] Get the bitmap alarm log of the application;

[0044] If it is determined according to the bitmap alarm log that there are bitmaps in the bitmap collection whose size exceeds the preset size, the call links of the bitmaps in the bitmap collection are printed by printing the stack.

[0045] Specifically, if the operating system of the terminal device identifies a bitmap whose size exceeds the preset size when rendering the interface, it will automatically generate a bitmap alarm log. However, the bitmap alarm log only records the size of the bitmap that exceeds the preset size, and does not record the identifier of the bitmap. Therefore, if it is determined by reading the bitmap alarm log that there is a bitmap whose size exceeds the preset size in the above-mentioned bitmap collection, you can consider printing the bitmap call link by printing the stack to determine which image in the bitmap collection exceeds the preset size, that is, determine the first image.

[0046] It can be seen that through this embodiment, when it is determined that there is a bitmap with a size exceeding the preset size in the bitmap collection, the call link of the bitmap in the bitmap collection can be printed by printing the bitmap stack. Therefore, the printing stack is selectively started when the first bitmap exists, which can save the system overhead of the terminal device and avoid unnecessary waste of computing resources.

[0047] In a specific embodiment, the terminal device can send a specific message to the server, which indicates that according to the bitmap alarm log, it is determined that there are bitmaps in the bitmap collection whose size exceeds a preset size. Based on the message, the server notifies the application or improves the installation package of the application so that a specific plug-in in the application can print the call link of the bitmap in the bitmap collection by printing the stack.

[0048] In one embodiment, printing the call link of the bitmap in the bitmap set by printing a stack includes:

[0049] For a bitmap in the bitmap set whose size exceeds a preset size, the call link of the bitmap is printed by printing a stack.

[0050] Specifically, when the terminal device prints the call link of the bitmap in the stack, it will determine in turn whether the size of each bitmap in the bitmap set exceeds the preset size. If it exceeds, the call link of the bitmap that exceeds the size will be printed by printing the stack. If it does not exceed, the call link will not be printed.

[0051] It can be seen that through this embodiment, it is only necessary to print the call link of the bitmap in the bitmap set whose size exceeds the preset size, and there is no need to print the call link for all the bitmaps in the bitmap set, which can save the computing resources of the terminal device and avoid unnecessary waste of computing resources.

[0052] In one embodiment, obtaining the identifier of the first bitmap based on the call link includes:

[0053] The identifier of the bitmap recorded in the call link is determined as the identifier of the first bitmap.

[0054] According to the previous content, it is only necessary to print the call link of the bitmap in the bitmap set whose size exceeds the preset size, and it is not necessary to print the call link for all the bitmaps in the bitmap set. Therefore, the identifier of the bitmap recorded in the call link in the stack is the identifier of the bitmap in the bitmap set whose size exceeds the preset size, that is, the identifier of the first bitmap.

[0055] It can be seen that, through this embodiment, the identifier of the bitmap can be extracted from the call link, and the identifier is determined as the identifier of the first bitmap, and the method of determining the identifier is simple and fast.

[0056] Through the above process, the first bitmap can be determined in the bitmap set and its size can be adjusted so that the size of the first bitmap is within or equal to the preset size, thereby increasing the probability of the first bitmap being successfully cached.

[0057] Next, step S106 is executed to convert the second bitmap whose size does not exceed the preset size and the first bitmap after the size adjustment in the bitmap set into texture data respectively and cache them in the first texture cache space. The first texture cache space can be a cache space provided in the operating system. By converting the bitmap into texture data and caching it in the first texture cache space, the GPU can read the texture data to render the interface based on the texture data.

[0058] Next, step S108 is executed to render the interface of the application based on the texture data corresponding to the first bitmap and the texture data corresponding to the second bitmap cached in the first texture cache space. In a specific embodiment, the above steps S102 to S106 can be executed by a specific plug-in in the aforementioned application, and step S108 is executed by the operating system of the terminal device.

[0059] As mentioned above, the operating system has a first texture cache space. Specifically, the first texture cache space is used to cache texture data corresponding to the third bitmap of each application. The various applications also include the application that needs to render the interface mentioned in this embodiment. In the first texture cache space, the texture data corresponding to the cached third bitmap is periodically cleared.

[0060] Specifically, the first texture cache space is used to cache the bitmaps of each application, that is, the texture data corresponding to the third bitmap. The number of third bitmaps can be multiple, so the amount of texture data corresponding to the third bitmap is also large. If the first texture cache space is saturated, it will also cause the cache failure of the uncached texture data, causing problems such as interface rendering jams or unresponsive interfaces. Therefore, in this embodiment, by periodically clearing the texture data corresponding to the cached third bitmap in the first texture cache space, the saturation of the first texture cache space can be avoided to cause the failure of bitmap caching, and the problems such as slow interface rendering or unresponsive interfaces can be avoided.

[0061] In one embodiment, the texture data corresponding to the third bitmap in the first texture cache space is periodically cleared by at least one of the following four methods:

[0062] (1) detecting the size of the occupied space of the first texture cache space at a preset time interval, and clearing texture data corresponding to the third bitmap in the first texture cache space based on the size of the occupied space;

[0063] (2) clearing texture data corresponding to the third bitmap in the first texture cache space according to a historical call record of the third bitmap at a preset time interval;

[0064] (3) after detecting that the interface rendered based on the texture data corresponding to the third bitmap is exited, clearing the texture data corresponding to the third bitmap in the first texture cache space;

[0065] (4) After detecting that the rendering interface based on the texture data corresponding to the third bitmap is completed, clearing the texture data corresponding to the third bitmap in the first texture cache space.

[0066] In method (1), the occupied space size of the first texture cache space can be detected every preset time period, such as 30 seconds. If the proportion of the occupied space size to the total space size of the first texture cache space is greater than or equal to a certain ratio, such as 70%, the texture data corresponding to the third bitmap in the first texture cache space is cleared.

[0067] In method (2), at regular intervals, such as every five minutes, based on the historical call records of the third bitmap, some texture data corresponding to the third bitmap can be cleared from the first texture cache space to release storage space of the first texture cache space.

[0068] In method (3), after detecting that the interface rendered based on the texture data corresponding to the third bitmap is exited, the texture data corresponding to the third bitmap can be cleared in the first texture cache space. The amount of texture data corresponding to the third bitmap cached in the first texture cache space can be large, and multiple interfaces can be rendered based on these texture data. In one embodiment, after detecting that any interface rendered based on the texture data corresponding to the third bitmap is exited by user operation, the texture data corresponding to the third bitmap contained in the exited interface is cleared in the first texture cache space to release the storage space of the first texture cache space.

[0069] In method (4), after detecting that the rendering of the interface based on the texture data corresponding to the third bitmap is completed, the texture data corresponding to the third bitmap is cleared in the first texture cache space. Similar to the above, the amount of texture data corresponding to the third bitmap cached in the first texture cache space can be large, and multiple interfaces can be rendered based on these texture data. In one embodiment, after detecting that any interface rendered based on the texture data corresponding to the third bitmap is rendered, the texture data corresponding to the third bitmap contained in the rendered interface is cleared in the first texture cache space to release the storage space of the first texture cache space.

[0070] It can be seen that through this embodiment, the texture data corresponding to the third bitmap can be periodically cleared in the first texture cache space by any one or more of the above methods, thereby periodically releasing the first texture cache space to avoid storage saturation of the first texture cache space.

[0071] In one embodiment, clearing texture data corresponding to the third bitmap in the first texture cache space according to the historical call record of the third bitmap includes:

[0072] According to the historical call record of the third bitmap, determining a low-frequency bitmap having a historical call frequency lower than a preset frequency in the third bitmap;

[0073] In the first texture cache space, texture data corresponding to the low-frequency bitmap is cleared.

[0074] Specifically, the historical call record of the third bitmap includes the time information of calling the third bitmap during the historical rendering interface. Based on the time information, the calling frequency of each third bitmap within a historical period of time, such as the past day, can be statistically obtained. For example, a third bitmap A is called once every half minute, and another third bitmap B is called once every 3 minutes. Therefore, based on the historical call record, a low-frequency bitmap whose historical calling frequency is lower than the preset frequency can be determined in each third bitmap, and then the texture data corresponding to the low-frequency bitmap can be cleared in the first texture cache space.

[0075] It can be seen that through this embodiment, low-frequency bitmaps whose historical call frequency is lower than the preset frequency can be determined in each third bitmap, and the texture data corresponding to the low-frequency bitmap is cleared in the first texture cache space, thereby clearing the infrequently used bitmaps, and effectively releasing the first texture cache space without affecting the user update interface.

[0076] In one embodiment, in the first texture cache space, clearing texture data corresponding to the low-frequency bitmap includes:

[0077] Get the data identifier of the texture data corresponding to the low-frequency bitmap;

[0078] Based on the data identifier, the texture data corresponding to the low-frequency bitmap is searched in the first texture cache space and cleared.

[0079] Specifically, firstly, a data identifier of texture data corresponding to the low-frequency bitmap is determined, the data identifier of the texture data is not the same as the identifier of the bitmap, then, based on the determined data identifier, the texture data corresponding to the low-frequency bitmap is searched in the first texture cache space and cleared, and the texture data identified by the determined identifier is the texture data corresponding to the low-frequency bitmap.

[0080] It can be seen that through this embodiment, the data identifier of the texture data corresponding to the low-frequency bitmap can be obtained first, and then based on the data identifier, the texture data corresponding to the low-frequency bitmap is searched in the first texture cache space and cleared, thereby achieving the effect of accurately clearing the texture data corresponding to the low-frequency bitmap.

[0081] In one embodiment, obtaining a data identifier of texture data corresponding to a low-frequency bitmap includes:

[0082] Get the pointer address mNativePtr of the low-frequency bitmap;

[0083] Determine, according to the pointer address mNativePtr, a storage address of a data identifier for storing texture data corresponding to the low-frequency bitmap;

[0084] The data identifier of the texture data corresponding to the low-frequency bitmap is obtained from the storage address.

[0085] Specifically, taking the Android operating system as an example, the mNativePtr attribute value of the bitmap of the low-frequency bitmap in the JAVA layer can be obtained. The JAVA layer is a layer of the Android system. The mNativePtr attribute value is used to represent the pointer address of the Parcel object of the native layer. According to the attribute value, the storage address of the data identifier for storing the texture data corresponding to the low-frequency bitmap is determined. The storage address can be the bitmap address in the native layer. The native layer is a layer of the Android system. The Stable ID value stored in the bitmap address is the data identifier of the texture data corresponding to the low-frequency bitmap.

[0086] It can be seen that, through this embodiment, the data identifier of the texture data corresponding to the low-frequency bitmap can be determined efficiently and quickly in the Android system.

[0087] The above introduces Figure 1 The specific process of the method in the embodiment of the present invention further comprises:

[0088] According to the historical call record of the third bitmap, determining in the third bitmap a high-frequency bitmap whose historical call frequency is higher than or equal to a preset frequency;

[0089] Adjust the high-frequency bitmap to the hardware bitmap;

[0090] The texture data corresponding to the hardware bitmap is stored in a second texture cache space set for the hardware bitmap, and the cache duration of the data in the second texture cache space is greater than the cache duration of the data in the first texture cache space.

[0091] Specifically, the historical call record of the third bitmap includes the time information of calling the third bitmap when the historical rendering interface is rendered. Based on the time information, the calling frequency of each third bitmap within a historical period of time, such as the past day, can be statistically obtained. For example, a third bitmap A is called once every half minute, and another third bitmap B is called once every 3 minutes. Therefore, based on the historical call record, high-frequency bitmaps whose historical call frequency is higher than or equal to the preset frequency can be determined in each third bitmap.

[0092] Next, the high-frequency bitmap is adjusted to a hardware bitmap. The hardware bitmap is a special bitmap. In the operating system, there is a cache space specifically used to store texture data corresponding to the hardware bitmap. The texture data corresponding to the hardware bitmap will definitely be cached successfully, and there is no need to determine the size of the hardware bitmap.

[0093] Furthermore, the texture data corresponding to the hardware bitmap is stored in the second texture cache space set for the hardware bitmap. The second texture cache space is a texture cache space specially set for the hardware bitmap. There is no need to determine the size of the hardware bitmap. The texture data corresponding to the hardware bitmap can be cached successfully. In addition, the cache duration of the data in the second texture cache space is longer than the cache duration of the data in the first texture cache space. This is specifically reflected in that the data in the second texture cache space will not be periodically cleared.

[0094] It can be seen that through this embodiment, by modifying the high-frequency bitmap into a hardware bitmap and caching the texture data corresponding to the hardware bitmap in the second texture cache space, the texture data corresponding to the high-frequency bitmap can be cached in the operating system for a long time, thereby facilitating the operating system to render the interface based on the high-frequency bitmap and improving the interface rendering efficiency.

[0095] Taking the Android system as an example, the first texture data cache space mentioned above can be the mCache storage space in the TextureCache object in the Android system, and the second texture data cache space can be the mHardwareTextures storage space in the TextureCache object in the Android system. Among them, the TextureCache object is the texture cache object of the Android system, the mCache storage space is the bitmap texture cache space subordinate to the texture cache object in the Android system, and the mHardwareTextures storage space is the hardware texture cache space subordinate to the texture cache object in the Android system. These two cache spaces are private spaces that come with the Android system. In order to enable specific plug-ins in the application to have the ability to access these two cache spaces, when developing the application, the source code of the Android system and the source code of the application can be compiled together. Specifically, a dynamic library can be generated according to the source code of the Android program, and the dynamic library can be copied to the development environment of the application to develop the application. In this way, the application is indirectly compiled together with the Android system, so that the specific plug-in in the application can obtain a reference to the TextureCache object, and then access the two properties of mHardwareTextures and mCache in the TextureCache object.

[0096] Another point that needs to be noted is that in the Android system, the two attributes mHardwareTextures and mCache in the TextureCache object are accessed by the rendering thread Render Thread. In order to avoid data conflicts caused by multiple subjects accessing the two attributes mHardwareTextures and mCache at the same time, a specific plug-in in the application program can be used to inherit the rendering thread Render Thread subclass and hand over the method in this embodiment as a task to the rendering thread Render Thread for execution. The rendering thread Render Thread is executed serially with existing tasks in the rendering thread to avoid data conflicts.

[0097] In a specific embodiment, a subclass of a rendering task RenderTask can be created, and the method process of this embodiment can be executed in the rendering method run method of the subclass, and finally its instance is submitted to the RenderThread instance of the rendering thread RenderThread, that is, RenderThread->queue(CacheOptiTask). There are currently two ways to obtain the RenderThread instance of the rendering thread Render Thread: 1. It can be found through Caches->RenderState->mRenderThread offset; 2. Obtain the threaded renderer ThreadedRenderer instance through View.getThreadedRenderer(), obtain the address of the native layer proxy object NativeProxy object from it, and then use the offset to obtain the rendering attribute mRenderThread attribute in the proxy object NativeProxy object.

[0098] In summary, through the method in this embodiment, the size of the bitmap that is too large can be adjusted during the process of rendering the interface of the application, so that the bitmap size meets the requirements of the interface rendering, avoiding the failure of the bitmap cache due to the excessive size of the bitmap, avoiding the problems of interface rendering jamming or interface unresponsiveness, improving the interface rendering efficiency of the operating system, and improving the interface update efficiency. In addition, through this embodiment, the texture data corresponding to the third bitmap of each application cached in the first texture cache space can also be periodically cleared, thereby avoiding the failure of the bitmap cache due to the storage saturation of the first texture cache space, avoiding the problems of slow interface rendering or interface unresponsiveness, further improving the interface rendering efficiency of the operating system, and improving the interface update efficiency.

[0099] The present disclosure also provides a data processing device, Figure 2 A structural diagram of a data processing device provided by an embodiment of the present disclosure is shown in FIG. Figure 2 As shown, the device comprises:

[0100] An acquisition unit 21 is used to acquire a bitmap set for rendering an interface of an application program;

[0101] An adjusting unit 22, configured to adjust the size of the first bitmap in the bitmap set whose size exceeds a preset size;

[0102] The conversion unit 23 is used to convert the second bitmap whose size does not exceed the preset size in the bitmap set and the first bitmap after the size adjustment into texture data respectively and cache them in a first texture cache space; wherein the first texture cache space is used to cache the texture data corresponding to the third bitmap of each application; the texture data corresponding to the third bitmap in the first texture cache space is periodically cleared;

[0103] The rendering unit 24 is used to render the interface of the application based on the texture data corresponding to the first bitmap and the texture data corresponding to the second bitmap cached in the first texture cache space.

[0104] Optionally, the device further comprises a cleaning unit, configured to:

[0105] Detecting the size of the occupied space of the first texture cache space at preset time intervals, and clearing the texture data corresponding to the third bitmap in the first texture cache space based on the size of the occupied space;

[0106] At preset time intervals, clearing texture data corresponding to the third bitmap in the first texture cache space according to a historical call record of the third bitmap;

[0107] After detecting that the interface rendered based on the texture data corresponding to the third bitmap is exited, clearing the texture data corresponding to the third bitmap in the first texture cache space;

[0108] After detecting that the rendering interface based on the texture data corresponding to the third bitmap is completed, the texture data corresponding to the third bitmap is cleared in the first texture cache space.

[0109] Optionally, the clearing unit is specifically used for:

[0110] According to the historical call record of the third bitmap, determining a low-frequency bitmap having a historical call frequency lower than a preset frequency in the third bitmap;

[0111] In the first texture cache space, texture data corresponding to the low-frequency bitmap is cleared.

[0112] Optionally, the clearing unit is further specifically used for:

[0113] Obtaining a data identifier of texture data corresponding to the low-frequency bitmap;

[0114] Based on the data identifier, texture data corresponding to the low-frequency bitmap is searched for in the first texture cache space and cleared.

[0115] Optionally, the clearing unit is further specifically used for:

[0116] Get the pointer address mNativePtr of the low-frequency bitmap;

[0117] Determine, according to the pointer address mNativePtr, a storage address of a data identifier for storing texture data corresponding to the low-frequency bitmap;

[0118] A data identifier of texture data corresponding to the low-frequency bitmap is obtained from the storage address.

[0119] Optionally, the device further comprises a determining unit, configured to:

[0120] When the interface of the application is rendered based on the bitmap set in the past, the call link of the bitmaps in the bitmap set is printed by printing a stack;

[0121] The identifier of the first bitmap is obtained based on the call link, and the first bitmap is determined in the bitmap set according to the identifier of the first bitmap.

[0122] Optionally, the determining unit is specifically configured to:

[0123] Obtaining a bitmap alarm log of the application;

[0124] If it is determined according to the bitmap alarm log that there are bitmaps in the bitmap set whose size exceeds the preset size, the call links of the bitmaps in the bitmap set are printed by printing a stack.

[0125] Optionally, the determining unit is specifically configured to:

[0126] For a bitmap in the bitmap set whose size exceeds a preset size, a call link of the bitmap is printed by printing a stack.

[0127] Optionally, the determining unit is further specifically configured to:

[0128] The identifier of the bitmap recorded in the call link is determined as the identifier of the first bitmap.

[0129] Optionally, the device further includes a high-frequency cache unit, configured to:

[0130] According to the historical call records of the third bitmap, determining a high-frequency bitmap having a historical call frequency higher than a preset frequency in the third bitmap;

[0131] Adjusting the high frequency bitmap to a hardware bitmap;

[0132] The texture data corresponding to the hardware bitmap is stored in a second texture cache space set for the hardware bitmap, and the cache duration of the data in the second texture cache space is greater than the cache duration of the data in the first texture cache space.

[0133] The data processing device in the embodiment of the present disclosure can implement each process of the above-mentioned data processing method embodiment and achieve the same effect and function, which will not be repeated here.

[0134] An embodiment of the present disclosure further provides an electronic device, Figure 3 A schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure, such as Figure 3 As shown, the electronic device may have relatively large differences due to different configurations or performances, and may include one or more processors 301 and memory 302, and one or more applications or data may be stored in the memory 302. Among them, the memory 302 may be a temporary storage or a permanent storage. The application stored in the memory 302 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the electronic device. Furthermore, the processor 301 may be configured to communicate with the memory 302 to execute a series of computer executable instructions in the memory 302 on the electronic device. The electronic device may also include one or more power supplies 303, one or more wired or wireless network interfaces 304, one or more input or output interfaces 305, one or more keyboards 306, etc.

[0135] In a specific embodiment, the electronic device includes a processor; and a memory configured to store computer executable instructions, wherein when the computer executable instructions are executed, the processor implements the following process:

[0136] Get the bitmap collection used to render the application's interface;

[0137] For a first bitmap in the bitmap set whose size exceeds a preset size, adjusting the size of the first bitmap;

[0138] Converting the second bitmap in the bitmap set whose size does not exceed the preset size and the first bitmap after the size adjustment into texture data respectively and caching them in a first texture cache space; wherein the first texture cache space is used to cache texture data corresponding to the third bitmap of each application; and the texture data corresponding to the third bitmap in the first texture cache space is periodically cleared;

[0139] The interface of the application is rendered based on the texture data corresponding to the first bitmap and the texture data corresponding to the second bitmap cached in the first texture cache space.

[0140] The electronic device in the embodiment of the present disclosure can implement each process of the above-mentioned data processing method embodiment and achieve the same effect and function, which will not be repeated here.

[0141] Another embodiment of the present disclosure further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store computer-executable instructions, and when the computer-executable instructions are executed by a processor, the following process is implemented:

[0142] Get the bitmap collection used to render the application's interface;

[0143] For a first bitmap in the bitmap set whose size exceeds a preset size, adjusting the size of the first bitmap;

[0144] Converting the second bitmap in the bitmap set whose size does not exceed the preset size and the first bitmap after the size adjustment into texture data respectively and caching them in a first texture cache space; wherein the first texture cache space is used to cache texture data corresponding to the third bitmap of each application; and the texture data corresponding to the third bitmap in the first texture cache space is periodically cleared;

[0145] The interface of the application is rendered based on the texture data corresponding to the first bitmap and the texture data corresponding to the second bitmap cached in the first texture cache space.

[0146] The storage medium in the embodiment of the present disclosure can implement each process of the above-mentioned data processing method embodiment and achieve the same effect and function, which will not be repeated here.

[0147] In various embodiments of the present disclosure, the computer-readable storage medium includes a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0148] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0149] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.

[0150] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0151] For the convenience of description, the above devices are described in terms of functions and are divided into various units. Of course, when implementing the embodiments of the present disclosure, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0152] Those skilled in the art will appreciate that one or more embodiments of the present disclosure may be provided as a method, system or computer program product. Therefore, one or more embodiments of the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, one or more embodiments of the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0153] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0154] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0155] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0156] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0157] One or more embodiments of the present disclosure may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present disclosure may also be practiced in distributed computing environments in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0158] Each embodiment in the present disclosure is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0159] The above description is only an embodiment of the present disclosure and is not intended to limit the present disclosure. For those skilled in the art, the present disclosure may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the scope of the claims of the present disclosure.

Claims

1. A data processing method, characterized in that: include: Get the bitmap collection used to render the application's interface; For a first bitmap in the bitmap set whose size exceeds a preset size, adjusting the size of the first bitmap; Converting the second bitmap in the bitmap set whose size does not exceed the preset size and the first bitmap after the size adjustment into texture data respectively and caching them in a first texture cache space; wherein the first texture cache space is used to cache texture data corresponding to the third bitmap of each application; and the texture data corresponding to the third bitmap in the first texture cache space is periodically cleared; The interface of the application is rendered based on the texture data corresponding to the first bitmap and the texture data corresponding to the second bitmap cached in the first texture cache space.

2. The method according to claim 1, characterized in that: The texture data corresponding to the third bitmap in the first texture cache space is periodically cleared by at least one of the following methods: Detecting the size of the occupied space of the first texture cache space at preset time intervals, and clearing the texture data corresponding to the third bitmap in the first texture cache space based on the size of the occupied space; At preset time intervals, clearing texture data corresponding to the third bitmap in the first texture cache space according to a historical call record of the third bitmap; After detecting that the interface rendered based on the texture data corresponding to the third bitmap is exited, clearing the texture data corresponding to the third bitmap in the first texture cache space; After detecting that the rendering interface based on the texture data corresponding to the third bitmap is completed, the texture data corresponding to the third bitmap is cleared in the first texture cache space.

3. The method according to claim 2, characterized in that The clearing, in the first texture cache space, texture data corresponding to the third bitmap according to the historical call record of the third bitmap includes: According to the historical call record of the third bitmap, determining a low-frequency bitmap having a historical call frequency lower than a preset frequency in the third bitmap; In the first texture cache space, texture data corresponding to the low-frequency bitmap is cleared.

4. The method according to claim 3, characterized in that The clearing, in the first texture cache space, texture data corresponding to the low-frequency bitmap includes: Obtaining a data identifier of texture data corresponding to the low-frequency bitmap; Based on the data identifier, texture data corresponding to the low-frequency bitmap is searched for in the first texture cache space and cleared.

5. The method according to claim 4, characterized in that The step of obtaining a data identifier of texture data corresponding to the low-frequency bitmap includes: Get the pointer address mNativePtr of the low-frequency bitmap; Determine, according to the pointer address mNativePtr, a storage address of a data identifier for storing texture data corresponding to the low-frequency bitmap; A data identifier of texture data corresponding to the low-frequency bitmap is obtained from the storage address.

6. The method according to claim 1, characterized in that The first bitmap is determined in the bitmap set in the following manner: When the interface of the application is rendered based on the bitmap set in the past, the call link of the bitmaps in the bitmap set is printed by printing a stack; The identifier of the first bitmap is obtained based on the call link, and the first bitmap is determined in the bitmap set according to the identifier of the first bitmap.

7. The method according to claim 6, characterized in that The calling link of printing the bitmaps in the bitmap set by printing the stack includes: Obtaining a bitmap alarm log of the application; If it is determined according to the bitmap alarm log that there are bitmaps in the bitmap set whose size exceeds the preset size, the call links of the bitmaps in the bitmap set are printed by printing a stack.

8. The method according to claim 6, characterized in that The calling link of printing the bitmaps in the bitmap set by printing the stack includes: For a bitmap in the bitmap set whose size exceeds a preset size, a call link of the bitmap is printed by printing a stack.

9. The method according to claim 8, characterized in that The obtaining the identifier of the first bitmap based on the call link includes: The identifier of the bitmap recorded in the call link is determined as the identifier of the first bitmap.

10. The method according to claim 1, characterized in that The method further comprises: According to the historical call records of the third bitmap, determining a high-frequency bitmap having a historical call frequency higher than a preset frequency in the third bitmap; Adjusting the high frequency bitmap to a hardware bitmap; The texture data corresponding to the hardware bitmap is stored in a second texture cache space set for the hardware bitmap, and the cache duration of the data in the second texture cache space is greater than the cache duration of the data in the first texture cache space.

11. A data processing device, characterized in that: include: An acquisition unit, used for acquiring a bitmap set used for rendering an interface of an application program; An adjusting unit, configured to adjust the size of a first bitmap in the bitmap set whose size exceeds a preset size; A conversion unit, used for converting the second bitmap in the bitmap set whose size does not exceed the preset size and the first bitmap after the size adjustment into texture data respectively and caching them in a first texture cache space; wherein the first texture cache space is used for caching texture data corresponding to the third bitmap of each application; and the texture data corresponding to the third bitmap in the first texture cache space is periodically cleared; A rendering unit is used to render the interface of the application based on the texture data corresponding to the first bitmap and the texture data corresponding to the second bitmap cached in the first texture cache space.

12. An electronic device, characterized in that: include: processor; as well as, A memory configured to store computer executable instructions, which, when executed, cause the processor to implement the steps of the method according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store computer-executable instructions, and the computer-executable instructions, when executed by a processor, implement the steps of the method described in any one of claims 1 to 10.