Layer rendering method and device, electronic equipment and storage medium
Through the layer rendering method, the rendering requests of each application are passed to the rendering service using the display request interface, solving the problem of wasting memory resources and smooth interaction between applications caused by the independent setting of the graphics rendering engine for multiple applications, achieving more efficient memory utilization and system fluency.
Patent Information
- Application Number
- CN202411079745.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2024-11-26
AI Technical Summary
In the prior art, multiple applications independently set up a graphics rendering engine, resulting in excessive consumption of memory resources, and the smoothness of interaction and association between applications is difficult to achieve.
Through the layer rendering method, the rendering requests of each application are passed to the rendering service using the display request interface, and the rendering process of each application is uniformly managed, avoiding the individual graphics rendering engine for each application, thereby reducing memory resource consumption and improving system fluency .
It realizes more efficient memory resource utilization and system fluency, reduces memory consumption, and improves the operation efficiency and interactive linkage of layer rendering between multiple applications.
Smart Images

Figure CN119027562A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a layer rendering method, device, electronic device and computer-readable storage medium. Background Art
[0002] At present, graphics rendering engine technology is applied in many aspects, such as game software, drawing tools, etc., which can render graphics that are close to the real three-dimensional space. On the terminal used by the user, multiple applications installed may use the graphics rendering engine. The current common usage method is to set a corresponding graphics rendering engine for each application separately, so that each application is independent of each other, resulting in excessive consumption of memory resources when multiple graphics rendering engines are working. Summary of the invention
[0003] In view of this, in order to solve some or all of the above-mentioned technical problems, the embodiments of the present application provide a layer rendering method, device, electronic device and computer-readable storage medium.
[0004] In a first aspect, an embodiment of the present application provides a layer rendering method, the method comprising: in response to a target application executing a target operation, obtaining a display request corresponding to the target application, wherein the display request is obtained by a display request interface; based on the display request, determining a target layer object and a target graphic resource corresponding to the target application, wherein the target graphic resource is obtained from a preset graphic resource set; and obtaining a rendered target layer according to the target layer object and the target graphic resource.
[0005] In one possible implementation, based on a display request, a target layer object and a target graphic resource corresponding to a target application are determined, including: if the display request is a layer registration request sent after the target application is started, determining the target application identifier and the proxy layer object from the layer registration request; determining the target layer object corresponding to the target application based on the proxy layer object; and determining a graphic resource corresponding to the identifier of the target application as a target graphic resource from a graphic resource collection.
[0006] In one possible implementation, after determining the target layer object corresponding to the target application based on the proxy layer object, the method further includes: saving the proxy layer object into a preset proxy layer object set, and establishing a correspondence between the identifier of the target application and the proxy layer object.
[0007] In a possible implementation, determining a target layer object corresponding to a target application based on the proxy layer object includes: determining an address of the target layer object based on the proxy layer object, and determining the target layer object based on the address.
[0008] In one possible implementation, based on a display request, a target layer object and a target graphic resource corresponding to a target application are determined, including: if the display request is an application switching request sent by the target application, an identifier of the target application is determined from the application switching request; based on the identifier of the target application, a proxy layer object to be switched corresponding to the target application is determined from a preset proxy layer object set; based on the proxy layer object to be switched, a target layer object corresponding to the target application is determined; from a graphic resource set, graphic resources corresponding to the target layer object are obtained as target graphic resources; based on the target layer object and the target graphic resources, a rendered target layer is obtained, including: switching a currently processed layer object to the target layer object, and adding the target graphic resources to the target layer object to obtain a rendered target layer.
[0009] In one possible implementation, based on the display request, determining the target layer object and the target graphic resource corresponding to the target application, further comprising: if the display request is an application switching request sent by the target application, displaying a preset transition animation; obtaining the rendered target layer according to the target layer object and the target graphic resource, further comprising: in response to obtaining the target layer, stopping displaying the transition animation.
[0010] In a second aspect, an embodiment of the present application provides a layer rendering device, which includes: an application module, which is used to respond to the target application executing the target operation, obtain a display request corresponding to the target application, and send the display request to the service module from the display request interface; a service module, which is used to determine the target layer object and target graphic resources corresponding to the target application based on the display request, wherein the target graphic resources are obtained from a preset graphic resource set; and obtain a rendered target layer based on the target layer object and the target graphic resources.
[0011] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory for storing a computer program; a processor for executing the computer program stored in the memory, and when the computer program is executed, a method of any embodiment of the layer rendering method of the first aspect of the present application is implemented.
[0012] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, a method as in any embodiment of the layer rendering method of the first aspect described above is implemented.
[0013] In a fifth aspect, an embodiment of the present application provides a computer program, which includes a computer-readable code. When the computer-readable code runs on a device, the processor in the device implements a method as in any embodiment of the layer rendering method of the first aspect above.
[0014] The layer rendering method, device, electronic device and computer-readable storage medium provided in the embodiments of the present application respond to the target operation of the target application, obtain the display request corresponding to the target application from the display request interface, determine the target layer object and target graphic resources corresponding to the target application based on the display request, and finally obtain the rendered target layer according to the target layer object and the target graphic resources. The embodiments of the present application separate the graphics rendering engine from each application, transmit the display request of each application through the display interface, and the rendering service processes the layer rendering process of each application according to the display request, without setting up a separate graphics rendering engine for each application, thereby reducing the memory resource consumption of the entire system and improving the system fluency. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0017] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0018] Figure 1 A schematic diagram of the relationship between various applications in an existing vehicle cockpit system;
[0019] Figure 2 A schematic diagram of a process flow of a layer rendering method provided in an embodiment of the present application;
[0020] Figure 3 A schematic diagram of a process flow of another layer rendering method provided in an embodiment of the present application;
[0021] Figure 4 A system architecture diagram for the method provided in the embodiment of the present application;
[0022] Figure 5 A flowchart of another layer rendering method provided in an embodiment of the present application;
[0023] Figure 6 A flowchart of another layer rendering method provided in an embodiment of the present application;
[0024] Fig. 7A A schematic diagram of switching layers provided in an embodiment of the present application;
[0025] Figure 7B A schematic diagram of another switching layer provided in an embodiment of the present application;
[0026] Figure 8 A schematic diagram of the structure of a layer rendering device provided in an embodiment of the present application;
[0027] Fig. 9 A schematic diagram of a cross-process transfer registration request provided in an embodiment of the present application;
[0028] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. It should be noted that unless otherwise specifically stated, the relative arrangement of the components and steps, the numerical expressions and the numerical values described in these embodiments do not limit the scope of the present application.
[0030] Those skilled in the art will understand that the terms "first" and "second" in the embodiments of the present application are only used to distinguish between different steps, devices, modules and other objects, and do not represent any specific technical meanings, nor do they indicate the logical order between them.
[0031] It should also be understood that in this embodiment, “plurality” may refer to two or more than two, and “at least one” may refer to one, two or more than two.
[0032] It should also be understood that any component, data or structure mentioned in the embodiments of the present application can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.
[0033] In addition, the term "and / or" in this application is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this application generally indicates that the associated objects before and after are in an "or" relationship.
[0034] It should also be understood that the description of the various embodiments in this application focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.
[0035] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present application, its application, or uses.
[0036] Technologies, circuits, and devices known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the above-mentioned technologies, circuits, and devices should be considered as part of the specification.
[0037] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0038] It should be noted that, in the absence of conflict, the embodiments in this application and the features in the embodiments can be combined with each other. To facilitate the understanding of the embodiments of the present application, the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0039] In existing systems, multiple applications are installed, each of which is independent of each other. Each application contains a separate graphics rendering engine and uses corresponding resources to render the layer. Figure 1 As shown in the figure, in the cockpit system of the vehicle, each application is independent of each other and contains a different graphics rendering engine. However, the commonly used graphics rendering engines (such as the Unity engine) require very high memory when running. Each application creates an independent engine, which consumes a lot of the overall memory resources of the system. The more applications there are, the more serious the waste of memory resources. On the other hand, each application has strong interactivity and correlation. The traditional design architecture based on the graphics rendering engine has great difficulty in meeting the smoothness of interaction and correlation between applications.
[0040] In order to solve the technical problem in the prior art that different applications set up separate graphics rendering engines, resulting in large memory resource consumption, the present application provides a layer rendering method, which can uniformly manage the rendering process of each application by a rendering service, thereby reducing the consumption of memory resources.
[0041] Figure 2A flow chart of a layer rendering method provided for an embodiment of the present application. This method can be applied to one or more electronic devices such as vehicles, smart phones, laptops, desktop computers, portable computers, servers, etc., which can run multiple applications and render the layers of these applications. In addition, the execution subject of this method can be hardware or software. When the above-mentioned execution subject is hardware, the execution subject can be one or more of the above-mentioned electronic devices. For example, a single electronic device can execute this method, or multiple electronic devices can cooperate with each other to execute this method. When the above-mentioned execution subject is software, this method can be implemented as multiple software or software modules, or as a single software or software module. It is not specifically limited here.
[0042] like Figure 2 As shown, the method specifically includes:
[0043] Step 201: In response to a target application executing a target operation, a display request corresponding to the target application is obtained.
[0044] The display request is obtained by a display request interface. The display request interface may be a software interface for transmitting requests between at least one application and an underlying service of an electronic device. When the target application performs a target operation, the target application automatically generates a display request, sends the display request to the underlying service through the display request interface, and calls a graphics rendering function of the underlying service.
[0045] In some embodiments, the target application may be any one of a plurality of applications installed on the electronic device that require graphics rendering. For example, the target application may be any one of the vehicle control applications, air conditioning applications, 3D desktop applications, etc. included in the cockpit system of the vehicle. The target operation may be an operation performed when the target application needs to display graphics on the screen. As an example, the target operation may include, but is not limited to, at least one of the following: first startup, switching to the target application from other references, switching display screens in the target application, and other operations.
[0046] Step 202: Based on the display request, determine the target layer object and the target graphic resource corresponding to the target application.
[0047] The target graphic resource may be obtained from a preset graphic resource set.
[0048] In some embodiments, the target layer object is the object operated by rendering the data of the layer when displaying the layer of the target application. By operating the target layer object, the screen of the target application can be displayed on the screen. The target layer object can be established by the target application calling the layer drawing tool. After the target application is started, the target layer object can be created through tools such as SurfaceView and TextureView, and the address and other information of the target layer object can be recorded. The above display request can include information such as the address of the target layer object, so that the underlying service can determine the target layer object.
[0049] The above-mentioned graphic resource collection is used to store the graphic display resources required by each application, such as 3D models, pictures, animations and other resources. The type of graphic resources corresponds to the type of the target application. For example, if the target type is air conditioning, the graphic resources may include a 3D model, picture, and blowing animation of the air conditioning. For another example, the blowing animation may include display icons for displaying cold, hot, dehumidification, customs and temperature. Based on the correspondence between the graphic resources and the applications, the electronic device can determine the target graphic resources used to operate the target layer object.
[0050] Step 203, obtaining a rendered target layer according to the target layer object and the target graphic resource.
[0051] In some embodiments, the electronic device can perform rendering operations on the target graphic resources in the display area corresponding to the target layer object, that is, fill the rendering data included in the target graphic resources into the target layer object, so that the target graphic resources are displayed on the target layer corresponding to the target application, and use a graphical system (such as an Android graphical system) to display the screen of the target layer.
[0052] The layer rendering method provided in the embodiment of the present application responds to the target operation of the target application, obtains the display request corresponding to the target application from the display request interface, determines the target layer object and the target graphic resource corresponding to the target application based on the display request, and finally obtains the rendered target layer according to the target layer object and the target graphic resource. The embodiment of the present application separates the graphics rendering engine from each application, transmits the display request of each application through the display interface, and processes the layer rendering process of each application by the rendering service according to the display request, without setting up a graphics rendering engine for each application separately, thereby reducing the memory resource consumption of the entire system and improving the system fluency.
[0053] When a graphics rendering engine is used to render the target layer of a target application, the embodiment of the present application realizes that only one graphics rendering engine needs to be created, and the display request is transmitted between each application and the underlying service through the display request interface. The underlying service only needs to call a graphics rendering engine to render the layer of the target application that currently needs to be displayed, and display the layer of the target application on the screen. Each application does not need to create a separate graphics rendering engine. The traditional method assumes that there are N applications, then N graphics rendering engines need to be created, and each graphics rendering engine needs to consume the system's memory and CPU resources. In terms of memory consumption, since each graphics rendering engine needs to consume memory resident, and the embodiment of the present application has only one engine consuming memory, the memory saving rate of the embodiment of the present application can reach (N-1) / N. In terms of CPU consumption, it is not necessary for each application to run a graphics rendering engine, so more CPU resources can be saved, thereby making the system running smoother when the present method is applied.
[0054] In some optional implementations, such as Figure 3 As shown, step 202 includes:
[0055] Step 2021, if the display request is a layer registration request sent after the target application is started, determine the identifier and proxy layer object of the target application from the layer registration request.
[0056] Among them, the layer registration request is sent for the first time after the target application is started, that is, after the target application is started, it needs to display the corresponding target layer on the screen. At this time, a layer registration request needs to be sent to establish a corresponding relationship between the graphic resources and the target layer. In some embodiments, after the target application is started, the target application can create a target layer object, which can be passed to the rendering service included in the underlying service by means of a proxy object. For example, the target application can create objects of SurfaceView and TextureView types to display 3D images. At this time, the created object can be added to the interface provided by the rendering service in the form of a proxy layer object: registerSurface(pkgName, surface). This interface is the display request interface. Among them, pkgName is the identifier of the target application, and surface is the proxy layer object. The program running this interface can generate a layer registration request and send the layer registration request to the rendering service. The method for creating a registered proxy layer object can be implemented using relevant proxy object technology in the field.
[0057] Step 2022: Determine the target layer object corresponding to the target application based on the proxy layer object.
[0058] The proxy layer object includes the address of the target layer object. Based on the address, the real target layer object can be operated by operating the proxy layer object.
[0059] Step 2023: Determine, from the graphic resource set, a graphic resource corresponding to the identifier of the target application as a target graphic resource.
[0060] like Figure 4 As shown, it shows a system architecture diagram applied by the method provided in this embodiment, and the architecture diagram is applied in the cockpit system of a vehicle. The cockpit system includes multiple client applications and underlying rendering services. Client applications include vehicle control, air conditioning, 3D desktop and other applications, and each application can create a corresponding layer when it is started. For one of the applications, the application can be used as the target application described in this method. The target application sends a layer registration request to the rendering service. The rendering service can operate the proxy layer object corresponding to each application, and then operate the real target layer object. Call the target graphics resource corresponding to the target application, run the graphics rendering engine, fill the target graphics resource into the target layer object, and realize the rendering of the target layer of the target application.
[0061] This embodiment creates a proxy layer object after the target application is started, and sends the proxy layer object and the identifier of the target application to the underlying service, thereby registering the layer rendering operation of the target application, that is, establishing a correspondence between the target graphic resource and the target layer of the target application. By operating the proxy layer object, the layers of each application are rendered, which can more conveniently realize the interactive linkage between each application, thereby improving the operational efficiency of rendering the layers of multiple applications.
[0062] In some optional implementations, such as Figure 5 As shown, after step 2022, the method further includes:
[0063] Step 2024, save the proxy layer object into a preset proxy layer object set, and establish a corresponding relationship between the identifier of the target application and the proxy layer object.
[0064] As an example, Figure 4 As shown, the rendering service can save the proxy layer objects sent by each application and establish a one-to-one correspondence, thereby completing the registration of the target application's layer. For example, the data structure in the proxy layer object collection is [com.sample.settings, surface], where com.sample.settings is the identifier of the vehicle control application and surface is the corresponding proxy layer object.
[0065] This embodiment saves the proxy layer object of the target application into the proxy layer object collection, thereby achieving unified processing of the proxy layer objects of multiple applications, and improving the stability and efficiency of rendering the layers of different applications. In addition, when responding to the display request of the target application later, the target layer object and the target graphic resource of the target application can be quickly located, thereby improving the efficiency of rendering the target layer. For example, the screen display of two applications has mutually exclusive requirements, that is, only the layer of one application can be displayed at the same time, then it is only necessary to control the rendering / non-rendering status of the two layers. The traditional rendering method needs to spend a large cost to synchronize the display status of the layer between the two applications, which is inefficient and there is a possibility of synchronization failure, and the convenience and stability are not as good as the embodiment of the present application.
[0066] In some optional implementations, the above step 2022 may be performed as follows:
[0067] Based on the proxy layer object, the address of the target layer object is determined, and based on the address, the target layer object is determined.
[0068] The proxy layer object may include the address of the target layer object. By operating the proxy layer object, the real target layer object can be operated.
[0069] This embodiment realizes the association between the proxy layer object and the actual target layer object by determining the address of the target layer object. By operating the proxy layer object, the target layer object can be indirectly operated, which helps to improve the efficiency of rendering the target layer.
[0070] In some optional implementations, such as Figure 6 As shown, step 202 includes:
[0071] Step 2025: If the display request is an application switching request sent by the target application, determine the identifier of the target application from the application switching request.
[0072] Specifically, the application switching request may be generated by the user through operating the application display interface. For example, the user switches between applications by clicking on the icons of other applications, and generates an application switching request at the same time. The application switching request may be sent to the rendering service included in the underlying service through the display request interface, and the rendering service extracts the identifier of the target application from the switching request.
[0073] It should be noted that the display request interface for receiving the application switching request in this step may be the same interface as the interface for receiving the layer registration request in the above embodiment, or may be a different interface. For example, the display request interface may include a layer registration interface and a layer switching interface, the layer registration request is sent to the rendering service through the layer registration interface, and the application switching request is sent to the rendering service through the layer switching interface.
[0074] Step 2026: Based on the identifier of the target application, determine the proxy layer object to be switched corresponding to the target application from the preset proxy layer object set.
[0075] Step 2027: Determine the target layer object corresponding to the target application based on the proxy layer object to be switched.
[0076] This step is basically the same as the method for determining the target layer object in the above step 202, and will not be repeated here.
[0077] Step 2028: Obtain the graphic resource corresponding to the target layer object from the graphic resource collection as the target graphic resource.
[0078] Step 203 includes:
[0079] Step 2031, switching the currently processed layer object to the target layer object, and adding the target graphic resources to the target layer object to obtain the rendered target layer.
[0080] In some embodiments, the graphics rendering engine included in the rendering service can be called and the image rendering engine can be controlled to switch the layer object being processed. The graphics rendering engine can stop filling data into the currently processed layer object and add data to the switched target layer object, thereby switching the display between different layers.
[0081] As an example, in the smart cockpit system, there is a need for seamless transitions between two layers. Seamless transition means that when jumping between two applications, the screen rendering cannot be stopped or split, and must be continuous and smooth. When it is necessary to switch from the air-conditioning application to the vehicle control application, the corresponding screen is switched from the interior screen of the air-conditioning application to the exterior screen of the vehicle control application, with a transition animation in the middle to achieve a one-shot effect. The traditional layer rendering method, because the two applications use their own graphics rendering engines respectively, and the graphics rendering engines are independent of each other and cannot be aligned with the timeline, will inevitably cause screen interruptions when switching between the two engines, and the effect of seamless switching cannot be achieved.
[0082] However, this solution does not require setting up a different graphics rendering engine for each application, and there is no need to align the timeline when switching layers. The layer switching can be completed within the time of rendering a frame of the picture (16ms), and the human eye cannot see the interruption phenomenon. The time required for layer switching in the embodiment of the present application is usually much less than 16ms, so the needs of seamless transition and one-shot can be achieved.
[0083] like Fig. 7A As shown, the graphics rendering engine renders the layers of different applications. If the layer currently being rendered is the layer corresponding to the air-conditioning application, the corresponding proxy layer object is [com.sample.havc, surface]. When an application switching request is received, the application switching request indicates that the currently rendered layer is switched to the layer of the vehicle control application, that is, the corresponding target proxy layer object is [com.sample.settings, surface]. At this time, it is only necessary to stop filling data into the layer object corresponding to [com.sample.havc, surface] and instead fill data into the layer object corresponding to [com.sample.settings, surface]. The graphics rendering engine does not need to be interrupted, so that the display screen will not be paused or interrupted, showing a seamless switching effect.
[0084] This embodiment directly switches the proxy layer object by receiving an application switching request, thereby achieving fast switching of the rendered layer without interrupting the rendering operation, thereby improving the smoothness of application layer switching.
[0085] In some optional implementations, in step 202, if the display request is an application switching request sent by the target application, the following steps may also be performed:
[0086] First, display the preset transition animation.
[0087] In some embodiments, the transition animation may be executed by the above-mentioned graphics rendering engine, that is, when an application switching request is received, the graphics rendering engine may be controlled to stop rendering the current layer and instead render the transition animation.
[0088] Then, in response to obtaining the target layer, the transition animation is stopped from being displayed.
[0089] That is, after the currently displayed layer is switched to the target layer of the target application, the rendering of the transition animation is stopped and the target layer is rendered instead. Figure 7BAs shown in the figure, after receiving the application switching request, the rendering service can control the graphics rendering engine to stop rendering the target layer object and render the transition animation instead. At the same time, the proxy layer object processed by the engine is switched from the proxy layer object [com.sample.havc,surface] corresponding to the air-conditioning application to the proxy layer object [com.sample.settings,surface] corresponding to the vehicle control application. After the transition animation is displayed, the layer of the vehicle control application can be rendered immediately based on [com.sample.settings,surface] to achieve a seamless switching effect.
[0090] This embodiment can further visually eliminate the pause caused by switching between layers of different applications by setting the transition animation, making the screen display smoother.
[0091] Figure 8 A schematic diagram of the structure of a layer rendering device provided in an embodiment of the present application. Specifically comprising:
[0092] The application module 801 is used to obtain a display request corresponding to the target application in response to the target application executing the target operation, and send the display request to the service module through the display request interface.
[0093] Service module 802 is used to determine the target layer object and target graphic resources corresponding to the target application based on the display request, wherein the target graphic resources are obtained from a preset graphic resource set; and obtain the rendered target layer according to the target layer object and the target graphic resources.
[0094] In some embodiments, the device is configured with a service module and an application module, wherein the application module includes multiple applications, and the service layer includes multiple sub-modules for driving target applications, mobilizing computing power, and data processing. In a common software architecture, the software architecture can be divided into an application layer and a service layer according to the function. Therefore, the above-mentioned service module can also be called a service layer, and the application module can also be called an application layer.
[0095] The application layer and the service layer can communicate with each other through an interface. In this embodiment, the application module may include a display request interface, through which the target application can send a display request to the service layer.
[0096] The service layer may include various types of services, such as a rendering service, which is a software module on the device configured to configure interfaces and respond to display requests of various applications, determine target layer objects and target graphic resources, and perform graphic rendering.
[0097] In some optional implementations, the display request may be sent to the rendering service included in the service module through the display request interface in a cross-process transmission manner.
[0098] As an example, Fig. 9 As shown, the vehicle control application and rendering are executed by different processes. The vehicle control application includes a registration interface registerSurface, which is provided by the SDK of the rendering service. When the vehicle control application is started, the registration interface can be used as the above-mentioned display request interface. The vehicle control application sends a layer registration request to the rendering service through cross-process transmission (for example, through the Android system's aidl technology polarity cross-process transmission). The layer registration request includes the vehicle control application identifier com.sample.settings and the corresponding proxy layer object surface. After the rendering service receives the layer registration request, it establishes a corresponding relationship between com.sample.settings and surface in the proxy layer object collection, that is, [com.sample.settings, surface]. The graphics rendering engine fills the vehicle control-related 3D resources into the target layer object, completes the rendering of the target layer, and displays the rendered layer on the screen through the Android graphics system.
[0099] By passing registration requests across processes, efficient data transmission is achieved between different applications and rendering services, which helps to improve the efficiency of layer rendering and the smoothness of layer display.
[0100] In some optional implementations, the application module includes at least one application, each of the at least one application is used to send a display request to the service module through a display request interface; the service module includes a graphics rendering engine, and the graphics rendering engine is used to use a target layer object and a target graphics resource to render a target layer of the target application to obtain a rendered target layer.
[0101] Specifically, each of the at least one application can request the service module to render a layer, and the application that currently sends a display request to the service module is the target application. Figure 4 As shown, the rendering service may include a graphics rendering engine (eg, a Unity engine), which may render a target layer of a target application according to a target layer object and a target graphics resource, thereby displaying the target layer on a screen.
[0102] In some optional implementations, the service module includes: a first determination unit, for determining the target application identifier and the proxy layer object from the layer registration request if the display request is a layer registration request sent after the target application is started; a second determination unit, for determining the target layer object corresponding to the target application based on the proxy layer object; and a third determination unit, for determining the graphic resource corresponding to the target application identifier from the graphic resource set as the target graphic resource.
[0103] In some optional implementations, the service module further includes: an establishment unit that saves the proxy layer object into a preset proxy layer object set and establishes a correspondence between the identifier of the target application and the proxy layer object.
[0104] In some optional implementations, the second determination unit is further used to: determine the address of the target layer object based on the proxy layer object, and determine the target layer object based on the address.
[0105] In some optional implementations, the service module includes: a fourth determination unit, used to determine the identifier of the target application from the application switching request if the display request is an application switching request sent by the target application; a fifth determination unit, used to determine the proxy layer object to be switched corresponding to the target application from a preset proxy layer object set based on the identifier of the target application; a sixth determination unit, used to determine the target layer object corresponding to the target application based on the proxy layer object to be switched; an acquisition unit, used to acquire the graphic resources corresponding to the target layer object from the graphic resource set as the target graphic resources; a rendering unit, used to switch the currently processed layer object to the target layer object, and add the target graphic resources to the target layer object to obtain the rendered target layer.
[0106] In some optional implementations, the service module further includes: a display unit, configured to display a preset transition animation if the display request is an application switching request sent by the target application; and stop displaying the transition animation in response to obtaining the target layer.
[0107] The layer rendering device provided in this embodiment can be as follows Figure 8 The layer rendering device shown in can execute all steps of the above layer rendering methods, thereby achieving the technical effects of the above layer rendering methods. Please refer to the above related description for details. For the sake of brevity, it will not be repeated here.
[0108] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, Fig.10The electronic device 1000 shown includes: at least one processor 1001, a memory 1002, at least one network interface 1004 and other user interfaces 1003. The various components in the electronic device 1000 are coupled together via a bus system 1005. It is understood that the bus system 1005 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 1005 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 1005 is not described in detail. Fig.10 Various buses are labeled as bus system 1005 .
[0109] The user interface 1003 may include a display, a keyboard, or a pointing device (eg, a mouse, a trackball, a touch pad, or a touch screen).
[0110] It can be understood that the memory 1002 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus random access memory (DRRAM). The memory 1002 described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0111] In some implementations, the memory 1002 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system 10021 and an application program 10022 .
[0112] The operating system 10021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application 10022 includes various application programs, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. The program for implementing the method of the embodiment of the present application can be included in the application 10022.
[0113] In some embodiments, by calling a program or instruction stored in the memory 1002, specifically, a program or instruction stored in the application 10022, the processor 1001 is used to execute the method steps provided by each method embodiment, for example, including:
[0114] In response to the target application executing the target operation, a display request corresponding to the target application is obtained, wherein the display request is obtained by a display request interface; based on the display request, a target layer object and a target graphic resource corresponding to the target application are determined, wherein the target graphic resource is obtained from a preset graphic resource set; and according to the target layer object and the target graphic resource, a rendered target layer is obtained.
[0115] The method disclosed in the above embodiment of the present application can be applied to the processor 1001, or implemented by the processor 1001. The processor 1001 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 1001. The above processor 1001 can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software units in the decoding processor can be executed. The software unit can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 1002, and the processor 1001 reads the information in the memory 1002 and completes the steps of the above method in combination with its hardware.
[0116] It is understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPDevice, DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the above functions of the present application, or a combination thereof.
[0117] For software implementation, the technology described above in this article can be implemented by a unit that performs the functions described above in this article. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0118] The electronic device provided in this embodiment may be Fig.10 The electronic device shown in can execute all the steps of the above-mentioned layer rendering method, thereby achieving the technical effects of the above-mentioned layer rendering method. Please refer to the above related description for details. For the sake of brevity, it will not be repeated here.
[0119] The embodiment of the present application also provides a storage medium (computer-readable storage medium). The storage medium here stores one or more programs. The storage medium may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a read-only memory, a flash memory, a hard disk or a solid-state drive; the memory may also include a combination of the above-mentioned types of memory.
[0120] When one or more programs in the storage medium can be executed by one or more processors, the layer rendering method executed on the electronic device side can be implemented.
[0121] The processor is used to execute the program stored in the memory to implement the following steps of the layer rendering method performed on the electronic device side:
[0122] In response to the target application executing the target operation, a display request corresponding to the target application is obtained, wherein the display request is obtained by a display request interface; based on the display request, a target layer object and a target graphic resource corresponding to the target application are determined, wherein the target graphic resource is obtained from a preset graphic resource set; and according to the target layer object and the target graphic resource, a rendered target layer is obtained.
[0123] The professionals should further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different circuits to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0124] The steps of the circuits or algorithms described in conjunction with the embodiments disclosed herein may be implemented using hardware, software modules executed by a processor, or a combination of the two. The software modules may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0125] It should be understood that the terms used in the text are only for the purpose of describing specific example embodiments, and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used in the text may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The steps, processes, and operations described in the text are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.
[0126] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.
Claims
1. A layer rendering method, characterized in that: The method comprises: In response to the target application executing the target operation, obtaining a display request corresponding to the target application, wherein the display request is obtained by a display request interface; Based on the display request, determine a target layer object and a target graphic resource corresponding to the target application, wherein the target graphic resource is obtained from a preset graphic resource set; A rendered target layer is obtained according to the target layer object and the target graphic resource.
2. The method according to claim 1, characterized in that The determining, based on the display request, a target layer object and a target graphic resource corresponding to the target application includes: If the display request is a layer registration request sent after the target application is started, determining the identifier and the proxy layer object of the target application from the layer registration request; Based on the proxy layer object, determining a target layer object corresponding to the target application; From the graphic resource set, a graphic resource corresponding to the identifier of the target application is determined as the target graphic resource.
3. The method according to claim 2, characterized in that After determining the target layer object corresponding to the target application based on the proxy layer object, the method further includes: The proxy layer object is saved in a preset proxy layer object set, and a corresponding relationship between the identifier of the target application and the proxy layer object is established.
4. The method according to claim 2, characterized in that: The determining, based on the proxy layer object, a target layer object corresponding to the target application includes: Based on the proxy layer object, the address of the target layer object is determined, and based on the address, the target layer object is determined.
5. The method according to claim 1, characterized in that: The determining, based on the display request, a target layer object and a target graphic resource corresponding to the target application includes: If the display request is an application switching request sent by the target application, determining an identifier of the target application from the application switching request; Based on the identifier of the target application, determine the proxy layer object to be switched corresponding to the target application from a preset proxy layer object set; Based on the proxy layer object to be switched, determining the target layer object corresponding to the target application; From the graphic resource set, obtain the graphic resource corresponding to the target layer object as the target graphic resource; The step of obtaining a rendered target layer according to the target layer object and the target graphic resource includes: The currently processed layer object is switched to the target layer object, and the target graphic resource is added to the target layer object to obtain a rendered target layer.
6. The method according to claim 5, characterized in that The step of determining a target layer object and a target graphic resource corresponding to the target application based on the display request further includes: If the display request is an application switching request sent by the target application, display a preset transition animation; The step of obtaining a rendered target layer according to the target layer object and the target graphic resource further comprises: In response to obtaining the target layer, stopping displaying the transition animation.
7. A layer rendering device, characterized in that: The device comprises: The application module is used for obtaining a display request corresponding to the target application in response to the target application executing the target operation, and sending the display request to the service module through the display request interface; A service module is used to determine the target layer object and target graphic resources corresponding to the target application based on the display request, wherein the target graphic resources are obtained from a preset graphic resource set; and obtain a rendered target layer according to the target layer object and the target graphic resources.
8. The device according to claim 7, characterized in that The application module includes at least one application, and each application in the at least one application is used to send the display request to the service module through the display request interface; The service module includes a graphics rendering engine, and the graphics rendering engine is used to render the target layer of the target application by using the target layer object and the target graphics resource to obtain the rendered target layer.
9. An electronic device, characterized in that: include: Memory for storing computer programs; The processor is used to execute the computer program stored in the memory, and when the computer program is executed, the layer rendering method described in any one of claims 1 to 6 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the layer rendering method described in any one of claims 1 to 6 is implemented.
