Display layer object processing method, display method, rendering method, and related devices

CN122985293APending Publication Date: 2026-10-27BEIJING SIMING QICHUANG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611330806.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-28
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0002]在现有技术中,响应于显示指令需要更新屏幕中的显示内容,每次都会基于显示指令创建新的显示层对象,频繁的创建新的显示层对象以及销毁原有的显示层对象,容易造成界面卡顿

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122985293A_ABST
    Figure CN122985293A_ABST
Patent Text Reader

Abstract

The application provides a display layer object processing method, a display method, a rendering method and related equipment. The display layer object processing method comprises: in the case of receiving a display instruction, obtaining a first identifier corresponding to the display instruction; determining at least one first tile region intersecting with the region information in the display instruction; obtaining display layer information of each first tile region; in the case that the display layer information of any first tile region comprises a plurality of second identifiers, the display layer information further comprises an arrangement order between the plurality of second identifiers; determining a target tile region from the first tile region according to the first identifier and the display layer information of each first tile region; and placing a first display layer object on the top layer of the target tile region. In this way, the tile region in which the content changes can be identified from the screen, and the display layer object is updated only for the tile region in which the content changes, thereby reducing resource waste.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of screen display, and more specifically, to a display layer object processing method, display method, rendering method, and related devices. Background Technology

[0002] In existing technologies, responding to display commands requires updating the content displayed on the screen, and a new display layer object is created each time based on the display command. The frequent creation and destruction of existing display layer objects can easily cause interface lag. Furthermore, even if the display command requires the rendered content to be exactly the same, display layer objects are still created repeatedly, resulting in wasted resources.

[0003] Furthermore, existing technologies typically iterate and update all display layer objects each time content is updated, failing to identify static areas where content has not changed, resulting in a large amount of invalid computation and significant performance waste.

[0004] In addition, when rendering images based on display layer objects, existing technologies typically use vector rendering mode to render image fonts. This results in a significant difference between the rendered fonts and the dot matrix fonts used by OLED hardware, leading to insufficient realism of the fonts seen by users. Summary of the Invention

[0005] The purpose of this application is to provide a display layer object processing method, display method, rendering method, and related device to solve at least some of the problems existing in the related technology.

[0006] In a first aspect, embodiments of this application provide a method for processing display layer objects, including: Upon receiving a display instruction, a first identifier corresponding to the display instruction is obtained; the first identifier is used to identify the first display layer object to be rendered by the display instruction. At least one first tile region is identified that intersects with the region information in the display instruction; the first tile region is a tile region among a plurality of preset tile regions; the plurality of tile regions are obtained by pre-dividing the screen; Obtain display layer information for each of the first tile regions; the display layer information includes a second identifier of the first tile region; the second identifier is used to identify the second display layer object present on the first tile region; if the display layer information of any first tile region includes multiple second identifiers, the display layer information also includes the arrangement order between the multiple second identifiers, the order between the multiple second identifiers characterizes the stacking order between the second display layer objects corresponding to the multiple second identifiers; Based on the first identifier and the display layer information of each first tile region, the target tile region that needs to be updated is determined from the first tile region; Place the first display layer object on top of the target tile area.

[0007] In the above implementation, since the first identifier can be used to identify the first display layer object to be rendered by the display instruction, the display layer information of each first tile area includes a second identifier for identifying the second display layer object existing on the first tile area. In the case that the display layer information of any first tile area includes multiple second identifiers, the display layer information also includes the arrangement order among the multiple second identifiers. The order among the multiple second identifiers represents the stacking order among the second display layer objects corresponding to the multiple second identifiers.

[0008] By using the first identifier and the display layer information of each first tile region, it can be determined not only whether the tile region includes a second display layer object identical to the first display layer object, but also, if the first tile region already includes a second display layer object identical to the first display layer object, whether the second display layer object identical to the first display layer object is at the top layer of the first tile region. This means that the target tile region requiring update can be identified from the first tile regions, and only the first display layer object is placed at the top layer of the target tile region. In this way, the tile region requiring content update, i.e., the target tile region, can be accurately identified from multiple first tile regions, and only the display layer object of the target tile region is updated, i.e., the first display layer object is placed at the top layer of the target tile region. This avoids invalid updates to tile regions whose content has not changed, i.e., avoids invalid content updates to non-target tile regions, thereby reducing resource waste.

[0009] Optionally, based on the first identifier and the display layer information of each of the first tile regions, the target tile region that needs to be updated is determined from the first tile region, including: For each of the first tile regions: Determine whether there is a target second identifier in the second identifier of the first tile area that is the same as the first identifier; If there is no target second identifier in the second identifier of the first tile area that is the same as the first identifier, the first tile area is determined to be the target tile area; If there is a target second identifier in the second identifier of the first tile area that is the same as the first identifier, and there is only one second identifier in the first tile area, then the first tile area is determined not to be the target tile area; If there is a target second identifier in the second identifier of the first tile area that is the same as the first identifier, and there are multiple second identifiers in the first tile area, then it is determined whether the target second identifier is located at the target position in the arrangement order corresponding to the first tile area; If the target second identifier is located at the target position in the arrangement order corresponding to the first tile area, the first tile area is determined not to be the target tile area; if the target second identifier is not located at the target position in the arrangement order corresponding to the first tile area, the first tile area is determined to be the target tile area.

[0010] In the above implementation, by determining whether a target second identifier identical to the first identifier exists in the second identifier of each first tile region, it can be determined whether a target second display layer object identical to the first display layer object exists in the first tile region. If no target second identifier identical to the first identifier exists in the second identifier of the first tile region, it can be directly determined that no target second display layer object identical to the first display layer object exists in the first tile region. Furthermore, the first tile region can be directly determined as the target tile region that needs to be updated. Conversely, if a target second identifier identical to the first identifier exists in the second identifier of the first tile region, it indicates that a target second display layer object identical to the first display layer object exists in the first tile region. If there is only one second identifier in the first tile region, it indicates that the target second display layer object identical to the first display layer object already exists at the top layer of the first tile region. Therefore, it is not necessary to change the stacking order of the second display layer objects in the first tile region, thus enabling rapid determination that the first tile region is not the target tile region. If there is a target second identifier in the second identifier of the first tile area that is identical to the first identifier, and there are multiple second identifiers in the first tile area, by determining whether the target second identifier is located at the target position in the arrangement order corresponding to the first tile area, it is also possible to quickly determine whether the target second display layer object in the first tile area that is identical to the first display layer object is located at the top of each of the second display layer objects corresponding to the first tile area. If the target second identifier is located at the target position in the arrangement order corresponding to the first tile area, it can be determined that the target second display layer object in the first tile area that is identical to the first display layer object is located at the top of each of the second display layer objects corresponding to the first tile area. Therefore, it can also be determined that no content update is needed for the first tile area, that is, the first tile area is determined to be a non-target tile area. If the target second identifier is not located at the target position in the arrangement order corresponding to the first tile area, it can be determined that the target second display layer object in the first tile area that is identical to the first display layer object is not located at the top of each of the second display layer objects corresponding to the first tile area. Therefore, it can be determined that the content of the first tile area needs to be updated, i.e., the first tile area is identified as the target tile area. Thus, regardless of whether the display layer information of the first tile area includes one or more second identifiers, it is possible to quickly determine whether the first tile area is the target tile area that needs updating based on its display layer information. This allows subsequent updates to the display layer object only on the target tile area, avoiding invalid content updates to non-target tile areas and reducing resource waste.

[0011] Optionally, based on the first identifier and the display layer information of each of the first tile regions, the target tile region that needs to be updated is determined from the first tile region, including: For each of the first tile regions: Determine whether there is a target second identifier in the second identifier of the first tile area that is the same as the first identifier; If there is no target second identifier in the second identifier of the first tile area that is the same as the first identifier, the first tile area is determined to be the target tile area; If there is a target second identifier in the second identifier of the first tile area that is the same as the first identifier, and there are multiple second identifiers in the first tile area, then the arrangement order in the display layer information of the first tile area is adjusted so that the target second identifier in the arrangement order is adjusted to the target position; The adjusted display layer information of the first tile area is hashed to obtain the first hash value; If the first hash value is consistent with the second hash value corresponding to the first tile region, it is determined that the first tile region is not the target tile region; If the first hash value is inconsistent with the second hash value corresponding to the first tile region, the first tile region is determined to be the target tile region; The second hash value corresponding to the first tile area is: the hash value obtained by pre-calculating the display layer information of the first tile area before adjustment.

[0012] In the above implementation, by determining whether a target second identifier identical to the first identifier exists in the second identifier of each first tile region, it can be determined whether a target second display layer object identical to the first display layer object exists in the first tile region. If no target second identifier identical to the first identifier exists in the second identifier of the first tile region, it can be directly determined that no target second display layer object identical to the first display layer object exists in the first tile region. Further, the first tile region can be directly determined as the target tile region that needs to be updated. Conversely, if a target second identifier identical to the first identifier exists in the second identifier of the first tile region, it indicates that a target second display layer object identical to the first display layer object exists in the first tile region. If there are multiple second identifiers for the first tile region, the arrangement order in the display layer information of the first tile region is adjusted to move the target second identifier to the target position. Then, a hash calculation is performed on the adjusted display layer information of the first tile region to obtain a first hash value. Thus, the first hash value reflects the display layer objects included in the adjusted first tile region, as well as the stacking order between these objects. Similarly, since the second hash value is a hash value obtained by pre-calculating the display layer information of the first tile region before adjustment, it also reflects the display layer objects included in the first tile region before adjustment and their stacking order. Therefore, by comparing the first hash value with the second hash value corresponding to the first tile region, it can be determined whether the stacking order of each display layer object in the first tile region before and after adjustment is the same, thereby quickly determining whether the first tile region is the target tile region. This allows for subsequent updates of display layer objects only in the target tile region, avoiding invalid content updates to non-target tile regions, and thus reducing resource waste.

[0013] Optionally, before determining whether a target second identifier identical to the first identifier exists in the second identifier of each first tile region, the display layer object processing method further includes: Determine whether there exists a target third identifier that is the same as the first identifier in the preset display layer object information; the display layer object information includes the correspondence between all created third display layer objects and third identifiers; the third identifier is used to identify the third display layer object; If there is no target third identifier in the display layer object information that is the same as the first identifier, then all the first tile regions are determined to be the target tile regions; If the display layer object information contains a target third identifier that is the same as the first identifier, then for each first tile area: determine whether there is a target second identifier that is the same as the first identifier in the second identifier of the first tile area.

[0014] In the above implementation, since the display layer object information includes the correspondence between all created third display layer objects and third identifiers, by determining whether there is a target third identifier identical to the first identifier in the preset display layer object information, it can be determined whether the first display layer object indicated by the display instruction has been created. If there is no target third identifier identical to the first identifier in the display layer object information, it can be determined that the display layer object indicated by the display instruction has not been created. Correspondingly, it can be inferred without doubt that there is no first display layer object indicated by the display instruction in each first tile region. Therefore, it can be directly and quickly determined that all first tile regions are target tile regions.

[0015] If a target third identifier identical to the first identifier exists in the display layer object information, it indicates that the display layer object to be rendered by the display instruction has been created. However, since the creation of a display layer object does not mean that the display layer object is actually applied to the screen, the above implementation further determines the target tile region for each of the first tile regions. This ensures that the display layer object is updated only in the target tile region, avoiding invalid content updates to non-target tile regions, thereby reducing resource waste.

