Rendering optimization method, smart TV, device, equipment and storage medium
Through the rendering optimization method of copying and restoring image sizes in the running memory of the smart TV, the lag and delay problems caused by insufficient running memory of the smart TV are solved, and the smoothness of the application is improved.
Patent Information
- Application Number
- CN202311865148.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2043-12-29
AI Technical Summary
The running memory of smart TVs is small, which causes applications to occupy too much memory when rendering images, causing lag, delay or crash, affecting the user's viewing experience.
By copying the first image smaller than the target original image size to the smart TV's running memory and restoring its size to the same as the target original image, sending it to the graphics processor for rendering, and deleting the image to free up memory if it is no longer needed .
Reduces the running memory usage when rendering images, improves the smoothness of the application, and reduces the occurrence of lag and delays.
Smart Images

Figure CN117835000B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of rendering technology, and in particular to a rendering optimization method, a smart television, a device, an equipment and a storage medium. Background Art
[0002] With the rapid development of mobile communication technology and Android operating system, more and more smart TVs are adopting Android operating system.
[0003] For smart TVs equipped with the Android operating system, they often need to use the running memory to render the images provided by the application program, so as to realize the operation of the application program. However, in practice, the running memory of smart TVs is usually relatively small, such as 2 gigabytes (GB). The small running memory of smart TVs may cause the application program to freeze, delay or crash during operation on the smart TV, thus affecting the user's viewing experience.
[0004] Therefore, based on the above situation, how to reduce the running memory occupied when rendering images in the application to improve the smoothness of the application operation becomes a technical problem that needs to be solved urgently. Summary of the invention
[0005] In view of this, an embodiment of the present invention provides a rendering optimization method, a smart TV, a device, an equipment and a storage medium, which are used to reduce the running memory occupied when rendering images in an application program, so as to improve the smoothness of the running of the application program.
[0006] In a first aspect, an embodiment of the present invention provides a rendering optimization method, comprising:
[0007] In response to a first use operation triggered by a user on a first interface of the application, copy a first image in a running memory of the smart TV to obtain a copy result, wherein a size of the first image is smaller than a size of a target original image, and the target original image includes an image corresponding to the first interface;
[0008] Restoring the size of the copy result to be the same as the target original image to obtain a second image;
[0009] Sending the second image to a graphics processor of the smart TV so that the graphics processor renders the second image;
[0010] In response to a second usage operation triggered by the user on a second interface of the application, the second image is deleted.
[0011] In a second aspect, an embodiment of the present invention provides a smart TV, including: an operating system and an application program, wherein the application program includes a core subroutine and a rendering optimization subroutine;
[0012] The operating system is used to provide an operating environment for the application program;
[0013] The core subroutine is used to control the operation of the application program;
[0014] The rendering optimization subroutine is used to copy a first image in the running memory of the smart TV in response to a first usage operation triggered by a user on the first interface of the application to obtain a copy result, wherein the size of the first image is smaller than the size of a target original image, and the target original image includes an image corresponding to the first interface; restore the size of the copy result to be the same as the target original image to obtain a second image; send the second image to the graphics processor of the smart TV so that the graphics processor renders the second image; and delete the second image in response to a second usage operation triggered by the user on the second interface of the application.
[0015] In a third aspect, an embodiment of the present invention provides a rendering optimization device, including:
[0016] a copy module, configured to copy a first image in a running memory of the smart TV in response to a first use operation triggered by a user on a first interface of an application program in the smart TV, so as to obtain a copy result, wherein a size of the first image is smaller than a size of a target original image, and the target original image includes an image corresponding to the first interface;
[0017] A restoration module, used for restoring the size of the copy result to be the same as the target original image to obtain a second image;
[0018] A sending module, configured to send the second image to a graphics processor of the smart TV, so that the graphics processor renders the second image;
[0019] The deleting module is used to delete the second image in response to a second use operation triggered by the user on the second interface of the application.
[0020] In a fourth aspect, an embodiment of the present invention provides an electronic device, comprising a processor and a memory, wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the rendering optimization method in the first aspect. The electronic device may also include a communication interface for communicating with other devices or communication systems.
[0021] In a fifth aspect, an embodiment of the present invention provides a non-temporary machine-readable storage medium having executable code stored thereon. When the executable code is executed by a processor of an electronic device, the processor can at least implement the rendering optimization method as described in the first aspect above.
[0022] In the rendering optimization method provided by an embodiment of the present invention, when a user triggers a first use operation on a first interface of an application, the application in the smart TV can copy a first image stored in the running memory of the smart TV in response to the first use operation to obtain a copy result. The size of the first image is smaller than the size of the target original image, and the target original image includes an image corresponding to the first interface. Then, the application can restore the size of the copy result to the same as the target original image to obtain a second image. Then, the application can send the second image to the graphics processor of the smart TV so that the graphics processor renders the second image. When the user triggers a second use operation on the second interface of the application, the application can also delete the second image in response to the second use operation.
[0023] If the above method is not used, before rendering the image in the first interface, the running memory of the smart TV may store a large-size target original image corresponding to the first interface. During the rendering process, the application copies the target original image and renders the copy of the target original image, and finally, the smart TV can display the first interface. That is, when the smart TV displays the first interface, two large-size target original images are stored in the running memory of the smart TV.
[0024] When the above method is used, before the image in the first interface is rendered, the running memory of the smart TV may store a small-sized first image corresponding to the first interface. During the rendering process, the smart TV copies the first image to obtain a large-sized second image and renders the image. Finally, the smart TV can display the first interface. That is, when the smart TV displays the first interface, the running memory of the smart TV stores the small-sized first image and the large-sized second image. The larger the size of the image, the more running memory of the smart TV is occupied.
[0025] It can be seen that compared with the solution of copying a large-size target original image, the above method occupies a smaller operating memory of the smart TV during the rendering process, thereby improving the smoothness of the application running. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0027] Figure 1 A flowchart of a rendering optimization method provided by an embodiment of the present invention;
[0028] Figure 2 A flowchart of another rendering optimization method provided by an embodiment of the present invention;
[0029] Figure 3 A flowchart of another rendering optimization method provided by an embodiment of the present invention;
[0030] Figure 4 A flowchart of another rendering optimization method provided by an embodiment of the present invention;
[0031] Figure 5 A schematic diagram of a workflow of a smart TV provided by an embodiment of the present invention;
[0032] Figure 6 A schematic diagram of a workflow of a rendering optimization subroutine provided in an embodiment of the present invention;
[0033] Figure 7 A schematic diagram of the structure of a smart TV provided by an embodiment of the present invention;
[0034] Figure 8 A schematic diagram of the structure of a rendering optimization device provided by an embodiment of the present invention;
[0035] Fig. 9 For Figure 8 A schematic diagram of the structure of an electronic device corresponding to the rendering optimization device provided in the illustrated embodiment. DETAILED DESCRIPTION
[0036] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0037] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings, and "multiple" generally includes at least two, but does not exclude the inclusion of at least one.
[0038] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0039] As used herein, the words "if" and "if" may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to identifying", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is identified" may be interpreted as "when determining" or "in response to determining" or "when identifying (stated condition or event)" or "in response to identifying (stated condition or event)", depending on the context.
[0040] It should be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a product or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such product or system. 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 product or system including the elements.
[0041] It should also be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the present invention are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0042] Before describing in detail the rendering optimization method provided by each embodiment of the present invention, an application scenario of the rendering optimization may also be schematically described:
[0043] As described in the background technology, a smart TV equipped with an Android operating system often needs to use a running memory to render images provided by an application program, thereby realizing the operation of the application program. The running memory can be understood as a memory area in the smart TV for storing images in the application program.
[0044] In practice, in order to improve the rendering efficiency of images in an application, the application can also set a buffer in the running memory, and the images in the application can be copied to the buffer. The buffer can be understood as a memory area allocated by the running memory for temporarily storing images in the application.
[0045] Afterwards, the application can send the image in the buffer to the graphics processing unit (GPU) of the smart TV so that the GPU can render the image.
[0046] Optionally, the application may be a software program installed in the smart TV for performing a specific task, which may include a game application or a video application, etc.
[0047] Taking the scenario of user interaction with a game application in a smart TV as an example, the game application may include a game login interface. The rendering process of the game login interface is as follows: the game application may respond to the user's use operation triggered by the game login interface, and first copy the image corresponding to the game login interface that has been stored in the running memory to the buffer set in the running memory. Then, the game application sends the copy result in the buffer to the GPU of the smart TV, so that the GPU renders the copy result. And in the process of the GPU rendering the game login interface, the image in the game login interface is still stored in the running memory.
[0048] However, in practice, the memory of a smart TV is usually relatively small, such as 2 gigabytes (GB), and during the rendering process, the size of the image corresponding to the game login interface of the running memory and the copy result of the image can be, for example, 1.8GB. At this time, the occupancy rate of the running memory of the smart TV is too high, which may cause the smart TV to freeze, delay or crash during the rendering of the image in the game login interface, thereby affecting the user's gaming experience. In order to improve the above problem, the rendering optimization method provided by the following embodiments of the present invention can be used.
[0049] Based on the above description, some embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the case where there is no conflict between the embodiments, the following embodiments and the features in the embodiments can be combined with each other. In addition, the step sequence in the following method embodiments is only an example and not a strict limitation.
[0050] Figure 1 The flowchart of a rendering optimization method provided by an embodiment of the present invention is shown in FIG. The rendering optimization method provided by an embodiment of the present invention can be executed by any application in a smart TV. More specifically, the method can be executed by a rendering optimization subroutine in an application. Figure 1 As shown, the method may include the following steps:
[0051] S101, in response to a first usage operation triggered by a user on a first interface of an application, copy a first image in a running memory of a smart TV to obtain a copy result, wherein a size of the first image is smaller than a size of a target original image, and the target original image includes an image corresponding to the first interface.
[0052] Optionally, any application installed in the smart TV may include multiple interfaces, and different interfaces correspond to different display contents. The display contents may be presented as images, that is, different interfaces may correspond to different original images.
[0053] Optionally, when the user triggers a first use operation on the first interface of the application, the application in the smart TV can copy the first image in the running memory of the smart TV in response to the first use operation, and the copy result can be stored in the buffer of the running memory. At this time, the running memory of the smart TV can store the first image and the copy result corresponding to the first image, that is, two copies of the first image. Among them, the target original image is the image corresponding to the first interface in the original image, and the first image is the result of reducing the size of the target original image. The specific generation process of the first image can refer to the relevant description in the following embodiment.
[0054] S102, restoring the size of the copy result to be the same as the target original image to obtain a second image.
[0055] Then, the application may enlarge the size of the copy result in the buffer to restore the size of the copy result to be the same as the target original image to obtain a second image.
[0056] S103, sending the second image to a graphics processor of the smart TV so that the graphics processor renders the second image.
[0057] Afterwards, the application can send the second image to the GPU of the smart TV so that the GPU of the smart TV can render the second image, and the rendering result can be displayed on the smart TV. Since the size of the second image is the same as the size of the target original image, the display effect of the second image in the first interface of the application can be the same as the display effect of the target original image in the first interface of the application.
[0058] S104: In response to a second use operation triggered by the user on a second interface of the application, delete the second image.
[0059] After the first interface of the application is rendered, the user can also trigger a second use operation on the second interface of the application, that is, switch the display interface of the application in the smart TV. At this time, considering that the running memory of the smart TV is small, in order to reduce the occupancy rate of the running memory and improve the rendering efficiency of the second interface, the application can also delete the second image corresponding to the first interface stored in the running memory, that is, release part of the running memory of the smart TV.
[0060] In an embodiment of the present invention, when a user triggers a first use operation on a first interface of an application, the application in the smart TV can copy a first image stored in a running memory of the smart TV in response to the first use operation to obtain a copy result. The size of the first image is smaller than the size of the target original image, and the target original image includes an image corresponding to the first interface. Then, the application can restore the size of the copy result to the same as the target original image to obtain a second image. Then, the application can send the second image to a graphics processor of the smart TV so that the graphics processor renders the second image. When the user triggers a second use operation on a second interface of the application, the application can also delete the second image in response to the second use operation.
[0061] If the above method is not used, before rendering the image in the first interface, the running memory of the smart TV may store a large-size target original image corresponding to the first interface. During the rendering process, the application copies the target original image and renders the copy of the target original image, and finally, the smart TV can display the first interface. That is, when the smart TV displays the first interface, two large-size target original images are stored in the running memory of the smart TV.
[0062] When the above method is used, before the image in the first interface is rendered, the running memory of the smart TV may store a small-sized first image corresponding to the first interface. During the rendering process, the smart TV copies the first image to obtain a large-sized second image and renders the image. Finally, the smart TV can display the first interface. That is, when the smart TV displays the first interface, the running memory of the smart TV stores the small-sized first image and the large-sized second image. The larger the size of the image, the more running memory of the smart TV is occupied.
[0063] It can be seen that compared with the solution of copying a large-size target original image, the above method occupies a smaller operating memory of the smart TV during the rendering process, thereby improving the smoothness of the application running.
[0064] The technical effects that can be achieved by the rendering optimization methods provided in the above and below embodiments of the present invention can also be understood in combination with the following contents:
[0065] 1. In a common method, before rendering the image in the first interface, the running memory of the smart TV stores a large-size target original image corresponding to the first interface. For example, the running memory occupied by the target original image may be 100M. During the rendering process, the application can copy the target original image and render the copy of the target original image. Since the running memory occupied by the copy result is also 100M, in this method, two copies of the target original image occupying 100M of running memory can be stored in the running memory of the smart TV, that is, a total of 200M of the running memory of the smart TV is occupied.
[0066] When using the rendering optimization method provided by each embodiment of the invention, before rendering the image in the first interface, a small-sized first image corresponding to the first interface is stored in the running memory of the smart TV. For example, the running memory occupied by the first image may be 50M. During the rendering process, the application copies the first image and restores the size of the copy result to the same as the target original image to obtain a large-sized second image. That is, the running memory occupied by the large-sized second image is 100M. At this time, the running memory of the smart TV stores a small-sized first image occupying 50M of running memory and a large-sized second image occupying 100M of running memory, that is, a total of 150M of the running memory of the smart TV is occupied.
[0067] It can be seen that compared with the solution of directly copying the target original image which occupies 100M of running memory, this solution can reduce 50M of running memory, thereby improving the smoothness of application operation.
[0068] 2. In practice, considering that the running memory of smart TVs is usually small and different models of smart TVs may correspond to different running memories, in order to ensure the smooth running of applications in various models of smart TVs, programmers usually re-develop multiple sets of applications suitable for running on various models of smart TVs, which will obviously increase R&D costs.
[0069] By setting a rendering optimization subroutine with the above-mentioned running memory optimization logic in the application, the execution of the rendering optimization subroutine can reduce the occupancy rate of the smart TV running memory when rendering images, thereby ensuring the smoothness of the application running in various models of smart TVs without the need to re-develop the application, thereby reducing the research and development costs.
[0070] Optionally, the first use operation triggered by the user on the first interface may include the user's first use operation on the first interface, and may also include the user's non-first use operation on the first interface. When the first use operation is the user's first use operation on the first interface, the image rendering process in the first interface can refer to the following Figure 2 The description in the illustrated embodiment. Figure 2 A flowchart of another rendering optimization method provided by an embodiment of the present invention. Figure 2 As shown, the method may include the following steps:
[0071] S201: If the first use operation is the first use operation of the user on the first interface, read the target original image in the running memory of the smart TV.
[0072] S202: Reduce the size of the target original image to obtain a first image in the running memory of the smart TV.
[0073] The user's first use operation of the first interface may indicate that the user interacts with the first interface for the first time. During the first interaction, the application may obtain the target original image corresponding to the first interface stored in the running memory, and at this time, the first image has not yet been generated in the running memory of the smart TV.
[0074] At this time, for the generation of the first image, optionally, the application can read the target original image corresponding to the first interface into the running memory of the smart TV in response to the user's first use operation of the first interface, and then obtain the target original image from the running memory of the smart TV. Afterwards, the application can reduce the size of the target original image to obtain the first image. At this time, the first image can be stored in the running memory of the smart TV instead of the target original image. It can be seen that the first image in this embodiment is generated in real time in response to the user's use operation.
[0075] For the reduction of the target original image, optionally, the application may first determine the reduction ratio of the target original image according to the size of the remaining operating memory of the smart TV. Then, the application may reduce the size of the target original image according to the reduction ratio. The reduction ratio may be negatively correlated with the remaining operating memory, that is, the smaller the remaining operating memory, the larger the reduction ratio corresponding to the target original image.
[0076] For example, assuming that the remaining running memory of the smart TV is 200M and the running memory occupied by the target original image is 100M, the application can determine that the reduction ratio of the target original image is 50%, that is, the size of the target original image is reduced to half of the original size to obtain a first image occupying 50M of running memory.
[0077] For reducing the target original image, the application may optionally determine the type of each image in the target original image. Then, according to the type of each image in the target original image, the same type of images in the target original image are reduced in sequence, that is, the image size reduction is performed according to the image type. Optionally, the image type may include Portable Network Graphics (PNG), Joint Photographic Experts Group (JPEG), Graphics Interchange Format (GIF), etc.
[0078] Optionally, in practice, the above two image reduction methods can be used either or simultaneously.
[0079] S203, in response to a first usage operation triggered by a user on a first interface of an application, copy a first image in a running memory of the smart TV to obtain a copy result, wherein a size of the first image is smaller than a size of a target original image, and the target original image includes an image corresponding to the first interface.
[0080] S204: restore the size of the copy result to be the same as the target original image to obtain a second image.
[0081] S205: Send the second image to a graphics processor of the smart TV so that the graphics processor renders the second image.
[0082] S206: In response to a second use operation triggered by the user on a second interface of the application, delete the second image.
[0083] The specific implementation process of the above steps S203 to S206 can be found in Figure 1 The detailed description of the relevant steps in the illustrated embodiment will not be repeated here.
[0084] In this embodiment, when the first use operation is the first use operation of the user on the first interface, the application can respond to the first use operation by reducing the size of the target original image in the running memory of the smart TV and using the small-sized first image to render the interface. Furthermore, the application can also reduce the size according to the image type. The application can also determine the size reduction ratio according to the remaining running memory of the smart TV, so that the size reduction ratio is more suitable for the current running memory occupancy of the smart TV.
[0085] In addition, the contents not described in detail in this embodiment and the technical effects that can be achieved can all be found in the relevant descriptions in the above embodiments, and will not be repeated here.
[0086] Optionally, when the first use operation is not the first use operation of the user on the first interface, the image rendering process in the first interface can refer to the following Figure 3 The description in the illustrated embodiment. Figure 3 A flowchart of another rendering optimization method provided by an embodiment of the present invention. Figure 3 As shown, the method may include the following steps:
[0087] S301, if the first use operation is not the first use operation of the user on the first interface, then determine the first image from the alternative images stored in the running memory of the smart TV, the alternative images include images obtained by reducing the size of the original images corresponding to different interfaces in the application, and the user triggers the first use operation of different interfaces before the first use operation.
[0088] In practice, the user may interact with multiple interfaces of the application in the smart TV, and the multiple interfaces may include the first interface in this embodiment. After the user completes the interaction with the multiple interfaces, the user may need to initiate interaction with the first interface again.
[0089] For example, following the example of the scenario in which the user interacts with the game application, the user can trigger the use operation of the first interface to enter the game login interface. Then, the user can also trigger other interfaces in the game application, such as entering the game use interface or the game exit interface. In actual use, the user can also switch game accounts. At this time, the user can trigger a non-first use operation on the game login interface to make the smart TV display the previous game login interface again.
[0090] Before the user performs a non-first-time use operation on the first interface, the user has triggered first-time use operations on different interfaces including the first interface in the application. After these different interfaces are used for the first time, the application can reduce the size of the original images corresponding to the different interfaces, and the images obtained after the reduction can be stored in the running memory of the smart TV as alternative images. Figure 2 The situation in which the first interface is used for the first time in the illustrated embodiment is the same and will not be described in detail here.
[0091] Therefore, when the user is not using the first interface for the first time, the application program can directly obtain the first image from the candidate images stored in the running memory of the smart TV in response to the non-first use operation.
[0092] It can be seen that the first image in this embodiment is directly selected from the existing candidate images in response to the user's operation.
[0093] S302, in response to a first usage operation triggered by a user on a first interface of an application, copy a first image in a running memory of the smart TV to obtain a copy result, wherein a size of the first image is smaller than a size of a target original image, and the target original image includes an image corresponding to the first interface.
[0094] S303: restore the size of the copy result to be the same as the target original image to obtain a second image.
[0095] S304: Send the second image to a graphics processor of the smart TV so that the graphics processor renders the second image.
[0096] S305 , in response to a second use operation triggered by the user on a second interface of the application, deleting the second image.
[0097] The specific implementation process of the above steps S302 to S305 can be found in Figure 1 The detailed description of the relevant steps in the illustrated embodiment will not be repeated here.
[0098] In this embodiment, when the first usage operation is not the first usage operation of the user on the first interface, the application can directly obtain the first image from the alternative images stored in the running memory of the smart TV without the need to perform the image size reduction process, thereby enabling the application to quickly obtain the first image.
[0099] Figure 1 In the illustrated embodiment, it has been mentioned that the application can send the second image obtained after the size reduction to the GPU of the smart TV so that the GPU can render the second image. Optionally, in order to further reduce the occupancy rate of the running memory when rendering the image, before sending the second image, the application can also optionally adjust the color value of each pixel in the second image to obtain a third image that occupies less running memory.
[0100] For the determination of the third image, please refer to the following Figure 4 The description in the illustrated embodiment. Figure 4 A flowchart of another rendering optimization method provided by an embodiment of the present invention. Figure 4 As shown, the method may include the following steps:
[0101] S401, in response to a first usage operation triggered by a user on a first interface of an application, copy a first image in a running memory of a smart TV to obtain a copy result, wherein a size of the first image is smaller than a size of a target original image, and the target original image includes an image corresponding to the first interface.
[0102] S402: restore the size of the copy result to be the same as the target original image to obtain a second image.
[0103] The specific implementation process of the above steps S401 to S402 can be found in Figure 1 The detailed description of the relevant steps in the illustrated embodiment will not be repeated here.
[0104] S403: Adjust the color value of each pixel in the second image to obtain a third image.
[0105] In an optional adjustment manner, the application may adjust the color value of each pixel in the second image according to the size of the remaining running memory of the smart TV to obtain the third image.
[0106] Specifically, the application program may compare the size of the remaining running memory with a preset threshold, and determine the adjustment direction of the color value size of each pixel in the second image according to the comparison result.
[0107] If the remaining running memory is higher than the preset threshold, it indicates that the remaining running memory of the smart TV is large, and the application can increase the color value of each pixel in the second image. Increasing the color value of each pixel in the second image may increase the running memory occupied by the second image.
[0108] If the size of the remaining running memory is less than the preset threshold, it indicates that the remaining running memory of the smart TV is small and the running storage space of the smart TV is insufficient. The application can reduce the color value of each pixel in the second image to reduce the running memory occupied by the second image.
[0109] In another optional adjustment mode, the application can adjust the color value of each pixel in the second image according to the preset display requirements of the first interface to obtain the third image. The preset display requirements may include the preset color value of each pixel in the third image displayed in the first interface.
[0110] In practice, in order to further improve the smoothness of running the application in the smart TV, optionally, the preset color value of each pixel in the third image may be smaller than the color value of each pixel in the second image.
[0111] S404: Send the third image to a graphics processor of the smart TV so that the graphics processor renders the third image.
[0112] S405 , in response to a second use operation triggered by the user on a second interface of the application, deleting the third image.
[0113] Afterwards, the application can send the third image to the GPU of the smart TV so that the GPU renders the third image. When the application responds to the second use operation triggered by the second interface of the application, the third image rendered in the running memory of the smart TV can also be deleted to free up more memory.
[0114] In this embodiment, after restoring the size of the first image to obtain the second image, the pixel color values of the second image can be adjusted according to the size of the remaining running memory of the smart TV or the preset display requirements to reduce the running memory occupied by the third image to be rendered, thereby improving the running smoothness of the application.
[0115] Based on the descriptions in the above embodiments, it can be seen that the rendering optimization method, that is, the running memory optimization logic, is executed during the running of the application program in the smart TV.
[0116] After the smart TV is turned on, the application can be installed first. Then the running memory optimization logic in the application, that is, the rendering optimization subroutine, is run, and finally the first interface of the application is displayed on the smart TV. The working process of the smart TV can also be combined with Figure 5 understand.
[0117] The specific process is: after the application is started, the target original image corresponding to the first interface in the application is first obtained, and then, after the user generates an operation to use the first interface, the rendering optimization subroutine in the application and the GPU of the smart TV are used to render the image in the first interface. Among them, the working process of the rendering optimization subroutine is: the application can copy the first image in the running memory of the smart TV in response to the first operation triggered by the user on the first interface of the application to obtain a copy result. Among them, the size of the first image is smaller than the size of the target original image, and the target original image includes an image corresponding to the first interface. Then, the application can enlarge the size of the copy result to restore the size of the copy result to the same as the target original image to obtain a second image. Then, the application can adjust the color value of each pixel in the second image to obtain a third image.
[0118] The application may delete the third image after rendering of the third image is completed.
[0119] The working process of the above rendering optimization subroutine can also be combined with Figure 6 understand.
[0120] Figure 7 A schematic diagram of the structure of a smart TV provided by an embodiment of the present invention is shown in FIG. Figure 7 As shown, the smart TV includes: an operating system and an application program, and the application program may include a core subroutine and a rendering optimization subroutine.
[0121] The operating system may specifically be an Android operating system, which may provide an operating environment for the application program. The core subroutine in the application program may control the operation of the application program.
[0122] The execution process of the rendering optimization subroutine is as follows: when the user triggers the first use operation on the first interface of the application, the rendering optimization subroutine can copy the first image in the running memory of the smart TV in response to the first use operation, and the copy result can be stored in the buffer of the running memory. At this time, the running memory of the smart TV can store the first image and the copy result corresponding to the first image, that is, two copies of the first image. Among them, the target original image is the image corresponding to the first interface in the original image, and the first image is the result of reducing the size of the target original image. The specific generation process of the first image can refer to the relevant description in the above embodiments.
[0123] Then, the rendering optimization subroutine can restore the size of the copy result in the buffer to the same as the target original image to obtain a second image. After that, the rendering optimization subroutine can send the second image to the GPU of the smart TV so that the GPU of the smart TV can render the second image, and the rendering result can be displayed on the smart TV. Since the size of the second image is the same as the size of the target original image, the display effect of the second image in the first interface of the application can be the same as the display effect of the target original image in the first interface of the application.
[0124] After the first interface of the application is rendered, the user can also trigger a second use operation on the second interface of the application, that is, switch the display interface of the application in the smart TV. At this time, considering that the running memory of the smart TV is small, in order to reduce the occupancy rate of the running memory and improve the rendering efficiency of the second interface, the rendering optimization subroutine can also delete the second image corresponding to the first interface stored in the running memory, that is, release part of the running memory of the smart TV.
[0125] In this embodiment, the smart TV includes: an operating system and an application program, and the application program may include a core subroutine and a rendering optimization subroutine. The operating system may provide an operating environment for the application program, and the core subroutine may control the operation of the application program.
[0126] The rendering optimization subroutine can copy the first image stored in the running memory of the smart TV in response to the first use operation triggered by the user on the first interface to obtain a copy result. The size of the first image is smaller than the size of the target original image, and the target original image includes an image corresponding to the first interface. Then, the rendering optimization subroutine can restore the size of this copy result to the same as the target original image to obtain a second image. Then, the rendering optimization subroutine can send the second image to the graphics processor of the smart TV so that the graphics processor renders the second image. When the user triggers a second use operation on the second interface of the application, the rendering optimization subroutine can also delete the second image in response to the second use operation.
[0127] If the above rendering optimization subroutine is not used, before the image in the first interface is rendered, the running memory of the smart TV may store a large-sized target original image corresponding to the first interface. During the rendering process, the smart TV copies the target original image and renders the copy of the target original image. Finally, the smart TV can display the first interface. That is, when the smart TV displays the first interface, two large-sized target original images are stored in the running memory of the smart TV.
[0128] When the above rendering optimization subroutine is used, before the image in the first interface is rendered, the running memory of the smart TV may store a small-sized first image corresponding to the first interface. During the rendering process, the smart TV copies the first image to obtain a large-sized second image and renders the image. Finally, the smart TV can display the first interface. That is, when the smart TV displays the first interface, the running memory of the smart TV stores a small-sized first image and a large-sized second image. The larger the size of the image, the more running memory of the smart TV is occupied.
[0129] It can be seen that compared with the solution of copying a large-size target original image, the above method occupies a smaller operating memory of the smart TV during the rendering process, thereby improving the smoothness of the application running.
[0130] In addition, the contents not described in detail in this embodiment and the technical effects that can be achieved can all be found in the relevant descriptions in the above embodiments, and will not be repeated here.
[0131] For ease of understanding, the specific implementation process of the rendering optimization method provided in the above embodiments can be exemplified in combination with the interaction scenario between the user and the game application in the smart TV, as follows:
[0132] Assume that a game application installed in a smart TV includes three interfaces, a game login interface, a game use interface, and a game exit interface, and different interfaces correspond to different display contents, namely, original images.
[0133] When the user triggers the first-use operation on the game login interface in the game application, the game application can, in response to the first-use operation, reduce the size of the original image corresponding to the game login interface in the running memory of the smart TV to obtain a small-sized first image. Optionally, when reducing the size of the original image, the application can reduce the size according to the image type. Optionally, the application can also determine the reduction ratio according to the remaining running memory of the smart TV, and reduce the original image corresponding to the game login interface according to the reduction ratio.
[0134] Then, the application program may copy the first image in the running memory of the smart TV to obtain a copy result, and restore the size of the copy result to be the same as the original image to obtain a second image.
[0135] Afterwards, the game application can send the third image to the GPU of the smart TV, so that the GPU can render the second image, and the rendering result can be displayed on the smart TV. At this time, the first image obtained above will be stored in the running memory of the smart TV.
[0136] Optionally, in order to further improve the rendering speed and reduce the occupancy rate of the running memory, the game application can also adjust the pixel color values of the second image according to the size of the remaining running memory of the smart TV or the preset display requirements to obtain a third image that occupies less running memory, and the GPU finally renders this image.
[0137] After the smart TV displays the game login interface, the user can also trigger an operation on the game usage interface of the game application, that is, switch the game login switching interface to the game usage interface. At this time, the application can delete the image used by the GPU to render the game login interface (the second image or the third image mentioned above) to free up more running memory.
[0138] In actual use, the user can also switch game accounts. At this time, the user can trigger a non-first use operation on the game login interface to make the smart TV display the previous game login interface again.
[0139] In this case, since the user has already used the game login interface, the game use interface and the game exit interface before performing a non-first use operation on the game login interface, that is, the smart TV has displayed these three interfaces, the running memory of the smart TV stores the reduced size results of the original images corresponding to each interface, which are the alternative images mentioned in the above embodiments.
[0140] The rendering process of the game login interface is as follows: the game application can determine the first image from the alternative images stored in the running memory of the smart TV in response to the non-first use operation, and render the image again in the above manner, so that the smart TV displays the game login interface again.
[0141] In addition, the contents not described in detail in this embodiment and the technical effects that can be achieved can all be found in the relevant descriptions in the above embodiments, and will not be repeated here.
[0142] The following will describe in detail the rendering optimization device of one or more embodiments of the present invention. Those skilled in the art will appreciate that these rendering optimization devices can be configured using commercially available hardware components through the steps taught in this solution.
[0143] Figure 8 A schematic diagram of the structure of a rendering optimization device provided by an embodiment of the present invention is shown in FIG. Figure 8 As shown, the device comprises:
[0144] The copy module 11 is used to copy a first image in the running memory of the smart TV in response to a first usage operation triggered by a user on a first interface of an application in the smart TV to obtain a copy result, wherein the size of the first image is smaller than the size of a target original image, and the target original image includes an image corresponding to the first interface.
[0145] The restoration module 12 is used to restore the size of the copy result to be the same as the target original image to obtain a second image.
[0146] The sending module 13 is used to send the second image to the graphics processor of the smart TV so that the graphics processor renders the second image.
[0147] The deleting module 14 is configured to delete the second image in response to a second use operation triggered by the user on the second interface of the application.
[0148] Optionally, the device further includes: a reading module 15, configured to read the target original image in the running memory of the smart TV if the first use operation is the first use operation of the user on the first interface.
[0149] The reduction module 16 is used to reduce the size of the target original image to obtain the first image in the running memory of the smart TV.
[0150] Optionally, the device also includes: a determination module 17, which is used to determine the first image from the alternative images stored in the running memory of the smart TV if the first usage operation is not the first usage operation of the user on the first interface, the alternative images including images obtained by reducing the size of original images corresponding to different interfaces in the application, and the user triggers the first usage operation of the different interfaces before the first usage operation.
[0151] Optionally, the reduction module 16 is used to determine the reduction ratio of the target original image according to the size of the remaining running memory of the smart TV, and the reduction ratio is negatively correlated with the remaining running memory; and reduce the size of the target original image according to the reduction ratio.
[0152] Optionally, the reduction module 16 is further configured to determine the type of each image in the target original image; and sequentially reduce the size of images of the same type in the target original image.
[0153] Optionally, the sending module 13 is used to adjust the color value of each pixel in the second image according to the size of the remaining running memory of the smart TV to obtain a third image; and send the third image to the graphics processor of the smart TV so that the graphics processor renders the third image.
[0154] The deleting module 14 is further configured to delete the third image.
[0155] Optionally, the sending module 13 is specifically used to increase the color value of each pixel in the second image if the size of the remaining running memory is higher than a preset threshold; if the size of the remaining running memory is lower than a preset threshold, then reduce the color value of each pixel in the second image.
[0156] Optionally, the sending module 13 is also used to adjust the color value of each pixel in the second image according to the preset display requirements corresponding to the first interface to obtain a third image, and the preset display requirements include the preset color value of each pixel in the third image displayed in the first interface; send the third image to the graphics processor of the smart TV so that the third image is rendered by the graphics processor.
[0157] The deleting module 14 is used to delete the third image.
[0158] Figure 8 The device shown can perform Figures 1 to 6 For the method of the embodiment shown in the figure, the part not described in detail in this embodiment can be referred to Figures 1 to 6 The implementation process and technical effects of this technical solution refer to Figures 1 to 6 The description in the illustrated embodiment will not be repeated here.
[0159] In a possible design, the rendering optimization method provided in the above embodiments may be applied in an electronic device, such as Fig. 9 As shown, the electronic device may include: a processor 21 and a memory 22. The memory 22 is used to store the electronic device to perform the above Figure 1 to Figure 6 The program of the rendering optimization method provided in the illustrated embodiment, the processor 21 is configured to execute the program stored in the memory 22 .
[0160] The program includes one or more computer instructions, wherein when the one or more computer instructions are executed by the first processor 21, the following steps can be implemented:
[0161] In response to a first use operation triggered by a user on a first interface of the application, copy a first image in a running memory of the smart TV to obtain a copy result, wherein a size of the first image is smaller than a size of a target original image, and the target original image includes an image corresponding to the first interface;
[0162] Restoring the size of the copy result to be the same as the target original image to obtain a second image;
[0163] Sending the second image to a graphics processor of the smart TV so that the graphics processor renders the second image;
[0164] In response to a second usage operation triggered by the user on a second interface of the application, the second image is deleted.
[0165] Optionally, the processor 21 is further configured to execute the aforementioned Figure 1 to Figure 6 All or part of the steps in the illustrated embodiments.
[0166] The structure of the electronic device may further include a communication interface 23 for the electronic device to communicate with other devices or communication systems.
[0167] In addition, an embodiment of the present invention provides a computer storage medium for storing computer software instructions used by the above electronic device, which includes instructions for executing the above Figure 1 to Figure 6 The procedures involved in the rendering optimization method shown.
[0168] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A rendering optimization method, characterized in that: Applications for smart TVs include: In response to a first use operation triggered by a user on a first interface of the application, copy a first image in a running memory of the smart TV to obtain a copy result, wherein a size of the first image is smaller than a size of a target original image, and the target original image includes an image corresponding to the first interface; Restoring the size of the copy result to be the same as the target original image to obtain a second image; Sending the second image to a graphics processor of the smart TV so that the graphics processor renders the second image; In response to a second use operation triggered by the user on a second interface of the application, deleting the second image; The method of acquiring the first image includes: If the first use operation is the first use operation of the user on the first interface, determining a reduction ratio of the target original image in the running memory of the smart TV according to the size of the remaining running memory of the smart TV, and reducing the size of the target original image according to the reduction ratio to obtain the first image, wherein the reduction ratio is negatively correlated with the remaining running memory; If the first usage operation is not the first usage operation of the first interface by the user, the first image is determined from the alternative images stored in the running memory of the smart TV, the alternative images including images obtained by reducing the size of original images corresponding to different interfaces in the application, and the user triggers the first usage operation of the different interfaces before the first usage operation.
2. The method according to claim 1, characterized in that: The reducing the size of the target original image comprises: Determine the type of each image in the target original image; The sizes of images of the same type in the target original image are reduced sequentially.
3. The method according to claim 1, characterized in that The sending the second image to the graphics processor of the smart TV so that the graphics processor renders the second image includes: According to the size of the remaining operating memory of the smart TV, the color value of each pixel in the second image is adjusted to obtain a third image; Sending the third image to a graphics processor of the smart TV so that the graphics processor renders the third image; The deleting the second image comprises: The third image is deleted.
4. The method according to claim 3, characterized in that The adjusting the color value of each pixel in the second image according to the size of the remaining operating memory of the smart TV includes: If the size of the remaining running memory is higher than a preset threshold, increasing the color value of each pixel in the second image; If the size of the remaining running memory is lower than or equal to a preset threshold, the color value of each pixel in the second image is reduced.
5. The method according to claim 1, characterized in that The sending the second image to a graphics processor of the smart TV so that the graphics processor renders the second image includes: According to a preset display requirement corresponding to the first interface, adjust the color value of each pixel in the second image to obtain a third image, wherein the preset display requirement includes a preset color value of each pixel in the third image displayed in the first interface; Sending the third image to a graphics processor of the smart TV so that the graphics processor renders the third image; The deleting the second image comprises: The third image is deleted.
6. A smart TV, characterized in that: include: An operating memory and a processor, wherein an operating system is running on the processor, and an application program is running in an operating environment provided by the operating system, wherein the application program includes a core subroutine and a rendering optimization subroutine; The core subroutine is used to control the operation of the application program; The rendering optimization subroutine is used to copy a first image in the running memory of the smart TV in response to a first use operation triggered by a user on a first interface of the application program to obtain a copy result, wherein a size of the first image is smaller than a size of a target original image, and the target original image includes an image corresponding to the first interface; Restoring the size of the copy result to be the same as the target original image to obtain a second image; Sending the second image to a graphics processor of the smart TV so that the graphics processor renders the second image; In response to a second use operation triggered by the user on a second interface of the application, deleting the second image; The method for acquiring the first image includes: if the first usage operation is the first usage operation of the user on the first interface, determining the reduction ratio of the target original image in the running memory of the smart TV according to the size of the remaining running memory of the smart TV, and reducing the size of the target original image according to the reduction ratio to obtain the first image, and the reduction ratio is negatively correlated with the remaining running memory; if the first usage operation is not the first usage operation of the user on the first interface, determining the first image from the alternative images stored in the running memory of the smart TV, the alternative images including images obtained by reducing the size of the original images corresponding to different interfaces in the application, and the user triggers the first usage operation of the different interfaces before the first usage operation.
7. A rendering optimization device, characterized in that: include: a copy module, configured to copy a first image in a running memory of the smart TV in response to a first use operation triggered by a user on a first interface of an application program in the smart TV, so as to obtain a copy result, wherein a size of the first image is smaller than a size of a target original image, and the target original image includes an image corresponding to the first interface; The method for acquiring the first image includes: if the first use operation is the first use operation of the first interface by the user, determining the reduction ratio of the target original image in the running memory of the smart TV according to the size of the remaining running memory of the smart TV, and reducing the size of the target original image according to the reduction ratio to obtain the first image, and the reduction ratio is negatively correlated with the remaining running memory; if the first use operation is not the first use operation of the first interface by the user, determining the first image from the candidate images stored in the running memory of the smart TV, the candidate images including images obtained by reducing the size of the original images corresponding to different interfaces in the application, and the user triggers the first use operation of the different interfaces before the first use operation; A restoration module, used for restoring the size of the copy result to be the same as the target original image to obtain a second image; A sending module, configured to send the second image to a graphics processor of the smart TV, so that the graphics processor renders the second image; The deleting module is used to delete the second image in response to a second use operation triggered by the user on the second interface of the application.
8. An electronic device, characterized in that: include: A memory and a processor; wherein the memory stores executable code, and when the executable code is executed by the processor, the processor executes the rendering optimization method according to any one of claims 1 to 5.
9. A non-transitory machine-readable storage medium, characterized in that: The non-transitory machine-readable storage medium stores executable code, and when the executable code is executed by a processor of an electronic device, the processor executes the rendering optimization method according to any one of claims 1 to 5.
Citation Information
Patent Citations
High-definition image sawtooth-prevention method, device and digital television receiving terminal
CN101778226A
Browser memory improvement method on smart TV
CN108965471A