[0016] Optionally, the display layer object processing method further includes: If there is no target third identifier that is the same as the first identifier in the display layer object information, in response to receiving a display object creation instruction, a first display layer object is created based on the display instruction; The correspondence between the first display layer object and the first identifier is stored in the display layer object information.

[0017] In the above implementation, since the display layer object information includes the correspondence between all created third display layer objects and third identifiers, it can be determined whether the first display layer object instructed by the display command has been created by determining whether there is a target third identifier identical to the first identifier in the display layer object information. If there is no target third identifier identical to the first identifier in the display layer object information, it can be determined that the display layer object instructed by the display command has not been created. If there is no target third identifier identical to the first identifier in the display layer object information, in response to receiving a display object creation command, a first display layer object is created based on the display command. The newly created first display layer object can then be placed at the top layer of the target tile area. If there is a target third identifier identical to the first identifier in the display layer object information, it can be determined that the display layer object instructed by the display command has been created. Correspondingly, placing the first display layer object at the top layer of the target tile area can be understood as placing the third display layer object corresponding to the target third identifier at the top layer of the target tile area. Thus, the reuse of already created display layer objects is achieved, eliminating the need to repeatedly create display layer objects based on the same display command, reducing resource waste and saving performance overhead.

[0018] Optionally, obtaining the first identifier corresponding to the display instruction includes: The display parameters and the type of the display instruction are sorted and encoded according to a preset order to obtain the first identifier corresponding to the display instruction.

[0019] In the above implementation, the first identifier corresponding to the display instruction is obtained by sorting and encoding the display parameters and the type of the display instruction in a preset order. In this way, as long as the display parameters in multiple display instructions are the same, even if the order of the display parameters in different display instructions is different, the multiple display instructions can correspond to the same first identifier. Thus, the first identifier is used to identify different display instructions.

[0020] Optionally, the display layer object processing methods also include: If, based on the first identifier and the display layer information of each of the first tile regions, no target tile region needs to be updated from the first tile regions, the processing of the display instruction ends.

[0021] In the above implementation, if no target tile region that needs to be updated is determined from the first tile region, the processing of the display command is directly terminated, indicating that the processing of the display command is complete.

[0022] Secondly, this application provides a screen display method, including: The display instructions in the preset display instruction set are processed sequentially according to the display layer object processing method described in the first aspect above. In response to the completion of the last display instruction in the display instruction set, all tile areas are rendered.

[0023] In the above implementation, all tile areas are rendered uniformly in response to the completion of the last display instruction in the display instruction set. This allows for batch processing of display instructions when there are a large number of them, and the entire screen can be drawn in a single or very few rendering operations, which helps to save resources.

[0024] Optionally, the display instructions in the display instruction set are the display instruction set obtained by deduplicating all display instructions received in the later update LateUpdate stage.

[0025] In the above implementation, since LateUpdate is the last logical update stage before each frame is rendered in the Unity engine, all display instructions generated in the current frame have been received by this time. Processing the display instructions uniformly at this point ensures that the complete set of display instructions for the current frame is obtained, without omitting or prematurely processing incomplete instructions.

[0026] Optionally, all display commands received during the LateUpdate phase have a temporal order; the deduplication operation includes: Delete the first display instruction from all display instructions received in the LateUpdate phase; the first display instruction is: a target display instruction that is not the latest time sequence among multiple target display instructions; the multiple target display instructions are display instructions whose display parameters are all the same among all display instructions. And / or, Delete the second display instruction from all display instructions received in the LateUpdate phase; the second display instruction is a display instruction that has a third display instruction following it; the third display instruction is a display instruction whose area information covers the area information of the second display instruction, and the third display instruction is used to indicate clearing all display layer objects in the area information of the third display instruction, or to indicate a display instruction that forms an opaque overlay in the area information of the third display instruction.

[0027] In the above implementation, by deleting the first display instruction and the second display instruction from all display instructions received in the LateUpdate stage, the number of display instructions in the display instruction set can be reduced without affecting the final display effect, thereby speeding up the batch processing of display instructions in subsequent processes.

[0028] Optionally, all said tile regions are rendered, including: Determine the current rendering mode of the screen; Render all the tile regions according to the current rendering mode.

[0029] In the above implementation, by determining the current rendering mode of the screen and rendering all tile areas according to the current rendering mode, the first display layer object rendered by the display instruction can be presented on the screen, making it convenient for users to view the display effect.

[0030] Optionally, the screen is a virtual screen. When the current rendering mode is pixel rendering mode, all the tile areas are rendered according to the current rendering mode, including: Rasterize all display layer objects in all the tile areas into pixel data; The pixel data is written to a low-resolution pixel buffer texture; the resolution of the low-resolution pixel buffer texture is consistent with the resolution of the organic light-emitting display (OLED) hardware. The pixel data written to the low-resolution pixel buffer texture is magnified by a preset factor and filled to fill the virtual screen using a nearest neighbor sampling algorithm; wherein the preset factor is determined by the ratio between the resolution of the virtual screen and the resolution of the OLED hardware.

[0031] In existing technologies, to ensure display clarity, the resolution of virtual screens is typically higher than that of OLED hardware. If rendering is performed directly according to the resolution of the virtual screen, the rendered elements (text and / or graphics) will present a smooth, high-definition effect, completely different from the pixelation of real OLED hardware. However, in the implementation described above, pixel data is first written to a low-resolution pixel buffer texture, and then a nearest-neighbor sampling algorithm is used to amplify it by a preset factor and fill the virtual screen. This allows each logical pixel to be amplified by a preset factor, thereby enabling the elements in the image to be presented in a pixel-matrix format, thus matching the display effect of real OLED hardware.

[0032] Optionally, the screen is a virtual screen. When the current rendering mode is vector rendering mode, all the tile areas are rendered according to the current rendering mode, including: For text elements in all display layer objects across all the tile regions, render using a text component; For all image elements in all display layer objects across all the tile regions, render using the image component.

[0033] In the above implementation, text elements in all display layer objects across all tile areas are rendered using a text component; image elements in all display layer objects across all tile areas are rendered using an image component. This allows for rendering of all tile areas in a vector rendering mode, ensuring the readability of all elements on the screen.

[0034] Optionally, after rendering all the tile areas according to the current rendering mode, the screen display method further includes: If the preset mode switching conditions are met, all the tile areas are rendered according to the first rendering mode; The first rendering mode is a rendering mode that is different from the current rendering mode, which is either a pixel rendering mode or a vector rendering mode.

[0035] In the above implementation, by limiting rendering to a first rendering mode that differs from the current rendering mode, all tile areas can be rendered only when the mode switching condition is met. This allows for switching of rendering modes and meets different display needs of users.

[0036] Optionally, the screen is a virtual screen, and the mode switching conditions include: The distance between the camera and the virtual screen changes from a first preset distance threshold range to a second preset distance threshold range, or the distance between the camera and the virtual screen changes from the second preset distance threshold range to the first preset distance threshold range; The rendering mode corresponding to the first preset distance threshold interval is vector rendering mode; the rendering mode corresponding to the second preset distance threshold interval is pixel rendering mode. The maximum value in the first preset distance threshold interval is less than or equal to the minimum value in the second preset distance threshold interval.

[0037] In the above implementation, the rendering mode corresponding to the first preset distance threshold interval is determined to be vector. In the rendering mode, when the distance between the camera and the virtual screen is within the first preset distance threshold range, that is, when the distance between the camera and the virtual screen is relatively close, the rendering mode can be used to render the image, which can make the presented image readable.

[0038] By determining the rendering mode corresponding to the second preset distance threshold range as pixel rendering mode, it is shown that when the distance between the camera and the virtual screen is within the second preset distance threshold range, that is, when the distance between the camera and the virtual screen is relatively far, using pixel rendering mode to render the image can make the presented image close to the display effect of real OLED hardware.

[0039] In the above implementation, the rendering mode is adaptively adjusted based on changes in the distance between the camera and the virtual screen. This allows for adaptive switching of the rendering mode according to distance, meeting different display needs of the user.

[0040] Optionally, the mode switching conditions include: The processor's rendering frame rate switches from the first frame rate to the second frame rate, or the processor's rendering frame rate switches from the second frame rate to the first frame rate; Wherein, the second frame rate is less than a preset frame rate threshold, and the first frame rate is greater than the preset frame rate threshold; the rendering mode corresponding to the second frame rate is pixel rendering mode, and the rendering mode corresponding to the first frame rate is vector rendering mode.

[0041] Because vector rendering mode has high requirements for real-time calculation and frame generation frequency (requiring a first frame rate), while pixel rendering mode has a relatively low performance load (requiring a second frame rate), the above implementation switches the rendering mode by limiting the processor's rendering frame rate to switch from the first frame rate to the second frame rate, or vice versa. This effectively avoids screen tearing, frame drops, stuttering, and other abnormal phenomena caused by mismatched rendering frame rates.

[0042] Thirdly, this application provides a method for rendering a screen, including: Obtain scene information; The current rendering mode of the screen is determined based on the scene information; The image is rendered according to the current rendering mode.

[0043] In the above implementation, by obtaining scene information and determining the current rendering mode of the screen based on the scene information, the screen can be rendered according to the current rendering mode corresponding to the scene information, thereby meeting the user's different display needs.

[0044] Optionally, the screen is a virtual screen, and the scene information includes the distance between the camera and the virtual screen; obtaining scene information includes: Obtain the distance between the camera and the virtual screen; Correspondingly, the current rendering mode of the screen is determined based on the scene information, including: If the distance between the camera and the virtual screen is within a first preset distance threshold range, the current rendering mode of the screen is determined to be vector rendering mode; or; If the distance between the camera and the virtual screen is within a second preset distance threshold range, the current rendering mode of the screen is determined to be pixel rendering mode. The maximum value in the first preset distance threshold interval is less than or equal to the minimum value in the second preset distance threshold interval.

[0045] In the above implementation, by obtaining the distance between the camera and the virtual screen and determining whether the distance between the camera and the virtual screen is within the first preset distance threshold range or the second preset distance threshold range, the current rendering mode of the screen is determined to be either vector rendering mode or pixel rendering mode, thereby realizing adaptive adjustment of the rendering mode according to the distance.

[0046] Optionally, the scene information includes the processor's rendering frame rate; obtaining scene information includes: Get the processor's rendering frame rate; Correspondingly, the current rendering mode of the screen is determined based on the scene information, including: If the processor's rendering frame rate is lower than a preset frame rate threshold, the current rendering mode of the screen is determined to be pixel rendering mode; or, If the processor's rendering frame rate is greater than or equal to a preset frame rate threshold, the current rendering mode of the screen is determined to be vector rendering mode.

[0047] Because vector rendering mode has high requirements for real-time calculation and frame generation frequency (greater than or equal to the preset frame rate threshold), while pixel rendering mode has relatively low performance load (less than the preset frame rate threshold), the above implementation determines the current rendering mode of the screen as pixel rendering mode when the processor's rendering frame rate is lower than the preset frame rate threshold, and determines the current rendering mode of the screen as vector rendering mode when the processor's rendering frame rate is greater than or equal to the preset frame rate threshold. This can achieve the determination of the screen's rendering mode based on the processor's rendering frame rate, thereby effectively avoiding abnormal phenomena such as screen tearing, frame dropping, and stuttering caused by mismatched rendering frame rates.

[0048] Optionally, the screen is a virtual screen, and the scene information includes the distance between the camera and the virtual screen and the processor's rendering frame rate; obtaining scene information includes: Obtain the distance between the camera and the virtual screen, as well as the processor's rendering frame rate; Correspondingly, the current rendering mode of the screen is determined based on the scene information, including: Determine whether the processor's rendering frame rate is lower than a preset frame rate threshold; If the processor's rendering frame rate is lower than the preset frame rate threshold, the current rendering mode of the screen is determined to be pixel rendering mode; or; If the processor's rendering frame rate is greater than or equal to the preset frame rate threshold, and the distance between the camera and the virtual screen is within the first preset distance threshold range, then the current rendering mode of the screen is determined to be vector rendering mode; or; If the processor's rendering frame rate is greater than or equal to the preset frame rate threshold, and the distance between the camera and the virtual screen is within the range of the second preset distance threshold, then the current rendering mode of the screen is determined to be pixel rendering mode. The maximum value in the first preset distance threshold interval is less than or equal to the minimum value in the second preset distance threshold interval.

[0049] Because vector rendering mode has high requirements for real-time calculation and frame generation frequency (greater than or equal to a preset frame rate threshold), while pixel rendering mode has relatively low performance load (less than a preset frame rate threshold), if vector rendering mode is used for rendering when the processor's rendering frame rate is less than the preset frame rate threshold, it can easily cause screen tearing, frame drops, stuttering, and other abnormal phenomena. In the above implementation, by first determining whether the processor's rendering frame rate is lower than the preset frame rate threshold, if the processor's rendering frame rate is lower than the preset frame rate threshold, the current rendering mode is directly determined to be pixel rendering mode. This can effectively reduce the occurrence of screen tearing, frame drops, stuttering, and other abnormal phenomena caused by the mismatch between the rendering frame rate and the rendering mode. When the processor's rendering frame rate is greater than or equal to the preset frame rate threshold, the rendering frame rate requirements of both vector rendering mode and pixel rendering mode can be met simultaneously. At this time, it is further determined whether the distance between the camera and the virtual screen is within a first preset distance threshold range or a second preset distance threshold range, thereby determining whether the current rendering mode of the screen is vector rendering mode or pixel rendering mode, and thus enabling adaptive adjustment of the rendering mode based on distance.

[0050] Fourthly, this application provides a display layer object processing apparatus, comprising: The first acquisition module is configured to acquire a first identifier corresponding to the display instruction upon receiving a display instruction; the first identifier is used to identify the first display layer object to be rendered by the display instruction. The first determining module is configured to determine at least one first tile region that intersects with the area information in the display instruction; the first tile region is a tile region among a plurality of preset tile regions; the plurality of tile regions are obtained by pre-dividing the screen; The second acquisition module is configured to acquire display layer information for each of the first tile regions; the display layer information includes a second identifier of the first tile region; the second identifier is used to identify a second display layer object existing on the first tile region; when the display layer information of any first tile region includes multiple second identifiers, the display layer information also includes the arrangement order between the multiple second identifiers, the order between the multiple second identifiers characterizing the stacking order between the second display layer objects corresponding to the multiple second identifiers; The second determining module is configured to determine the target tile area that needs to be updated from the first tile area based on the first identifier and the display layer information of each first tile area; The first processing module is configured to place the first display layer object on top of the target tile region.

[0051] Fifthly, this application provides a screen display device, comprising: The second processing module is configured to process the display instructions in the preset display instruction set sequentially according to the display layer object processing method described in the first aspect above. The first rendering module is configured to render all the tile areas in response to the completion of the processing of the last display instruction in the display instruction set.

[0052] Sixthly, this application provides a screen rendering apparatus, comprising: The third acquisition module is configured to acquire scene information; The third determining module is configured to determine the current rendering mode of the screen based on the scene information; the current rendering mode is either pixel rendering mode or vector rendering mode. The second rendering module is configured to render the image according to the current rendering mode.

[0053] In a seventh aspect, this application provides an electronic device including a processor and a memory, the memory storing computer-executable instructions that can be executed by the processor, the processor executing the computer-executable instructions to implement the display layer object processing method of the first aspect, or the screen display method of the second aspect, or the screen rendering method of the third aspect.

[0054] Eighthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when called and executed by a processor, cause the processor to implement the display layer object processing method of the first aspect, or the screen display method of the second aspect, or the screen rendering method of the third aspect.

[0055] Ninthly, this application provides a computer program product, the computer program product including a computer program, which, when executed by a processor, implements the display layer object processing method of the first aspect, or the screen display method of the second aspect, or the screen rendering method of the third aspect. Attached Figure Description

[0056] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0057] Figure 1 A flowchart illustrating a display layer object processing method provided in an embodiment of this application; Figure 2 A schematic diagram of a screen display provided for an embodiment of this application; Figure 3 A schematic diagram of another screen display provided for an embodiment of this application; Figure 4 A flowchart illustrating a screen display method provided in an embodiment of this application; Figure 5 A schematic diagram of another screen display provided for an embodiment of this application; Figure 6 A flowchart illustrating a screen rendering method provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of a display layer object processing device provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of a screen display device provided in an embodiment of this application; Figure 9 This is a schematic diagram of the structure of a screen rendering device provided in an embodiment of this application; Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0058] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0059] Example 1: To address the resource waste issue in existing screen rendering processes, this application provides a method for processing display layer objects. See also... Figure 1 As shown, Figure 1This is a flowchart illustrating the display layer object processing method provided in the embodiments of this application, which may include the following steps: Step S101: Upon receiving a display instruction, obtain the first identifier corresponding to the display instruction; the first identifier is used to identify the first display layer object to be rendered by the display instruction.

[0060] Display layer objects represent instances of objects that occupy a specific position in the screen coordinate system, have a specific shape, texture, and color, and can be rendered.

[0061] The first display layer object that the display instruction indicates to be rendered is the display layer object that the display instruction indicates to be rendered on the screen.

[0062] In this embodiment of the application, the display parameters and the type of the display instruction in the display instruction can be sorted and encoded in a preset order to obtain the first identifier corresponding to the display instruction.

[0063] In one optional implementation of this application, if the first display layer object to be rendered by the display instruction is text, the display parameters in the display instruction may include one or more of the following: the position information of the first display layer object on the screen (i.e., the physical coordinates in the horizontal direction and the physical coordinates in the vertical direction), the physical width and physical height of the screen (i.e., the physical width and physical height of the area), the automatic line wrapping flag, the display color name, and the text content. The display parameters and the type of the display instruction can be sorted in the following order to obtain a first identifier: TXT|physical coordinates in the horizontal direction, physical coordinates in the vertical direction|font size in pixels|display color name|automatic line wrapping flag|physical width of the area x physical height of the area|text content. Here, TXT indicates that the type of the display instruction is text, that is, that the first display layer object to be rendered by the display instruction is a text element.

[0064] For example, if the first display layer object to be rendered by the display instruction is a text element, the display parameters in the display instruction include the horizontal physical coordinate "0", the vertical physical coordinate "0", the font size pixel value "160", the display color name "white", the automatic line wrapping flag, the area physical width "1600", the area physical height "1280", and the text content "Hello World". Then the first identifier of the display instruction can be: TXT|0, 0|160|white|1|1600x1280|HelloWorld. If the display instruction does not include the automatic line wrapping flag, and other display parameters remain unchanged, then the first identifier of the display instruction can be: TXT|0, 0|160|white|0|1600x1280|Hello World.

[0065] In one optional implementation of this application, if the first display layer object to be rendered indicated by the display instruction is an image, the display parameters in the display instruction may include the position information of the first display layer object on the screen (i.e., the physical coordinates in the horizontal direction and the physical coordinates in the vertical direction), the physical width and physical height of the screen (i.e., the physical width and physical height of the area), and the image name. The type of the display instruction and the display parameters of the display instruction can be sorted in the following order to obtain a first identifier: IMG|Image Name|Physical Coordinates in the Horizontal Direction, Physical Coordinates in the Vertical Direction|Physical Width of the Area x Physical Height of the Area. Wherein, IMG indicates that the type of the display instruction is an image, that is, it indicates that the first display layer object to be rendered indicated by the display instruction is an image element.

[0066] For example, if the first display layer object to be rendered by the display instruction is an image element, and the display parameters in the display instruction include the image name "Welcome 1", the horizontal physical coordinate "0", the vertical physical coordinate "0", the area physical width "1600", and the area physical height "1280", then the first identifier of the display instruction can be: IMG|Welcome 1|0, 0|1600x1280.

[0067] Thus, display instructions with the same display parameters and the same type have the same first identifier. In other words, display instructions that produce the same visual effect on the screen have the same first identifier, which makes it easier to quickly determine the target tile area that needs to be updated from the first tile area based on the first identifier.

[0068] Step S102: Determine at least one first tile region that intersects with the area information in the display instruction; the first tile region is a tile region among a plurality of preset tile regions; the plurality of tile regions are obtained by pre-dividing the screen.

[0069] For example, the screen can be divided into M columns × N rows of tile regions, each tile region covering a fixed-size coordinate area. For instance, the screen can be divided into 8 columns × 8 rows of tile regions.

[0070] In this embodiment, the region information in the display instruction can correspond to the position information of the first display layer object to be rendered by the display instruction in the screen coordinate system. Correspondingly, determining at least one first tile region that intersects with the region information in the display instruction can be understood as determining which tile regions on the screen the first display layer object to be rendered by the display instruction intersects with.

[0071] Combination Figure 2As shown in the schematic diagram, the screen is divided into 2×2 tile regions, namely G1, G2, G3, and G4. The region information of display layer object q1 intersects with only one tile region (G1), while the region information of display layer object q2 intersects with multiple tile regions (G3 and G4). Therefore, the first display layer object rendered by the display instruction can intersect with only one tile region or with multiple tile regions on the screen. The determination of which tile regions the first display layer object intersects with can be based on the region information of the first display layer object and the coverage area of ​​each tile region.

[0072] Step S103: Obtain display layer information for each first tile region; the display layer information includes a second identifier of the first tile region; the second identifier is used to identify the second display layer object existing on the first tile region; if the display layer information of any first tile region includes multiple second identifiers, the display layer information also includes the arrangement order between the multiple second identifiers, and the order between the multiple second identifiers represents the stacking order between the second display layer objects corresponding to the multiple second identifiers.

[0073] Combination Figure 3 As shown in the schematic diagram of the screen, multiple display layer objects can be stacked on top of each other within a tile area, for example... Figure 3 In the tile region G1, display layer objects q1, q3, and q4 occupy areas within tile region G1. Therefore, the display layer information in tile region G1 may include multiple second identifiers to identify display layer objects q1, q3, and q4. Step S104: Based on the first identifier and the display layer information of each first tile area, determine the target tile area that needs to be updated from the first tile area.

[0074] In this embodiment, for each first tile region, it can be determined whether there is a target second identifier in the second identifier of the first tile region that is the same as the first identifier; if there is no target second identifier in the second identifier of the first tile region that is the same as the first identifier, the first tile region is determined to be a target tile region. Furthermore, it can be determined that all first tile regions are target tile regions. Since the first identifier is used to identify the first display layer object to be rendered by the display instruction, and the second identifier is used to identify the second display layer object existing on the first tile region, if there is no target second identifier in the second identifier of the first tile region that is the same as the first identifier, it can be determined that the first display layer object identified by the first identifier does not exist in the first tile region. That is, the first display layer object is not used, and if the first display layer object is not used, the first identifier of the first display layer object will not exist in the display layer information of other first tile regions. Thus, it can be determined that all first tile regions are target tile regions. Conversely, if there is a target second identifier in the second identifier of any first tile region that is the same as the first identifier, it can be determined without doubt that the first display layer object has been created and used. Therefore, in all first tile regions, there will be a second display layer object that is the same as the first display layer object.

[0075] If there is a target second identifier in the second identifier of the first tile area that is the same as the first identifier, and there is only one second identifier in the first tile area, then the first tile area is determined not to be a target tile area.

[0076] If there is a target second identifier in the second identifier of the first tile area that is the same as the first identifier, and there are multiple second identifiers in the first tile area, the first tile area can be determined as a target tile area based on the following method: Method 1: Determine whether the second target identifier is located at the target position in the arrangement order corresponding to the first tile area; if the second target identifier is located at the target position in the arrangement order corresponding to the first tile area, determine that the first tile area is not the target tile area; if the second target identifier is not located at the target position in the arrangement order corresponding to the first tile area, determine that the first tile area is the target tile area.

[0077] The target location indicates that the target second display layer object corresponding to the target second identifier is located on the top layer of each second display layer object corresponding to the first tile area.

[0078] For example, if the second identifier of the first tile area includes W1, W2, and W3, and the second identifiers are arranged in the order of W3, W2, and W1 from front to back, then if the target position in the arrangement order is the first position, then the second identifier W3 is at the target position.

[0079] If the first identifier is W3, then it can be determined that there exists a target second identifier, W3, in the second identifiers of the first tile region that is identical to the first identifier. Furthermore, this target second identifier W3 is located at the target position in the corresponding arrangement order of the first tile region. Therefore, the first tile region is not a target tile region.

[0080] If the first identifier is W2, then it can be determined that there exists a target second identifier, W2, in the second identifiers of the first tile region that is identical to the first identifier. Furthermore, this target second identifier W2 is not located at a target position in the arrangement order corresponding to the first tile region. Therefore, the first tile region is the target tile region.

[0081] Method 2: The arrangement order of the display layer information in the first tile region is adjusted to move the target second identifier to the target position. A hash calculation is performed on the adjusted display layer information of the first tile region to obtain a first hash value. If the first hash value matches the second hash value corresponding to the first tile region, it can be determined that the first tile region is not the target tile region; if the first hash value does not match the second hash value corresponding to the first tile region, it can be determined that the first tile region is the target tile region. The second hash value corresponding to the first tile region is a hash value obtained by pre-calculating the display layer information of the first tile region before adjustment. Since the order between the second identifiers represents the stacking order between multiple second display layer objects corresponding to the second identifiers, adjusting the target second identifier to the target position reflects the stacking order between the adjusted display layer objects. Since the first hash value is obtained by hash calculation based on the adjusted display layer information, the first hash value reflects the display layer objects included in the adjusted first tile region and the stacking order between the display layer objects. Since the second hash value is a hash value obtained by pre-calculating the display layer information of the first tile region before adjustment, it can reflect the display layer objects included in the first tile region before adjustment and the stacking order between them. Therefore, by comparing the first hash value with the second hash value corresponding to the first tile region, it can be determined whether the stacking order between the display layer objects in the first tile region before and after adjustment is the same, thereby quickly determining whether the first tile region is the target tile region.

[0082] In this embodiment of the application, if the display layer information includes multiple second identifiers and the order in which the multiple second identifiers are arranged, then the hash value can be obtained by directly performing a hash calculation on all the second identifiers arranged in the order in the display layer information.

[0083] To more quickly determine whether a first tile region is a target tile region, before determining whether there is a target second identifier identical to the first identifier in the second identifier of each first tile region, it can be first determined whether the first display layer object indicated by the first identifier has been created. Only if the first display layer object indicated by the first identifier has been created is it determined whether there is a target second identifier identical to the first identifier in the second identifier of each first tile region. That is, only if the first display layer object indicated by the first identifier has been created is it determined whether the first display layer object indicated by the first identifier is used.

[0084] In this embodiment of the application, it can be determined whether the first display layer object indicated by the first identifier has been created in the following way: In the preset display layer object information, determine whether there is a target third identifier that is the same as the first identifier; the display layer object information includes the correspondence between all created third display layer objects on the screen and the third identifier; the third identifier is used to identify the third display layer object.

[0085] If the display layer object information does not contain a target third identifier that is identical to the first identifier, then the first display layer object indicated by the first identifier has not been created, and correspondingly, all first tile regions are target tile regions. If the display layer object information contains a target third identifier that is identical to the first identifier, it indicates that the first display layer object indicated by the first identifier has been created.

[0086] In this embodiment, each third display layer object in the preset display layer object information can be stored in the form of a doubly linked list. The head of the doubly linked list can be the least used display layer object, and the tail of the list can be the most recently used display layer object. In other words, the third display layer objects can be stored in the order in which they have been used.

[0087] The mapping between the third identifier and the third display layer object in the display layer object information can be stored in the form of a hash table. In a forward hash table, the mapping from the third identifier to the third display layer object can be stored; in a reverse hash table, the mapping from the third display layer object to the third identifier can exist.

[0088] Thus, if it is determined whether there is a target third identifier that is the same as the first identifier in the preset display layer object information, the first identifier can be used as the key to perform a matching operation in the forward hash table. If the matching is successful, it is determined that there is a target third identifier that is the same as the first identifier in the display layer object information, that is, there is a third display layer object corresponding to the first identifier in the forward hash table.

[0089] In the subsequent cleanup of third-layer display objects, the objects to be cleaned can be deleted from the doubly linked list. A matching operation can then be performed on the reverse hash table to obtain the corresponding third-layer identifier. This allows the object and its identifier to be deleted from the reverse hash table. Similarly, the third-layer identifier can be used to perform a matching operation on the forward hash table to identify the object to be cleaned. Finally, the object and its identifier are deleted from the forward hash table. This completes the cleanup of the third-layer display objects.

[0090] In some use cases, the third display layer object, the third identifier, and the correspondence between them can also be stored directly. Here, there are no restrictions on the storage format of the display layer object information.

[0091] Step S105: Place the first display layer object on top of the target tile area.

[0092] In this embodiment of the application, for each first tile area: if there is a target second identifier in the second identifier of the first tile area that is the same as the first identifier, it indicates that the first display layer object to be rendered by the display instruction exists. Therefore, the first display layer object can be directly placed on the top layer of the target tile area.

[0093] If no target second identifier identical to the first identifier exists in the second identifier of the first tile region, it indicates that the first display layer object instructed by the display command is not used. If the first display layer object exists in the display layer object information, it can be directly placed at the top layer of the target tile region. If the first display layer object does not exist in the display layer object information, it indicates that the first display layer object has not been created, and therefore it can be created based on the display command. Correspondingly, placing the first display layer object at the top layer of the target tile region can be understood as placing the newly created first display layer object at the top layer of the target tile region.

[0094] In this embodiment, all created display layer objects can be stored in a preset storage area, such as display layer object information. Therefore, after creating the first display layer object based on the display instruction, the first identifier, the newly created first display layer object, and the correspondence between them can be stored in the display layer object information.

[0095] However, due to the limited storage capacity of the preset storage area, it is necessary to determine whether the number of display layer objects in the preset storage area has reached a preset threshold before storing the newly created first display layer object. If the number of display layer objects in the preset storage area has not reached the preset threshold, the newly created first display layer object can be directly stored in the preset storage area. However, if the number of display layer objects in the preset storage area has reached the preset threshold, the least used display layer object in the preset storage area can be deleted before storing the first identifier, the newly created first display layer object, and the correspondence between them in the preset storage area.

[0096] In one optional implementation of this application, the arrangement order of the second identifier in the display layer information of the target tile area can be adjusted to adjust the first identifier of the first display layer object to the target position, thereby placing the first display layer object on the top layer of the target tile area.

[0097] In another optional embodiment provided in this application, the display layer information of the first tile region may further include second display layer objects existing on the first tile region. When there are multiple second display layer objects on the first tile region, the display layer information of the first tile region may further include the arrangement order of the second display layer objects. The arrangement order of the second display layer objects corresponds to their stacking order in the first tile region. Therefore, the arrangement order of the second display layer objects in the display layer information of the target tile region can be adjusted to adjust the first display layer object to the target order, thereby placing the first display layer object on top of the target tile region.

[0098] In this embodiment of the application, the aforementioned steps S104 and S105 can be replaced by: if, based on the first identifier and the display layer information of each first tile area, the target tile area that needs to be updated is not determined from the first tile area, the processing of the display instruction is terminated.

[0099] The display layer object processing method provided in this application determines whether a target second display layer object exists in the first tile region by determining whether there is a target second identifier identical to the first identifier in the second identifier of the first tile region. If there is no target second identifier identical to the first identifier in the second identifier of the first tile region, it can be directly determined that there is no target second display layer object identical to the first display layer object in the first tile region. Further, the first tile region can be directly determined as a target tile region that needs to be updated. Conversely, if there is a target second identifier identical to the first identifier in the second identifier of the first tile region, it indicates that there is a target second display layer object identical to the first display layer object in the first tile region. If there is only one second identifier in the first tile region, it indicates that the target second display layer object identical to the first display layer object in the first tile region already exists at the top layer of the first tile region. Therefore, it is not necessary to change the stacking order of the second display layer objects in the first tile region, which means that it is possible to quickly determine that the first tile region is not a target tile region. If there is a target second identifier in the second identifier of the first tile area that is identical to the first identifier, and there are multiple second identifiers in the first tile area, by determining whether the target second identifier is located at the target position in the arrangement order corresponding to the first tile area, it is also possible to quickly determine whether the target second display layer object in the first tile area that is identical to the first display layer object is located at the top of all the second display layer objects corresponding to the first tile area. If the target second identifier is located at the target position in the arrangement order corresponding to the first tile area, it can be clearly determined that the target second display layer object in the first tile area that is identical to the first display layer object is located at the top of all the second display layer objects corresponding to the first tile area. Therefore, it can also be determined that no content update is needed for the first tile area, that is, the first tile area is determined to be a non-target tile area. If the target second identifier is not located at the target position in the arrangement order corresponding to the first tile area, it can be clearly determined that the target second display layer object in the first tile area that is identical to the first display layer object is not located at the top of all the second display layer objects corresponding to the first tile area. Therefore, it can be determined that the content of the first tile area needs to be updated, i.e., the first tile area is identified as the target tile area. Thus, regardless of whether the display layer information of the first tile area includes one or more second identifiers, it is possible to quickly determine whether the first tile area is the target tile area that needs updating based on its display layer information. This allows subsequent updates to the display layer object only on the target tile area, avoiding invalid content updates to non-target tile areas and reducing resource waste.

[0100] Example 2 Given that the essence of a display instruction is to instruct the screen display, and the display layer object is an object to be rendered, after processing the first display layer object indicated by the display instruction according to the aforementioned Embodiment 1, a rendering operation is necessary to achieve the final display effect expected by the user. Based on Embodiment 1, this application provides a screen display method, combining... Figure 4 The flowchart of the screen display method shown may include the following steps: Step S401: Process the display instructions in the preset display instruction set sequentially according to the display layer object processing method of Embodiment 1 described above.

[0101] In this application, the display instructions in the display instruction set are the display instruction set obtained by deduplicating all display instructions received in the later update LateUpdate stage.

[0102] For example, in the later LateUpdate stage, all display commands can be retrieved from the first command storage area. All retrieved display commands are then stored in the second command storage area, and deduplication is performed on all display commands in the second command storage area to obtain the display command set.

[0103] During the deduplication process of all display instructions in the second instruction storage area, the processor can receive new display instructions and store them in the first instruction storage area, waiting for the processor to retrieve the display instructions from the first instruction storage area and perform deduplication in the next LateUpdate stage.

[0104] In this embodiment of the application, all display instructions received in the LateUpdate phase have a temporal order, and the deduplication operation may include: deleting the first display instruction from all display instructions received in the LateUpdate phase; the first display instruction is: the non-latest temporal target display instruction among multiple target display instructions; the multiple target display instructions are display instructions with the same display parameters among all display instructions.

[0105] In other words, among all the display instructions received during the LateUpdate phase, there may be target display instructions with identical display parameters and types. However, due to differences in timing, the stacking order of the first display layer object indicated by the target display instruction in the tile region needs to be adjusted. Therefore, if multiple target display instructions have identical display parameters, only the latest timing target display instruction can be retained, while non-latest timing target display instructions can be deleted. This reduces the number of display instructions to be processed and speeds up the processing of display instructions.

[0106] Exemplarily, all the display instructions received in the LateUpdate phase include: A1, B2, A2, A3 and C1. The time sequence order among A1, B2, A2, A3 and C1 is A1'<B2'<A2'<A3'<C1', where A1' represents the generation time of display instruction A1, B2' represents the generation time of display instruction B2, A2' represents the generation time of display instruction A2, A3' represents the generation time of display instruction A3, and C1' represents the generation time of display instruction C1. The display parameters of display instructions A1, A2 and A3 are completely identical. Therefore, display instructions A1 and A2 can be deleted. Finally, the display instructions in the display instruction set include B2, A3 and C1.

[0107] The deduplication operation may further include: deleting a second display instruction from all display instructions received in the LateUpdate phase; the second display instruction is a display instruction having a third display instruction that exists after the second display instruction; the third display instruction is a display instruction whose region information covers the region information of the second display instruction, and the third display instruction is configured to instruct to clear all display layer objects in the region information of the third display instruction, or is a display instruction configured to form an opaque overlay in the region information of the third display instruction.

[0108] Exemplarily, all the display instructions received in the LateUpdate phase include: B2 and C1. The time sequence order between B2 and C1 is B2'<C1', where B2' represents the generation time of display instruction B2, and C1' represents the generation time of display instruction C1. The display instruction C1 is configured to instruct to clear all display layer objects in the region information of display instruction C1. The region information in display instruction C1 covers the region information of display instruction B2. Then, display instruction B2 is the second display instruction, and display instruction C1 is the third display instruction.

[0109] The aforementioned second display instruction can be understood as a display instruction having a third display instruction that exists after its own time sequence.

[0110] In conjunction with Figure 5 the illustrated schematic diagram of the screen display, the screen includes a plurality of display layer objects, which correspond to the white boxes in the figure, the uppermost box is transparent and can reveal the display layer objects covered by it, therefore, Figure 5 what is shown is a scenario of forming a transparent overlay. Conversely, forming an opaque overlay means that the user cannot see any content related to the display layer object instructed to be rendered by the second display instruction through the displayed content. In the embodiments of the present application, the transparency of the display layer object can be adjusted to achieve the effects of a transparent overlay, a fuzzy overlay or an opaque overlay.

[0111] Step S402: In response to the completion of the last display instruction in the display instruction set, render all tile areas.

[0112] In this embodiment of the application, the current rendering mode of the screen can be determined; the current rendering mode is either pixel rendering mode or vector rendering mode; and all tile areas are rendered according to the current rendering mode.

[0113] In one optional implementation of this application embodiment, if the current rendering mode is pixel rendering mode, all tile areas can be rendered in the following manner: rasterize all display layer objects in all tile areas into pixel data; write the pixel data into a low-resolution pixel buffer texture; the resolution of the low-resolution pixel buffer texture is consistent with the resolution of the OLED (Organic Light-Emitting Display) hardware; enlarge the low-resolution pixel buffer texture with the written pixel data by a preset factor using a nearest neighbor sampling algorithm and fill the virtual screen; the preset factor is determined by the ratio between the resolution of the virtual screen and the resolution of the OLED hardware.

[0114] When the screen is a virtual screen, display instructions can be generated through code written by the user in the virtual environment. Furthermore, the coordinate system used by the user when writing the code can be a logical coordinate system, which can be determined based on the resolution of the OLED hardware.

[0115] For example, if the OLED hardware resolution is 160×128 pixels, the logical coordinate system can be set with a width of 160 logical units and a height of 128 logical units. The origin of the logical coordinate system is the top-left corner of the virtual screen, the positive x-axis points to the right, and the positive y-axis points downwards. In this way, the logical coordinate system is perfectly aligned with the OLED hardware resolution, allowing coordinate parameters written by the user in the virtual environment to be directly ported to the real hardware code without any modification.

[0116] During the rendering process, because the physics engine requires a high physical resolution to ensure display clarity, the mapping relationship between the physical coordinate system and the logical coordinate system of the physics engine can be set. For example, the width of the physical coordinate system can be set to 1600 pixels, the height of the physical coordinate system can be set to 1280 pixels, the origin of the physical coordinate system can be the upper left corner of the virtual screen, the positive direction of the x-axis is to the right, and the positive direction of the y-axis is upward.

[0117] Correspondingly, the mapping relationship between the logical coordinate system and the physical coordinate system is: physical X coordinate = logical X coordinate × X-axis scaling factor; physical Y coordinate = -logical Y coordinate × Y-axis scaling factor.

[0118] Wherein, the X-axis scaling factor = physical width / logical width = 1600 / 160 = 10; the Y-axis scaling factor = physical height / logical height = 1280 / 128 = 10.

[0119] Since the y-axis of the logical coordinate system is positive downwards and the y-axis of the physical coordinate system is positive upwards, during the rendering process, when converting position information from the logical coordinate system to the physical coordinate system, it is necessary to perform y-axis inversion processing, that is, take the negative value of the logical Y coordinate and multiply it by the Y-axis scaling factor to obtain the physical Y coordinate.

[0120] For example, when a user specifies the position (10, 20) in the logical coordinate system, the physical X coordinate = 10 × 10 = 100, and the physical Y coordinate = -20 × 10 = -200. That is, the position information (10, 20) in the logical coordinate system is converted to the physical coordinate system, and the corresponding position information obtained is (100, -200).

[0121] In one optional implementation of this application embodiment, if the current rendering mode is vector rendering mode, all tile areas can be rendered in the following manner: For text elements in all display layer objects across all tile regions, render using a text component; in the Unity engine, the text component can be a TextMeshPro component.

[0122] For example, a pre-generated TMP_FontAsset and Distance Field material can be assigned to the TextMeshPro component. During rendering, TextMeshPro samples the SDF font atlas based on the UV coordinates of the character mesh, and the Distance Field Shader calculates the character edge transparency based on the sampled distance values, thereby maintaining clear text edges at different scaling ratios.

[0123] For image elements in all display layer objects across all tile areas, render using the image component. In the Unity engine, the image component can be a Unity Image component.

[0124] Step S403: If the preset mode switching conditions are met, render all tile areas according to the first rendering mode; the first rendering mode is a rendering mode that is different from the current rendering mode between pixel rendering mode and vector rendering mode.

[0125] In this embodiment of the application, the mode switching conditions may include: The distance between the camera and the virtual screen switches from a first preset distance threshold range to a second preset distance threshold range, or vice versa; the rendering mode corresponding to the first preset distance threshold range is vector rendering mode; the rendering mode corresponding to the second preset distance threshold range is pixel rendering mode; the maximum value in the first preset distance threshold range is less than or equal to the minimum value in the second preset distance threshold range. The screen display method provided in this application can run in a 3D scene of a game engine. The virtual screen represents a World Space Canvas object in the 3D scene. The camera represents the user's viewing perspective in the 3D scene. The user can zoom, rotate, and pan the camera using mouse touch operations to observe the virtual screen from different angles and distances. The distance between the camera and the virtual screen directly reflects the user's current viewing distance; a close distance is equivalent to looking closely at the details of the virtual screen, while a far distance is equivalent to viewing the overall presentation of the virtual screen from a distance.

[0126] or, The processor's rendering frame rate switches from a first frame rate to a second frame rate, or vice versa; where the second frame rate is less than a preset frame rate threshold, and the first frame rate is greater than the preset frame rate threshold; the rendering mode corresponding to the second frame rate is pixel rendering mode, and the rendering mode corresponding to the first frame rate is vector rendering mode. Since vector rendering mode has higher requirements for real-time calculation and frame generation frequency (requiring the first frame rate), while pixel rendering mode has relatively lower performance load (requiring the second frame rate), the above implementation switches the rendering mode by limiting the processor's rendering frame rate to switch from the first frame rate to the second frame rate, or vice versa. This effectively avoids screen tearing, frame drops, and stuttering caused by mismatched rendering frame rates.

[0127] For example, in a programming teaching scenario, if a user needs to conduct a teaching demonstration, they can send a vector mode rendering command to the processor, triggering the processor to render in vector mode, thus ensuring good text readability. Alternatively, the user can send a pixel mode rendering command to the processor, triggering the processor to render in pixel mode, which makes the text displayed on the screen highly similar to the dot matrix fonts displayed by OLED hardware.

[0128] The screen display method provided in this application renders all tile areas uniformly in response to the completion of the last display instruction in the display instruction set. This allows for batch processing of display instructions when there are a large number of instructions, and enables the rendering of the entire screen in a single or very few rendering passes, thus saving resources.

[0129] Example 3 Combination Figure 6 The flowchart shown illustrates a screen rendering method. This application embodiment provides a screen rendering method that may include the following steps: Step S601: Obtain scene information.

[0130] Step S602: Determine the current rendering mode of the screen based on the scene information; the current rendering mode is either pixel rendering mode or vector rendering mode.

[0131] Step S603: Render the image according to the current rendering mode.

[0132] In one optional implementation of this application embodiment, the screen is a virtual screen, and the scene information may include the distance between the camera and the virtual screen. Correspondingly, if the distance between the camera and the virtual screen is within a first preset distance threshold range, the current rendering mode of the screen is determined to be vector rendering mode; or, if the distance between the camera and the virtual screen is within a second preset distance threshold range, the current rendering mode of the screen is determined to be pixel rendering mode; the maximum value in the first preset distance threshold range is less than or equal to the minimum value in the second preset distance threshold range.

[0133] In one optional implementation of this application's embodiments, the scene information may include the processor's rendering frame rate. Correspondingly, if the processor's rendering frame rate is lower than a preset frame rate threshold, the current rendering mode of the screen is determined to be pixel rendering mode. Alternatively, if the processor's rendering frame rate is greater than or equal to the preset frame rate threshold, the current rendering mode of the screen is determined to be vector rendering mode.

[0134] In an optional implementation of this application's embodiments, even if the processor's rendering frame rate is greater than or equal to a preset frame rate threshold, but the distance between the camera and the virtual screen is within a second preset distance threshold range, it can still be determined that the screen's current rendering mode is pixel rendering mode. Alternatively; Even if the distance between the camera and the virtual screen is within the second preset distance threshold range, if the processor rendering frame rate is lower than the preset frame rate threshold, it can be determined that the current rendering mode of the screen is pixel rendering mode.

[0135] The screen rendering method provided in this application obtains scene information and determines the current rendering mode of the screen based on the scene information. In this way, the screen can be rendered according to the current rendering mode corresponding to the scene information, thereby meeting the user's different display needs for the screen.

[0136] Example 4 Based on the above embodiments, this application provides further illustrative examples of this application: In the field of programming education, virtual hardware simulation systems have become an important teaching tool. These systems allow students to control virtual devices by writing code, thus learning programming skills without touching expensive physical hardware.

[0137] In this embodiment, the coordinates in the user-written code can be positioned using a logical coordinate system, the resolution of which is the same as the resolution of the actual OLED hardware. The resolution of the physical coordinate system is an integer multiple of the logical coordinate system, i.e., a preset multiple. The physical coordinate system is the internal coordinate system used during screen rendering, for the positioning and rendering of actual UI (User Interface Elements) elements, ensuring clear display on a high-resolution screen. Furthermore, the resolution of the physical coordinate system is usually higher than that of the logical coordinate system. When display instructions are generated through user-written code, the coordinates in the display instructions are also positioned using a logical coordinate system. During subsequent rendering, the processor can convert the coordinates positioned in the logical coordinate system in the display instructions to the physical coordinate system for rendering, according to the preset multiple.

[0138] For example, if the OLED hardware uses a resolution of 160×128 pixels.

[0139] The parameters of the logical coordinate system can be set as follows: width: 160 logical units; height: 128 logical units; origin: top left corner; positive X-axis direction: right; positive Y-axis direction: down; The parameters of the physical coordinate system can be set as follows: width: 1600 pixels; height: 1280 pixels; origin: top left corner; positive X-axis direction: right; positive Y-axis direction: down.

[0140] The scaling factor can be calculated as follows: X-axis scaling factor = physical width / logical width = 1600 / 160 = 10; Y-axis scaling factor = physical height / logical height = 1280 / 128 = 10.

[0141] The coordinate transformation formulas are: Physical X coordinate = Logical X coordinate × X-axis scaling factor; Physical Y coordinate = Logical Y coordinate × Y-axis scaling factor.

[0142] Because OLED hardware inherits the display tradition of embedded devices, the Y-axis is positive downwards; while the Y-axis of the game engine UI coordinate system is positive upwards. During coordinate transformation, the Y-axis needs to be reversed: the physical Y-coordinate is taken as negative and then assigned to the anchor position of the UI element's anchoredPosition property, that is, anchoredPosition is set to (physical X coordinate, negative physical Y coordinate).

[0143] For example, when the user specifies logical coordinates (10, 20): physical X coordinate = 10 × 10 = 100; physical Y coordinate = 20 × 10 = 200; anchoredPosition = (100, -200).

[0144] Since coordinate system transformation only requires integer multiplication, there is no loss of floating-point precision or sub-pixel offset issues. Each logical pixel in the logical coordinate system precisely corresponds to an integer-sized pixel block in the physical coordinate system, preventing pixel boundary blurring or alignment misalignment. Therefore, the logical coordinate parameters used in student code can be seamlessly transferred to real OLED hardware without any coordinate conversion.

[0145] Step 1: Users can write code based on the logical coordinate system in the virtual hardware system to generate hardware code.

[0146] Step 2: The CPU (Central Processing Unit) can generate display instructions based on hardware code and store the display instructions in the first instruction storage area.

[0147] For example, the CPU can convert the display interface (such as text display, image display, screen clearing) called by the hardware code into display instructions, and store the converted display instructions in the first instruction storage area without executing them immediately.

[0148] Display instructions can include: instruction type, display parameters, commit sequence, and calling context. Instruction types include, but are not limited to, text, image, clear screen, and setting screen background color. Display parameters include, but are not limited to, coordinates, display content, display color, and display font size. The commit sequence indicates the commit order of the instruction within the current frame. The calling context indicates the line number of the code that committed the display instruction.

[0149] Step 3: In the LateUpdate stage before each frame is rendered by the GPU (Graphics Processing Unit), the CPU can retrieve all display instructions from the first instruction storage area and perform deduplication on all retrieved display instructions to obtain the display instruction set.

[0150] For example, if there are two display instructions with the same instruction type and display parameters, such as U1 and U2, and U1 was submitted earlier than U2, then display instruction U2 is retained and display instruction U1 is deleted.

[0151] If display instructions U3 and U4 are present in the obtained display instructions, and display instruction U3 is used to instruct the clearing of all display layer objects in the region information of display instruction U3, or to instruct the formation of an opaque overlay in the region information of display instruction U3, and display instruction U4 was submitted earlier than U3, and the region information of display instruction U3 overwrites the region information of display instruction U4, then display instruction U3 is retained and display instruction U4 is deleted.

[0152] Step 4: Process each display instruction in the display instruction set using the display layer object processing method described above.

[0153] Since the display layer object processing method depends on the storage of all created display layer objects, this application defines a storage structure for all created display layer objects before describing the specific process steps of the display layer object processing method.

[0154] In this embodiment, a doubly linked list is used to store all created display layer objects. The head of the list contains the least recently used objects, and the tail contains the most recently used objects. A forward hash table is used to store the mapping between content addressing keys and display layer objects, supporting lookup operations. A reverse hash table is used to store the reverse mapping between display layer objects and content addressing keys, used to synchronize and clean up the forward hash table when a display layer object is deleted. A maximum object count threshold is set to limit the upper limit of the number of stored display layer objects; exceeding this threshold triggers a display layer object cleanup operation. The maximum object count threshold is configurable, with a default value of 20.

[0155] Furthermore, since the display instructions typically only affect a portion of the screen, while the content of the remaining areas remains unchanged, identifying areas where the content remains constant can significantly reduce the amount of updates per frame. Therefore, to identify these unchanging areas, this embodiment of the application uniformly divides the virtual screen into M columns × N rows of tile regions in a logical coordinate system, with each tile region covering a fixed-size logical coordinate area. For example, with a 160×128 resolution, it can be divided into 8 columns × 8 rows, with each tile region covering 20×16 logical units. The tile region division parameters (M, N) are configurable to adapt to OLED hardware of different resolutions.

[0156] Each tile region maintains a content digest value, also known as a second hash value. This content digest value is calculated from the content address keys of all display layer objects currently existing within that tile region. Specifically, for all display layer objects covering the tile region, their content address keys are arranged in their stacking order (e.g., from bottom to top), and then hashed to obtain a fixed-length digest value. When no display layer object exists within the tile region, its content digest value is a null constant.

[0157] In detail, the display layer object processing method may include the following steps: Step 1: For each display instruction, sort the display parameters in the display instruction according to the preset order corresponding to the type of the display instruction, and obtain the content address key corresponding to the display instruction, i.e., the first identifier.

[0158] When a display instruction contains multiple display parameter fields, a preset separator can be used to separate these fields and the type of the display instruction. For example, the preset separator can be "|", " / ", or ";". For instance, for a text-type display instruction, the content address key order is: TXT|X physical coordinates, Y physical coordinates|Font size in pixels|Color name|Automatic line wrapping flag|Area physical width x Area physical height|Text content. For an image-type display instruction, the content address key order is: IMG|Image name|X physical coordinates, Y physical coordinates|Physical width x Physical height. "|" is used for parameter separation.

[0159] Step 2: Based on the content address key corresponding to the display instruction, perform a lookup operation in the forward hash table.

[0160] Step 3: If a content address key with the same content address key as the display instruction exists in the forward hash table, the search is successful, and proceed to Step 4; if no content address key with the same content address key as the display instruction exists in the forward hash table, the search is unsuccessful, and proceed to Step 9.

[0161] If a match is found, it indicates that the first display layer object to be rendered, as instructed by the display instruction, has been created. Furthermore, the display layer object identical to the first display layer object is moved to the tail of the doubly linked list, indicating that the display layer object identical to the first display layer object in the doubly linked list is the most recently used.

[0162] Step 4: Identify at least one first tile region that intersects with the region information covered by the first display layer object.

[0163] Step 5: Obtain the display layer information of the first tile area and the second hash value of the first tile area.

[0164] Step 6: Adjust the arrangement order of the display layer information of the first tile area to adjust the target second identifier, which is the same as the content addressing key in the arrangement order, to the target position.

[0165] Step 7: Perform a hash calculation on the display layer information of the adjusted first tile area to obtain the first hash value.

[0166] Step 8: Compare the first hash value and the second hash value of the first tile region. If they are the same, the first tile region is a static tile region. If they are different, the first tile region is the target tile region. Then, the second hash value stored in the target tile region can be updated to the first hash value.

[0167] When the display instruction represents a screen clearing operation, the first hash value of the first tile area is a null constant.

[0168] Step 9: Create the first display layer object based on the display instructions.

[0169] Step 5: Once all display instructions have been processed, all tile areas can be rendered. Furthermore, once all display instructions have been processed, all processed display instructions can be cleared, preparing to receive display instructions for the next frame.

[0170] In the embodiments of this application, either vector rendering mode or pixel rendering mode can be used for image rendering.

[0171] When rendering in vector rendering mode, the TextMeshPro component can be used to render text, while image elements are rendered normally using the Unity Image component. Specifically, the TextMeshPro component utilizes directional distance field technology for text rendering. This ensures sharp edges at any scaling ratio, guaranteeing text readability, and making vector rendering mode suitable for scenarios requiring detailed text presentation, such as close-up viewing or educational demonstrations.

[0172] When rendering in pixel rendering mode, text and image content can be rasterized into pixel data. Text rasterization uses bitmap fonts with the same specifications as real OLED hardware (in other words, each character is directly stored as a fixed-size pixel grid, not a curve, but a series of dots) or quantizes the vector font rendering results to ensure visual effects close to real hardware. The `Apply` method of the 2D texture `exture2D` is called to upload the pixel data to the GPU. The resolution of `Texture2D` is consistent with the logical coordinate system and is used as a pixel buffer `PixelBuffer`. The `PixelBuffer` is assigned as a texture to the `RawImage` component covering the entire virtual screen area, and the texture's filtering mode `FilterMode` is set to nearest neighbor sampling. This makes the low-resolution texture appear distinctly pixelated when magnified to the physical resolution, realistically simulating the font appearance of an OLED screen. All independent UI objects in vector rendering mode are hidden, and only the image corresponding to the `PixelBuffer` is displayed.

[0173] Step Six: If the preset mode switching conditions are met, render all the tile areas according to the first rendering mode; The first rendering mode is a rendering mode that is different from the current rendering mode, which is either a pixel rendering mode or a vector rendering mode.

[0174] In this embodiment of the application, the mode switching conditions include: In a 3D scene, when the distance between the camera and the virtual screen changes from less than a first preset threshold to greater than a second preset threshold, and the virtual screen's current rendering mode is pixel rendering, it can switch to vector rendering mode. When the distance between the camera and the virtual screen changes from greater than the second preset threshold to less than the second preset threshold, and the virtual screen's current rendering mode is vector rendering, it switches to pixel rendering mode. The first preset threshold is less than the second preset threshold. If the distance between the camera and the virtual screen changes but remains greater than the first preset threshold and less than the second preset threshold, the current rendering mode can be maintained to avoid frequent switching.

[0175] It can also switch rendering modes in response to user commands to switch rendering modes.

[0176] For example, in a teaching demonstration scenario, if it is necessary to project or enlarge the content of the virtual screen, the user can manually switch to vector rendering mode.

[0177] During the rendering process, full-width Chinese punctuation marks can be replaced with their corresponding half-width ASCII punctuation marks. The display width of full-width characters can be set to equal the current font size in pixels. Full-width characters include CJK (Chinese, Japanese, Korean) characters and full-width symbols. The display width of half-width characters can be set to half the current font size in pixels. Half-width characters include ASCII (American Standard Code for Information Interchange) characters and half-width characters. All widths are summed to obtain the total text width, which is used for centering, right alignment, and other position coordinate calculations.

[0178] In this embodiment of the application, upon completion of processing each display instruction, an operation log for that display instruction can be generated. The operation log may include fields such as the record number of the display instruction, the precise timestamp, the type of the display instruction, the display parameters of the display instruction, the content addressing key, the processing result, the area information in the display instruction, and the location of the calling code.

[0179] The record number is used to uniquely identify the display instruction. The precise timestamp represents the engine runtime when the display instruction was executed, accurate to milliseconds. The processing result represents the processing outcome for the display instruction, including a successful reuse (indicating the presence of the first display layer object to be rendered as instructed by the display instruction in the forward hash table), a failed creation (indicating the absence of the first display layer object to be rendered as instructed by the display instruction in the forward hash table, requiring creation based on the display instruction), or a triggered eviction (indicating the display instruction was deleted during deduplication). The affected area can include the rectangular region (top-left corner coordinates and width / height) affected by this operation in the physical coordinate system. The calling code location can include the filename and line number of the student code that triggered this display operation (if available at runtime).

[0180] In this embodiment, all operation logs can be listed on the UI panel in timeline format. Each log record displays the timestamp of the corresponding display instruction, instruction summary (type + coordinates + content prefix), and cached result icon. For example, green indicates that the display layer object rendered by the display instruction has been reused, yellow indicates that the display layer object rendered by the display instruction has not been created, and red indicates that the display instruction has triggered eviction.

[0181] Correspondingly, users can click on any log record on the timeline, and the virtual screen will return to the state when the display command was executed (achieved by replaying from the beginning of the log to the target record).

[0182] After the display instruction corresponding to the current step is executed, a semi-transparent colored rectangular mask can be overlaid on the virtual screen to cover the area affected by the display instruction. The color code of the mask can be consistent with the cached result icon. In this way, the processing result of the display instruction can be intuitively displayed by overlaying the color.

[0183] This application embodiment also provides a split-screen view, where the left side can display a screenshot of the screen before the current instruction is executed, and the right side can display the screen state after execution. Thus, the visual impact of a single instruction can be intuitively presented through the split-screen view.

[0184] After the display command playback ends, statistical information can be displayed. This information may include: the total number of display commands, cache hit rate, number of evictation triggers, and the display position called most frequently, helping users identify inefficient display operation patterns.

[0185] Example 5 Based on the same inventive concept, this application also provides a display layer object processing device 700. Please refer to [link to relevant documentation]. Figure 7 As shown, Figure 7 It shows the use of Figure 1The illustrated method is a display layer object processing device. It should be understood that the specific functions of device 700 can be found in the description above; to avoid repetition, detailed descriptions are appropriately omitted here. Device 700 includes at least one software function module that can be stored in memory or embedded in the operating system of device 700 in the form of software or firmware. Specifically: See Figure 7 As shown, the device 700 may include: a first acquisition module 701, a first determination module 702, a second acquisition module 703, a second determination module 704, and a first processing module 705. Wherein: The first acquisition module 701 is configured to acquire a first identifier corresponding to a display instruction upon receiving a display instruction; the first identifier is used to identify the first display layer object to be rendered as indicated by the display instruction. The first determination module 702 is configured to determine at least one first tile region that intersects with the region information in the display instruction; the first tile region is a tile region among a plurality of preset tile regions; the plurality of tile regions are obtained by pre-dividing the screen. The second acquisition module 703 is configured to acquire display layer information for each first tile region; the display layer information includes a second identifier belonging to the first tile region; the second identifier is used to identify the second display layer object existing on the first tile region; if the display layer information of any first tile region includes multiple second identifiers, the display layer information also includes the arrangement order of the multiple second identifiers, the order representing the stacking order of the second display layer objects corresponding to the multiple second identifiers. The second determination module 704 is configured to determine the target tile region to be updated from the first tile regions based on the first identifier and the display layer information of each first tile region. The first processing module 705 is configured to place the first display layer object on top of the target tile region.

[0186] In one feasible embodiment of this application, the second determining module 704 is specifically configured to: for each first tile region: determine whether there is a target second identifier in the second identifier of the first tile region that is the same as the first identifier; if there is no target second identifier in the second identifier of the first tile region that is the same as the first identifier, determine that the first tile region is a target tile region; if there is a target second identifier in the second identifier of the first tile region that is the same as the first identifier, and there is only one second identifier in the first tile region, determine that the first tile region is not a target tile region; if there is a target second identifier in the second identifier of the first tile region that is the same as the first identifier, and there are multiple second identifiers in the first tile region, determine whether the target second identifier is located at a target position in the arrangement order corresponding to the first tile region; if the target second identifier is located at a target position in the arrangement order corresponding to the first tile region, determine that the first tile region is not a target tile region; if the target second identifier is not located at a target position in the arrangement order corresponding to the first tile region, determine that the first tile region is a target tile region.

[0187] In one feasible embodiment of this application, the second determining module 704 is specifically configured to: for each first tile region: determine whether there is a target second identifier in the second identifier of the first tile region that is the same as the first identifier; if there is no target second identifier in the second identifier of the first tile region that is the same as the first identifier, determine that the first tile region is a target tile region; if there is a target second identifier in the second identifier of the first tile region that is the same as the first identifier, and there are multiple second identifiers in the first tile region, then adjust the arrangement order in the display layer information of the first tile region to adjust the target second identifier in the arrangement order to the target position; perform hash calculation on the adjusted display layer information of the first tile region to obtain a first hash value; if the first hash value is consistent with the second hash value corresponding to the first tile region, determine that the first tile region is not a target tile region; if the first hash value is inconsistent with the second hash value corresponding to the first tile region, determine that the first tile region is a target tile region; the second hash value corresponding to the first tile region is: a hash value obtained by pre-calculating the hash value of the display layer information of the first tile region before adjustment.

[0188] In one feasible embodiment of this application, the second determining module 704 is specifically configured to: determine whether there is a target third identifier that is the same as the first identifier in the preset display layer object information; the display layer object information includes the correspondence between all created third display layer objects and third identifiers; the third identifier is used to identify the third display layer object; if there is no target third identifier that is the same as the first identifier in the display layer object information, then determine that all first tile areas are target tile areas; if there is a target third identifier that is the same as the first identifier in the display layer object information, then for each first tile area: determine whether there is a target second identifier that is the same as the first identifier in the second identifier of the first tile area.

[0189] In one feasible implementation of the present application, the creation module can also be configured to create a first display layer object based on the display instruction if there is no target third identifier that is the same as the first identifier in the display layer object information; The correspondence between the first display layer object and the first identifier is stored in the display layer object information.

[0190] In one feasible embodiment of this application, the first acquisition module 701 is specifically configured to: sort the display parameters and the type of the display instruction in the display instruction according to a preset order and then encode them to obtain the first identifier corresponding to the display instruction.

[0191] In one feasible embodiment of this application, the first processing module 705 is further configured to: terminate the processing of the display instruction if, based on the first identifier and the display layer information of each first tile area, no target tile area that needs to be updated is determined from the first tile area.

[0192] It should be understood that, for the sake of brevity, some of the content described in Embodiment 1 will not be repeated in this embodiment.

[0193] Example 6: Based on the same inventive concept, this application also provides a screen display device 800. Please refer to [link to relevant documentation]. Figure 8 As shown, Figure 8 It shows the use of Figure 4 The screen display device of the method shown. It should be understood that the specific functions of device 800 can be found in the description above; to avoid repetition, detailed descriptions are appropriately omitted here. Device 800 includes at least one software function module that can be stored in memory or embedded in the operating system of device 800 in the form of software or firmware. Specifically: See Figure 8 As shown, the device 800 may include a second processing module 801 and a first rendering module 802.

[0194] The second processing module 801 is configured to process the display instructions in the preset display instruction set sequentially according to the display layer object processing method of Embodiment 1 above. The first rendering module 802 is configured to render all tile areas in response to the completion of the last display instruction in the display instruction set.

[0195] In one feasible embodiment of this application, the display instructions in the display instruction set are the display instruction set obtained by deduplicating all display instructions received in the later update LateUpdate stage.

[0196] In one feasible implementation of this application, all display commands received during the LateUpdate phase have a temporal order; the deduplication operation includes: Delete the first display instruction from all display instructions received during the LateUpdate phase; the first display instruction is: the non-latest timing target display instruction among multiple target display instructions; multiple target display instructions are display instructions with the same display parameters among all display instructions; And / or, Delete the second display instruction from all display instructions received in the LateUpdate phase; the second display instruction is a display instruction that has a third display instruction following it; the third display instruction is a display instruction whose area information covers the area information of the second display instruction, and the third display instruction is used to indicate clearing all display layer objects in the area information of the third display instruction, or to indicate a display instruction that forms an opaque overlay in the area information of the third display instruction.

[0197] In one feasible embodiment of this application, the first rendering module 802 is specifically configured to: determine the current rendering mode of the screen; the current rendering mode is either pixel rendering mode or vector rendering mode; and render all tile areas according to the current rendering mode.

[0198] In one feasible embodiment of this application, the screen is a virtual screen. When the current rendering mode is pixel rendering mode, the first rendering module 802 is specifically configured to: rasterize all display layer objects in all tile areas into pixel data; write the pixel data into a low-resolution pixel buffer texture; the resolution of the low-resolution pixel buffer texture is consistent with the resolution of the organic light-emitting display (OLED) hardware; enlarge the low-resolution pixel buffer texture with the written pixel data by a preset factor using a nearest neighbor sampling algorithm and fill the virtual screen; the preset factor is determined by the ratio between the resolution of the virtual screen and the resolution of the OLED hardware.

[0199] In one feasible embodiment of this application, the screen is a virtual screen. When the current rendering mode is vector rendering mode, the first rendering module 802 is specifically configured to: render text elements in all display layer objects in all tile areas using a text component; and render image elements in all display layer objects in all tile areas using an image component.

[0200] In one feasible embodiment of this application, the first rendering module 802 may also be configured to: render all tile areas according to the first rendering mode when the preset mode switching conditions are met; the first rendering mode is one of pixel rendering mode and vector rendering mode that is different from the current rendering mode.

[0201] In one feasible embodiment of this application, the screen is a virtual screen, and the mode switching conditions include: the distance between the camera and the virtual screen changes from a first preset distance threshold range to a second preset distance threshold range, or the distance between the camera and the virtual screen changes from the second preset distance threshold range to the first preset distance threshold range; the rendering mode corresponding to the first preset distance threshold range is a vector rendering mode; the rendering mode corresponding to the second preset distance threshold range is a pixel rendering mode; and the maximum value in the first preset distance threshold range is less than or equal to the minimum value in the second preset distance threshold range.

[0202] In one feasible embodiment of this application, the mode switching conditions include: the processor's rendering frame rate switching from a first frame rate to a second frame rate, or the processor's rendering frame rate switching from a second frame rate to a first frame rate; wherein the second frame rate is less than a preset frame rate threshold, and the first frame rate is greater than the preset frame rate threshold; the rendering mode corresponding to the second frame rate is a pixel rendering mode, and the rendering mode corresponding to the first frame rate is a vector rendering mode.

[0203] It should be understood that, for the sake of brevity, some of the content described in Embodiment 2 will not be repeated in this embodiment.

[0204] Example 7 This application also provides a screen rendering apparatus 900. Please refer to... Figure 9 As shown, Figure 9 It shows the use of Figure 6 The illustrated method is a screen rendering apparatus. It should be understood that the specific functions of apparatus 900 are described above; to avoid repetition, detailed descriptions are appropriately omitted here. Apparatus 900 includes at least one software function module that can be stored in memory or embedded in the operating system of apparatus 900 in the form of software or firmware. Specifically: See Figure 9As shown, the device 900 may include: a third acquisition module 901, a third determination module 902, and a second rendering module 903.

[0205] The third acquisition module 901 is configured to acquire scene information; the third determination module 902 is configured to determine the current rendering mode of the screen based on the scene information; the current rendering mode is either pixel rendering mode or vector rendering mode; the second rendering module 903 is configured to render the screen according to the current rendering mode.

[0206] In one feasible embodiment of this application, the third acquisition module 901 may be specifically configured to acquire the distance between the camera and the virtual screen; Correspondingly, the third determining module 902 can be specifically configured to determine the current rendering mode of the screen as vector rendering mode when the distance between the camera and the virtual screen is within the first preset distance threshold range; or; determine the current rendering mode of the screen as pixel rendering mode when the distance between the camera and the virtual screen is within the second preset distance threshold range; the maximum value in the first preset distance threshold range is less than or equal to the minimum value in the second preset distance threshold range.

[0207] In one feasible embodiment of this application, the third acquisition module 901 may be specifically configured to acquire the processor's rendering frame rate; Correspondingly, the third determining module 902 can be specifically configured to determine the current rendering mode of the screen as pixel rendering mode when the processor rendering frame rate is lower than a preset frame rate threshold; or, to determine the current rendering mode of the screen as vector rendering mode when the processor rendering frame rate is greater than or equal to a preset frame rate threshold.

[0208] In one feasible embodiment of this application, the third acquisition module 901 may be specifically configured to acquire the distance between the camera and the virtual screen and the processor's rendering frame rate; Correspondingly, the third determining module 902 can be specifically configured to determine whether the processor's rendering frame rate is lower than a preset frame rate threshold; if the processor's rendering frame rate is lower than the preset frame rate threshold, determine that the current rendering mode of the screen is pixel rendering mode; or; if the processor's rendering frame rate is greater than or equal to the preset frame rate threshold, and the distance between the camera and the virtual screen is within a first preset distance threshold range, determine that the current rendering mode of the screen is vector rendering mode; or; if the processor's rendering frame rate is greater than or equal to the preset frame rate threshold, and the distance between the camera and the virtual screen is within a second preset distance threshold range, determine that the current rendering mode of the screen is pixel rendering mode; the maximum value in the first preset distance threshold range is less than or equal to the minimum value in the second preset distance threshold range.

[0209] It should be understood that, for the sake of brevity, some of the content described in Embodiment 3 will not be repeated in this embodiment.

[0210] This embodiment provides an electronic device, see [link / reference] Figure 10 As shown, it includes a processor 111 and a memory 112. Wherein: The processor 111 is used to execute one or more programs stored in the memory 112 to implement the display layer object processing method of the first embodiment, or the screen display method of the second embodiment, or the screen rendering method of the third embodiment.

[0211] In implementing the display layer object processing method of the above embodiment one, the processor 111 can be a CPU (Central Processing Unit), and the memory 112 can be the CPU main memory.

[0212] In implementing the screen display method of Embodiment 2 above, or the screen rendering method of Embodiment 3 above, the processor 111 can be a GPU (Graphics Processing Unit), and the memory 112 can be GPU video memory.

[0213] Of course, processor 111 can be a processor core or processor chip, or other circuitry capable of program configuration and execution. Memory 112 can be RAM (Random Access Memory), ROM (Read-Only Memory), flash memory, etc., but this is not a limitation.

[0214] It's understandable. Figure 10 The structure shown is for illustrative purposes only; the electronic device may also include components that are more advanced than those shown. Figure 10 The more or fewer components shown, or having the same Figure 10 Different configurations are shown. For example, it may also have an internal communication bus for communication between the processor 111 and the memory 112; or it may have an external communication interface, such as a USB (Universal Serial Bus) interface, a CAN (Controller Area Network) bus interface, etc.; or it may have an information display component such as a display screen, but this is not a limitation.

[0215] This embodiment also provides a computer-readable storage medium, such as a floppy disk, optical disk, hard disk, flash memory, USB flash drive, SD (Secure Digital Memory Card), MMC (Multimedia Card), etc. The computer-readable storage medium stores one or more programs that implement the above steps. These one or more programs can be executed by one or more processors to implement the display layer object processing method of Embodiment 1, or the screen display method of Embodiment 2, or the image rendering method of Embodiment 3. Further details will not be provided here.

[0216] This embodiment also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it performs the display layer object processing method of Embodiment 1, the screen display method of Embodiment 2, or the image rendering method of Embodiment 3. Further details will not be provided here.

[0217] For example, a computer program product may be an installation package or a program package.

[0218] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0219] Furthermore, the units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0220] Furthermore, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0221] In this document, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, without necessarily requiring or implying any such actual relationship or order between these entities or operations.

[0222] In this article, "multiple" refers to two or more.

[0223] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A method for processing display layer objects, characterized in that, include: Upon receiving a display command, obtain the first identifier corresponding to the display command; The first identifier is used to identify the first display layer object to be rendered as indicated by the display instruction; Identify at least one first tile region that intersects with the region information in the display instruction; The first tile region is one of a set of multiple pre-defined tile regions; The multiple tile regions are obtained by pre-dividing the screen; Obtain display layer information for each of the first tile regions; the display layer information includes a second identifier for the first tile region to which it belongs; The second identifier is used to identify the second display layer object present on the first tile area; when the display layer information of any first tile area includes multiple second identifiers, the display layer information also includes the arrangement order among the multiple second identifiers, and the order among the multiple second identifiers represents the stacking order among the second display layer objects corresponding to the multiple second identifiers; Based on the first identifier and the display layer information of each first tile region, the target tile region that needs to be updated is determined from the first tile region; Place the first display layer object on top of the target tile area.

2. The method according to claim 1, characterized in that, Based on the first identifier and the display layer information of each of the first tile regions, the target tile region that needs to be updated is determined from the first tile region, including: For each of the first tile regions: Determine whether there is a target second identifier in the second identifier of the first tile area that is the same as the first identifier; If there is no target second identifier in the second identifier of the first tile area that is the same as the first identifier, the first tile area is determined to be the target tile area; If there is a target second identifier in the second identifier of the first tile area that is the same as the first identifier, and there is only one second identifier in the first tile area, then the first tile area is determined not to be the target tile area; If there is a target second identifier in the second identifier of the first tile area that is the same as the first identifier, and there are multiple second identifiers in the first tile area, then it is determined whether the target second identifier is located at the target position in the arrangement order corresponding to the first tile area; If the target second identifier is located at the target position in the arrangement order corresponding to the first tile area, the first tile area is determined not to be the target tile area; if the target second identifier is not located at the target position in the arrangement order corresponding to the first tile area, the first tile area is determined to be the target tile area.

3. The method according to claim 1, characterized in that, Based on the first identifier and the display layer information of each of the first tile regions, the target tile region that needs to be updated is determined from the first tile region, including: For each of the first tile regions: Determine whether there is a target second identifier in the second identifier of the first tile area that is the same as the first identifier; If there is no target second identifier in the second identifier of the first tile area that is the same as the first identifier, the first tile area is determined to be the target tile area; If there is a target second identifier in the second identifier of the first tile area that is the same as the first identifier, and there are multiple second identifiers in the first tile area, then the arrangement order in the display layer information of the first tile area is adjusted so that the target second identifier in the arrangement order is adjusted to the target position; The adjusted display layer information of the first tile area is hashed to obtain the first hash value; If the first hash value is consistent with the second hash value corresponding to the first tile region, it is determined that the first tile region is not the target tile region; If the first hash value is inconsistent with the second hash value corresponding to the first tile region, the first tile region is determined to be the target tile region; The second hash value corresponding to the first tile area is: the hash value obtained by pre-calculating the display layer information of the first tile area before adjustment.

4. The method according to claim 2 or 3, characterized in that, Before determining, for each of the first tile regions, whether there exists a target second identifier in the second identifier of that first tile region that is identical to the first identifier, the method includes: Determine whether there exists a target third identifier that is identical to the first identifier in the preset display layer object information; the display layer object information includes the correspondence between all created third display layer objects and third identifiers; the third identifier is used to identify the third display layer object; If there is no target third identifier in the display layer object information that is the same as the first identifier, then all the first tile regions are determined to be the target tile regions; If the display layer object information contains a target third identifier that is the same as the first identifier, then for each first tile area: determine whether there is a target second identifier that is the same as the first identifier in the second identifier of the first tile area.

5. The method according to claim 1, characterized in that, The method further includes: If, based on the first identifier and the display layer information of each first tile region, no target tile region needs to be updated from the first tile region, the processing of the display instruction ends.

6. A screen display method, characterized in that, include: The display instructions in the preset display instruction set are processed sequentially according to the display layer object processing method as described in any one of claims 1 to 5. In response to the completion of the last display instruction in the display instruction set, all tile areas are rendered.

7. A method for rendering an image, characterized in that, include: Obtain scene information; The current rendering mode of the screen is determined based on the scene information; The image is rendered according to the current rendering mode.

8. An electronic device, characterized in that, The device includes a processor and a memory, the memory storing computer-executable instructions that can be executed by the processor, the processor executing the computer-executable instructions to implement the display layer object processing method according to any one of claims 1 to 5, or the screen display method according to claim 6, or the screen rendering method according to claim 7.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the display layer object processing method according to any one of claims 1 to 5, or the screen display method according to claim 6, or the screen rendering method according to claim 7.

10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the display layer object processing method according to any one of claims 1 to 5, or the screen display method according to claim 6, or the screen rendering method according to claim 7.