Interface display method and terminal equipment
By introducing a unified 3D declarative paradigm and interface in 3D application development, the problem of inconsistent programming paradigm in the existing technology is solved, the development difficulty and cost are reduced, and the development efficiency and display effect are improved.
Patent Information
- Application Number
- CN202311270118.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-27
- Publication Date
- 2025-03-28
AI Technical Summary
The programming paradigm of the existing 3D application development framework is not unified, which leads to developers need to learn multiple programming paradigms and configure multiple operating environments, which increases the development difficulty and learning cost.
It provides an interface display method, which realizes the development and deployment of 3D applications based on the same encoding rules (3D declarative paradigm), and completes different functions through a unified interface, reducing learning costs and development difficulties.
Through unified coding rules and interfaces, the difficulty and cost of 3D application development is reduced, the development efficiency and display effect are improved, and better loading and refined control of 3D resource formats are achieved.
Smart Images

Figure CN119718490A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to an interface display method and a terminal device. Background Art
[0002] At present, although there are many three-dimensional (3D) application development frameworks, there is no unified paradigm, and each application development framework can only realize a few functions. When developers develop 3D applications, if they want to realize more functions, they need to use a combination of multiple application development frameworks. However, the programming paradigms of different application development frameworks are also different. The programming paradigms of some application development frameworks are declarative programming, and the programming paradigms of other application development frameworks are imperative programming. When developers use application development frameworks of different programming paradigms in combination, they need to learn different programming paradigms, configure the corresponding operating environment or scenario for the application development frameworks of different programming paradigms, and call the functions in different application development frameworks after completing the adaptation. Obviously, using this method requires learning different programming languages, the development threshold and learning cost are high, and the scene configuration is cumbersome, the workload is large, and the development difficulty is high. Summary of the invention
[0003] The present application provides an interface display method and a terminal device, which can complete deployment based on the same coding rules and reduce the difficulty of developing 3D applications.
[0004] In order to achieve the above objectives, this application provides the following technical solutions:
[0005] In a first aspect, the present application provides an interface display method, the method comprising: a terminal device calls a first interface of a first application in response to a first operation of a user on a first application; the terminal device displays a first interface of the first application, the first interface including a first object of the first application; the type of the first object is a 3D type, and the first interface is used to implement the display of the first object; the terminal device calls a second interface of the first application in response to a second operation of the user on the first application; wherein the first interface and the second interface are interfaces determined based on the same coding rule; the type of the coding rule is declarative; the terminal device displays a second interface of the first application, the second interface including a second object of the first application; the type of the second object is a 3D type, and the second interface is used to implement the display of the second object.
[0006] In this method, development and deployment are completed based on the same coding rules, which reduces the learning cost and development difficulty. Moreover, the terminal device completes different functions based on the interface designed based on the same coding rules to achieve better display effects.
[0007] In some examples, the first application is an application program that implements a 3D function. For example, the first application is a game application that includes 3D objects (such as 3D game characters, buildings, etc.).
[0008] In some examples, the first operation may be a preset operation for triggering a first application of a terminal device to display a first object. The second operation may be a preset operation for triggering a first application of a terminal device to display a second object. Optionally, the preset operation includes a preset shortcut operation or a voice command.
[0009] In some examples, the first object is a visual object that can be displayed on a screen of a terminal device. For example, the visual object includes various forms of visual elements such as images, texts, buttons, and icons.
[0010] In some examples, the first interface is a functional interface in the first application for realizing display of the first object. The second interface is a functional interface in the first application for realizing display of the second object.
[0011] In some examples, the first interface is a display interface including a first object, and the second interface is a display interface including a second object.
[0012] According to a first aspect, the encoding rules include 3D declarative paradigm rules.
[0013] According to the first aspect, or any implementation of the first aspect above, the first interface and the second interface are both interfaces implemented according to the 3D declarative paradigm.
[0014] According to the first aspect, or any implementation of the first aspect above, before the terminal device calls the first interface of the first application in response to the user's first operation on the first application, the method also includes: the terminal device installs the first application based on the application installation package of the first application.
[0015] In some examples, the application installation package includes an executable file, and the executable file includes a first interface and a second interface, wherein the first interface and the second interface are both interfaces implemented according to the 3D declarative paradigm.
[0016] In some examples, the executable file is compiled based on the application code of the 3D declarative paradigm. For example, the 3D declarative paradigm is a first 3D declarative paradigm, which complies with the 2D declarative paradigm, regularizes the current 3D imperative paradigm and the 3D declarative paradigm into a unified declarative development paradigm, and designs a first 3D declarative interface to implement different functions through different first 3D declarative interfaces.
[0017] According to the first aspect, or any implementation of the first aspect above, the first interface or the second interface includes any one or more of the following: an interface for setting a 3D model and creating a 3D object, an interface for setting whether the camera in the 3D scene can move, an interface for setting the background of the 3D scene, an interface for setting transparency, an interface for adding a custom drawn object, an interface for adding a cube, an interface for adding a sphere, an interface for adding a cone, and an interface for setting 3D motion effects.
[0018] In this method, a unified loading entry for 3D resource formats is provided based on the same editing rule (3D declarative paradigm), which solves the problem that the current application development framework supports few data formats and helps promote 3D applications. Moreover, the coding rules are declarative coding rules, which reduces the amount of code and can effectively improve development efficiency. Furthermore, based on the same editing rule involving different functional interfaces, the scene or model can be finely controlled to achieve better display effects.
[0019] According to the first aspect, or any implementation of the first aspect above, the method also includes: the terminal device calls the third interface of the first application in response to the user's third operation on the first application; wherein the third interface is an interface implemented according to the 2D declarative paradigm; the terminal device displays the third interface of the first application; wherein the third interface includes the third object of the first application, the type of the third object is a 2D type, and the third interface is used to implement the display of the third object.
[0020] In some examples, the third interface is a functional interface in the first application for implementing display of a third object, and the third interface is an interface implemented according to a 2D declarative paradigm.
[0021] In some examples, the third interface includes a third object of the first application, and the type of the third object is a 2D type.
[0022] According to the first aspect, or any implementation of the first aspect, the application development framework of the 3D declarative paradigm and the 2D declarative paradigm are the same.
[0023] In some examples, the first interface may be a display interface that includes only 3D objects. The second interface may be a display interface that adds a 3D object to the first interface. The third interface may be a display interface that includes only 2D objects. The third interface may also be a display interface that includes both 2D objects and 3D objects, for example, a display interface that adds a 2D object to the first interface or the second interface. That is, the display scene of the third interface is a scene that displays both 2D objects and 3D objects. For example, in a game scene, a user's avatar or name is a 2D visualization object, and a game character or game scene is a 3D visualization object.
[0024] According to the first aspect, or any implementation manner of the first aspect above, a terminal device displays a first interface of a first application, including: the terminal device calls a first interface to create a first 3D view object; the terminal device creates a first 3D component node object according to the first 3D view object, and creates a corresponding first 3D drawing node in the first 3D component node object; the terminal device renders according to the first 3D drawing node to generate a first object; the terminal device displays the first interface including the first object.
[0025] According to the first aspect, or any implementation manner of the first aspect above, the terminal device displays a second interface of the first application, including: the terminal device calls a second interface to create a second 3D view object; the terminal device creates a second 3D component node object according to the second 3D view object, and creates a corresponding second 3D drawing node in the second 3D component node object; the terminal device renders according to the second 3D drawing node to generate a second object; the terminal device displays a second interface including the second object.
[0026] According to the first aspect, or any implementation method of the first aspect above, the terminal device displays the third interface of the first application, including: the terminal device calls the third interface to create a 2D view object; the terminal device creates a 2D component node object based on the 2D view object, and creates a corresponding 2D drawing node in the 2D component node object; the terminal device renders according to the 2D drawing node to generate a third object; the terminal device displays a third interface including the third object.
[0027] According to the first aspect, or any implementation manner of the first aspect above, the terminal device displays a third interface of the first application, including: the terminal device calls the second interface to create a second 3D view object; the terminal device creates a second 3D component node object according to the second 3D view object, and creates a corresponding second 3D drawing node in the second 3D component node object; the terminal device calls the third interface to create a 2D view object; the terminal device creates a 2D component node object according to the 2D view object, and creates a corresponding 2D drawing node in the 2D component node object; the terminal device renders according to the second 3D drawing node and the 2D drawing node based on a unified rendering algorithm to generate a second object and a third object; the terminal device displays a third interface including the second object and the third object.
[0028] According to the first aspect, or any implementation manner of the first aspect above, the terminal device displays a third interface of the first application, including: the terminal device calls the second interface to create a second 3D view object; the terminal device creates a second 3D component node object according to the second 3D view object, and creates a corresponding second 3D drawing node in the second 3D component node object; the terminal device renders according to the second 3D drawing node to generate a second object; the terminal device calls the third interface to create a 2D view object; the terminal device creates a 2D component node object according to the 2D view object, and creates a corresponding 2D drawing node in the 2D component node object; the terminal device renders according to the 2D drawing node to generate a third object; the terminal device displays a third interface including the second object and the third object.
[0029] In this method, when displaying 2D objects and 3D objects at the same time, the 2D objects and 3D objects can be rendered in a unified rendering mode and a separate rendering mode, which can realize the fusion display of 2D and 3D, easily develop 2D and 3D mixed scenes, and create a system-level 3D experience.
[0030] According to the first aspect, or any implementation of the first aspect above, after the terminal device displays the first interface, the method also includes: the terminal device adds the information of the object to be updated in the first interface to the first dirty area in response to the first indication; the first indication is used to trigger the terminal device to update the first interface; the information of the object to be updated includes the identification number of the object to be updated; the terminal device updates the object data of the object to be updated according to the information of the object to be updated in the first dirty area; the object data includes attribute data and / or conditional variables; the terminal device determines the first update object among the objects to be updated, and the first update object includes the object to be updated whose object data changes before and after the update; the terminal device determines the associated object in the first interface that has a parent-child relationship with the first update object, and adds the information of the first update object and the information of the associated object to the second dirty area; the terminal device updates the first interface according to the information of the component in the second dirty area.
[0031] In this method, by marking the dirty area for update, layout and rendering, and performing the corresponding update, layout and drawing operations at the corresponding stage, the update mechanism is triggered when the display data changes. This ensures that the interface display content is synchronized with the real-time graphic data, and the page can be updated in time to adapt to the changing page requirements.
[0032] In a second aspect, the present application provides a terminal device, comprising: one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and when the computer programs are executed by the one or more processors, the terminal device executes a method as described in the first aspect or any one of the embodiments of the first aspect.
[0033] In a third aspect, the present application provides a chip system comprising at least one processor and at least one interface circuit, wherein the at least one interface circuit is used to perform transceiver functions and send instructions to at least one processor, and when the at least one processor executes the instructions, the at least one processor executes a method as described in the first aspect or any one of the embodiments of the first aspect.
[0034] In a fourth aspect, the present application provides a computer-readable storage medium, which includes a computer program or instructions. When the computer program or instructions are run on a computer, the computer executes a method as described in the first aspect or any one of the embodiments of the first aspect.
[0035] In a fifth aspect, the present application provides a computer program product, which includes: a computer program or instructions, which, when the computer program or instructions are run on a computer, enable the computer to execute a method as described in the first aspect or any one of the embodiments of the first aspect.
[0036] It should be noted that the technical effects brought about by any design in the above-mentioned second to fifth aspects can refer to the technical effects brought about by the corresponding design in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A schematic diagram of a terminal device provided in an embodiment of the present application Figure 1 ;
[0038] Figure 2 A schematic diagram of a terminal device provided in an embodiment of the present application Figure 2 ;
[0039] Figure 3 A schematic diagram of a method for displaying an interface provided in an embodiment of the present application Figure 1 ;
[0040] Figure 4 A scenario example of an interface display method provided in an embodiment of the present application Figure 1 ;
[0041] Figure 5 A scenario example of an interface display method provided in an embodiment of the present application Figure 2 ;
[0042] Figure 6 A schematic diagram of a method for displaying an interface provided in an embodiment of the present application Figure 2 ;
[0043] Figure 7 A schematic diagram of a method for displaying an interface provided in an embodiment of the present application Figure 3 ;
[0044] Figure 8 A schematic diagram of module interaction of an interface display method provided in an embodiment of the present application;
[0045] Fig. 9 A schematic diagram of a terminal device provided in an embodiment of the present application Figure 3 ;
[0046] Fig.10 A schematic diagram of the structure of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] The terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "" and "this" are intended to also include expressions such as "one or more", unless there is a clear indication to the contrary in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one or more than two (including two). The character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0048] References to "one embodiment" or "some embodiments" etc. described in this specification mean that specific features, structures or characteristics described in conjunction with the embodiments are included in one or more embodiments of the present application. Therefore, the statements "in one embodiment", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways. The term "connected" includes direct and indirect connections, unless otherwise stated.
[0049] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more features.
[0050] In the embodiments of the present application, the words "exemplarily" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.
[0051] Most of the commonly used 3D application development frameworks currently provide imperative application programming interfaces (APIs), which can only implement simple functions, such as interactive viewing of 3D models. Currently, there is no API in the 3D application development framework that can implement refined control functions for 3D models or scenes, such as updating camera parameters, setting lights or animations, etc., resulting in poor display effects of 3D applications and fewer functions that can be implemented. Moreover, the 3D application development framework supports few data formats, which is not conducive to the promotion and use of 3D applications.
[0052] It should be understood that the application development framework includes some predefined functions to implement predefined functions. The application development framework provides an API and a programming framework for the application program.
[0053] In some examples, the platform implements 3D functions through a combination of multiple application development frameworks based on its own 3D application development framework and the 3D application development framework of a third-party platform.
[0054] For example, the user interface (UI) application development framework for the platform based on the iOS architecture is the declarative framework SwiftUI based on Swift. In SwiftUI, the .usdz format can be used to load 3D content to obtain a view and display the view on the application interface. .usdz is an extension based on the universal scene description (USD) file format.
[0055] Although SwiftUI uses simple code to describe the interface and behavior to be displayed, without directly operating the underlying views and controls, which simplifies the code, the API provided by SwiftUI is limited and can only implement a few functions, such as creating a default camera, setting lights, etc., and cannot present sophisticated 3D motion effects.
[0056] To present better 3D effects, SwiftUI needs to introduce SceneKit and RealityKit of UIKit. SceneKit and RealityKit provide powerful engines that can create realistic 3D scenes and visual effects. However, the programming paradigm of UIKit is imperative, and it is necessary to configure the corresponding operating environment for SceneKit and RealityKit of UIKit separately, so as to call different engine interfaces to implement different functions. For example, in an IOS application, a Swift class is created as an adaptation layer for C++ interaction, and the conversion of data types and data structures is completed through the adaptation layer. In this way, different engines are mobilized across languages by calling the methods of the adaptation layer. SceneKit and RealityKit are both independent rendering engines. When an application uses SceneKit and RealityKit, it is necessary to create a separate rendering environment and rendering thread for the rendering engine in order to manage rendering resources and status. Subsequently, the application embeds the rendering results generated by each rendering engine into the 2D display interface of the application.
[0057] It should be understood that declarative programming is a programming style that describes computing tasks as a series of expressions or statements. It focuses on "what to do" and pays attention to the logic, goals and results of the problem. Imperative programming is a programming style that instructs the computer how to perform tasks through a series of instructions. It focuses on "how to do it" and requires clear formulation of the execution steps and control flow of each operation. Therefore, declarative programming is concise and readable, and is easier to understand and maintain. Imperative programming requires more details and control structures, with a large amount of code and low readability and maintainability. Therefore, the current application development framework tends to use declarative programming to reduce the amount of code and improve development efficiency.
[0058] In other examples, the platform uses the 3D application development framework of a third-party platform to implement 3D functions.
[0059] For example, the application development framework of the platform based on the Android architecture does not provide a 3D function API, and it is necessary to use the 3D application development framework of a third-party platform and call the engine interface of the third-party platform to implement the 3D function. However, it is necessary to configure the corresponding operating environment for the 3D application development framework of the third-party platform, which has a high learning cost.
[0060] In the above examples, each 3D application development framework has its own paradigm, which can realize fewer 3D functions and poor display effects. 3D functions are realized by combining different 3D application development frameworks. When using different application development frameworks, it is necessary to take into account the paradigm of each application development framework and complete the corresponding configuration before using them together. The learning cost is high and the efficiency is low.
[0061] In order to improve the above-mentioned problems, an embodiment of the present application provides an interface display method, in which a terminal device installs an application installation package of a first application and generates an executable file, and the executable file is obtained by compiling the application code of a first 3D declarative paradigm; the terminal device responds to the user's first operation on the first application and creates a view object according to the executable file; the terminal device calculates and creates a drawing node in the view object through the component node object; the terminal device renders according to the drawing node and displays the rendering result. The technical solution of the present application completes the development and deployment of 3D applications based on a unified 3D declarative paradigm, reducing the learning cost and development difficulty.
[0062] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.
[0063] The interface display method provided in the embodiment of the present application can be applied to a terminal device with a display function. The terminal device can also be called a terminal, user equipment (UE), mobile station (MS), mobile terminal (MT), etc.
[0064] In the embodiments of the present application, the terminal device may be a mobile phone, a computer, a two-in-one notebook, a two-in-one tablet computer, a laptop computer, a smart TV, a tablet computer (Pad), a computer with wireless transceiver function, an augmented reality (AR) terminal device\virtual reality (VR) device, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), an artificial intelligence (AI) terminal, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc. The embodiments of the present application do not limit the specific technology and specific device form adopted by the terminal device.
[0065] like Figure 1 , which is a schematic diagram of the hardware structure of a terminal device 100 provided in an embodiment of the present application.
[0066] The terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a radio frequency module 150, a communication module 160, an audio module 170, a sensor module 180, a camera 193, a display screen 194, etc.
[0067] The structure illustrated in the embodiment of the present invention does not constitute a limitation on the terminal device 100. It may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0068] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0069] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0070] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor is a high-speed cache memory, which can store instructions or data that the processor has just used or cyclically used. If the processor needs to use instructions or data again, it can be directly called from the memory. Repeated access is avoided, the waiting time of the processor is reduced, and the efficiency of the system is improved.
[0071] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0072] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the terminal device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the terminal device 100.
[0073] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal device 100. The external memory card communicates with the processor through the external memory interface to implement a data storage function, such as storing music, video and other files in the external memory card.
[0074] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the terminal device 100 by running the instructions stored in the internal memory 121. The memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function, etc. The data storage area may store data created during the use of the terminal device 100, etc. In addition, the memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, other volatile solid-state storage devices, a universal flash storage (UFS), etc.
[0075] The USB interface 130 is an interface that complies with the USB standard specification, and can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface can be used to connect a charger to charge the terminal device 100, and can also be used to transmit data between the terminal device 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other terminal devices, such as AR devices.
[0076] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is a schematic illustration and does not constitute a structural limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0077] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the terminal device 100. While the charging management module 140 is charging the battery 142, it may also power the terminal device through the power management module 141.
[0078] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module receives input from the battery and / or the charging management module to power the processor, internal memory, external memory and display screen. The power management module can also be used to monitor parameters such as battery capacity and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0079] The wireless communication function of the terminal device 100 can be implemented through antenna 1, antenna 2, RF module 150, communication module 160, modem processor and baseband processor.
[0080] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, a cellular network antenna can be reused as a wireless local area network diversity antenna. In some embodiments, the antenna can be used in combination with a tuning switch.
[0081] The RF module 150 can provide a communication processing module for solutions including 2G-5G wireless communications applied to the terminal device 100. The RF module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The RF module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The RF module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the RF module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the RF module 150 can be set in the same device as at least some of the modules of the processor 110.
[0082] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the RF module 150 or other functional modules.
[0083] The communication module 160 can provide a communication processing module for wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the terminal device 100. The communication module 160 can be one or more devices integrating at least one communication processing module. The communication module receives electromagnetic waves via antenna 2, modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor. The communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency, amplify it, and convert it into electromagnetic waves for radiation through antenna 2.
[0084] In some embodiments, the antenna 1 of the terminal device 100 is coupled to the radio frequency module, and the antenna 2 is coupled to the communication module, so that the terminal device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-CDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC and / or IR technology, etc. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS) and / or a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS), etc.
[0085] The audio module 170 is used to convert digital audio information into analog audio signal output, and also to convert analog audio input into digital audio signal. The audio module can also be used to encode and decode audio signals.
[0086] The sensor module 180 of the terminal device 100 may specifically include: a pressure sensor, a distance sensor, an ambient light sensor, a fingerprint sensor, a temperature sensor, and a touch sensor, etc. The touch sensor is also called a "touch panel" and may be provided on a display screen to detect a touch operation on or near it.
[0087] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. In some embodiments, the terminal device 100 may include 1 or N cameras, where N is a positive integer greater than 1.
[0088] The terminal device 100 implements the display function through a graphics processing unit (GPU), a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0089] The display screen 194 is used to display images, videos, etc. The display screen includes a display panel. The display panel can be LCD (liquid crystal display), OLED (organic light-emitting diode), active-matrix organic light-emitting diode or active-matrix organic light-emitting diode (AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diodes (quantum dot light-emitting diodes, QLED), etc. In some embodiments, the terminal device 100 may include 1 or N display screens, where N is a positive integer greater than 1.
[0090] The terminal device 100 may also include components such as a battery 142, and the embodiment of the present application does not impose any limitation on this.
[0091] The embodiments of the present application do not limit the structure and form of the terminal device. For example, Figure 2 Another exemplary structure of a terminal device is shown. Figure 2 As shown, the terminal device includes: a processor 201, a memory 202, a transceiver 203, and an input / output device 204. The implementation of the processor 201 and the memory 202 can be found in Figure 1The implementation of the processor and memory of the terminal device 100 in the embodiment. The transceiver 203 is used for the terminal device to interact with other devices. The transceiver 203 can be a device based on Wi-Fi, Bluetooth or other communication protocols. The input / output device 204 can be used to input information to the terminal device or output information from the terminal device. For example, the input / output device 204 can be a display screen, an audio player, a speaker, etc., which can be used for the terminal device to output meeting minutes.
[0092] In some other embodiments of the present application, the terminal device may include Figure 1 , Figure 2 More or fewer components shown, or some components are combined, or some components are split, or some components are replaced, or different component arrangements are arranged. The components shown in the figure can be implemented in hardware, software, or a combination of software and hardware.
[0093] The technical solutions involved in the following embodiments can all be Figure 1 , Figure 2 The invention is implemented in the device of the structure shown.
[0094] The interface display method of the embodiment of the present application is described in detail below through specific embodiments. The following embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0095] refer to Figure 3 , Figure 3 A flowchart of an interface display method provided in an embodiment of the present application is provided, and the method includes the following steps S301-S304:
[0096] S301. The terminal device installs a first application based on an application installation package of the first application, where the application installation package includes an executable file, and the executable file is compiled based on an application code of a first 3D declarative paradigm.
[0097] In the embodiment of the present application, the terminal device is a device with a display function and capable of running the first application, for example, a mobile phone, a tablet computer, etc.
[0098] In an embodiment of the present application, the first application is an application that implements 3D functions. For example, the first application is a game application that includes 3D objects (such as 3D game characters, buildings, etc.). The first application can also be an application that can implement 3D functions, such as a shopping application, a social application, etc. The application installation package of the first application is used to install the first application. Among them, the above-mentioned first 3D declarative paradigm can be simply understood as a programming rule, and the first application is an application coded by the developer based on the above-mentioned first 3D declarative paradigm.
[0099] In an embodiment of the present application, the first 3D declarative paradigm (which can also be described as a unified 3D declarative paradigm) complies with the 2D declarative paradigm, organizes the current 3D imperative paradigm and the 3D declarative paradigm into a unified declarative development paradigm, and designs a first 3D declarative interface (described as an API or API interface in an embodiment of the present application) to implement different functions through different first 3D declarative interfaces.
[0100] For example, Figure 4 As shown, it is a schematic diagram of regularizing the current imperative paradigm and the declarative paradigm into a unified declarative development paradigm. The 3D imperative paradigm and the declarative paradigm are unified to obtain a unified declarative development paradigm.
[0101] Exemplarily, an API for loading a 3D model and creating a 3D object is designed according to the first 3D declarative paradigm:
[0102] static model(src:string):void;
[0103] Among them, the static method receives a string parameter from the developer to process model-related operations, and does not return (void means no return value). The static method is a method that directly belongs to the class itself and can be called by the class name to perform the corresponding processing operation without creating an instance of the class.
[0104] Exemplarily, an API for setting whether the camera in a 3D scene can move is designed according to the first 3D declarative paradigm:
[0105] static setHandleCameraMove(params:boolean):void;
[0106] The static method receives a Boolean parameter from the terminal device to process model-related operations and does not return. The method involves operations related to the camera position, direction, or field of view.
[0107] Exemplarily, an API for setting the background of a 3D scene is designed according to the first 3D declarative paradigm:
[0108] static background(params:string):void;
[0109] Among them, the static method receives a string parameter from the developer to process model-related operations and does not return. The method is usually used to select a suitable background image, color, or define other background-related properties. The main process includes loading background maps or textures, setting scene backgrounds, and rendering scenes.
[0110] Exemplarily, an API for setting transparency is designed according to the first 3D declarative paradigm:
[0111] static transparent(params:boolean):void;
[0112] The static method receives a Boolean parameter from the terminal device to process model-related operations and does not return. Use the method to set the transparency of an object or element to opaque or transparent. For example, if the params parameter is true, it means enabling transparency; if the params parameter is false, it means disabling transparency, that is, setting it to opaque.
[0113] Exemplarily, an API for adding custom drawing objects is designed according to the first 3D declarative paradigm:
[0114] static addCustomRender(uri:string,nativeTypeName:string,needsFrameCallback:boolean):void;
[0115] Among them, the static method receives three parameters from the developer of the terminal device: uri (string type), nativeTypeName (string type) and needsFrameCallback (Boolean type), and has no return value.
[0116] The meanings of its parameters are as follows:
[0117] uri: represents the resource identifier (URI) of the custom drawing object, that is, the path to the custom drawing object file or resource.
[0118] nativeTypeName: indicates the native type name of the custom drawing object, that is, specifies the type or category of the custom drawing object.
[0119] needsFrameCallback: A Boolean value indicating whether a frame callback is needed. For example, if the value of needsFrameCallback is true, it means that the callback function needs to be called for additional drawing operations when each frame is rendered; if the value of needsFrameCallback is false, the drawing operation of the custom drawing object will only be triggered under certain conditions.
[0120] Exemplarily, an API for adding a cube is designed according to the first 3D declarative paradigm:
[0121] static addCube(obj:SVCube):void;
[0122] Among them, the static method receives the developer's SVCube type parameters from the terminal device. The method is used to add a cube, which represents the object or data of the cube, usually including the cube's position, size, color and other information.
[0123] Exemplarily, an API for adding a sphere is designed according to the first 3D declarative paradigm:
[0124] static addSphere(obj:SVSphere):void;
[0125] Among them, the static method receives the developer's SVSphere type parameters from the terminal device. The method is used to add a sphere, which represents the object or data of the sphere, usually including the sphere's position, radius, color and other information.
[0126] Exemplarily, an API for adding a cone is designed according to the first 3D declarative paradigm:
[0127] static addCone(obj:SVCone):void;
[0128] Among them, the static method receives the developer's SVCone type parameters from the terminal device. The method is used to add a cone, which represents the object or data of the cone, usually including the position, radius, height, color and other information of the sphere.
[0129] Exemplarily, an API for adding 3D animations in graphics language transmission format (glTF) is designed according to the first 3D declarative paradigm:
[0130] static glTFAnimation(params:{name?:string,state:AnimationState,repeatCount?:number,speed?:number,duration?:number,reverse?:boolean}):void;
[0131] The static method receives a variable number of parameters from the terminal device and is used to add glTF animation. The meanings of the parameters are as follows:
[0132] params: An object containing various parameters for setting the animation.
[0133] name: The name of the animation.
[0134] state: The state of the animation, i.e. start or stop.
[0135] repeatCount: The number of times the animation is repeated. The default value is 1.
[0136] speed: The speed at which the animation is played. The default value is 1.0.
[0137] duration: The duration of the animation (in seconds), which is used to control the end time of the animation. By default, it is determined according to the animation time defined in the glTF file.
[0138] reverse: Indicates whether to play the animation in reverse direction. The default value is false.
[0139] In some examples, the name, repeatCount, speed, duration, and reverse parameters corresponding to the glTF animation are optional. That is, the API for adding glTF animation designed according to the first 3D declarative paradigm may not include one or more of the parameters name, repeatCount, speed, duration, and reverse.
[0140] Exemplarily, an API for adding a camera to a 3D scene is designed according to the first 3D declarative paradigm:
[0141]
[0142] The static method receives a variable number of parameters from the terminal device to create a camera object and add it to the 3D scene. The parameters have the following meanings:
[0143] params: An object containing various parameters for setting camera properties.
[0144] position: The position coordinates (x, y, z) of the camera.
[0145] positionInAngles: specifies the position of the camera by angle values, including x, y, and z components representing the orientation of the camera in the spherical coordinate system, and distance representing the distance between the camera and the target point.
[0146] lookAt: The position coordinates (x, y, z) of the camera's observation target point.
[0147] up: The camera's up vector.
[0148] rotation: The camera's rotation quaternion.
[0149] zNear: The distance of the camera's near clipping plane.
[0150] zFar: The distance of the camera's far clipping plane.
[0151] fovD: vertical angle of field of view (degrees).
[0152] In some examples, the position, positionInAngles, lookAt, up, and rotation parameters corresponding to the camera object are optional. That is, the API for adding a camera to a 3D scene designed according to the first 3D declarative paradigm may not include one or more of the parameters position, positionInAngles, lookAt, up, and rotation.
[0153] Exemplarily, an API for configuring lighting for a 3D scene is designed according to the first 3D declarative paradigm:
[0154]
[0155] The static method receives a variable number of parameters from the terminal device to create a light object and add it to the 3D scene. The parameters have the following meanings:
[0156] params: An object containing various parameters for setting light properties.
[0157] type: The type of light, including point light, spotlight or parallel light, etc. Specific values represent different types of lights.
[0158] intensity: The intensity of the light.
[0159] shadow: Indicates whether shadows for the light are enabled.
[0160] color: The color of the light.
[0161] position: The position coordinates (x, y, z) of the light.
[0162] positionInAngles: Specifies the position of the light by angle values, including x, y, and z components representing the position of the light in the spherical coordinate system, and distance representing the distance from the light to the target point.
[0163] rotation: The rotation quaternion of the light.
[0164] In some examples, the parameters corresponding to the light object, such as type, intensity, shadow, color, position, positionInAngles, and rotation, are optional. That is, the API for configuring lights for a 3D scene designed according to the first 3D declarative paradigm may not include one or more of the parameters, such as type, intensity, shadow, color, position, positionInAngles, and rotation.
[0165] The above examples are only some of the APIs designed in accordance with the first 3D declarative paradigm in the embodiments of the present application, and the embodiments of the present application do not impose any restrictions on the APIs.
[0166] In the examples of this application, see Figure 5 The developer opens an application development tool (e.g., Android Studio or DevEco Studio, etc.) in the terminal device 500 (development device), and generates a development file (also understood as application code) according to the first 3D declarative paradigm in the editing interface of the application development tool. Usually, the developer uses a programming language to edit the program code of the function in the application development tool, that is, the development file.
[0167] In the embodiment of the present application, the development device is a device with a display function and capable of developing a 3D function application program (ie, the first application mentioned above), for example, a computer.
[0168] Exemplarily, the developer opens the editing interface of the application development tool in the development device, and the editing interface includes the initial version of the application code (which can also be described as the initial source code). The initial version of the application code can be blank code or code containing simple examples. It is understandable that the initial version of the application code can be preset in the application development tool or pre-added by the developer in the application development tool. In some examples, the application development tool can also include programming language templates, 3D declarative paradigms, interface description examples, etc., which will not be repeated in the embodiments of the present application.
[0169] It should be understood that the development file is generally composed of the logic code or functional instructions and data of the application. Exemplarily, the front-end development files include description files and resource files. The description file includes an interface description file that uses a programming language to describe the layout of the UI, the components in the UI, and the visual effects of the layout and components. The description file also includes a file that defines the interface behavior using a programming language. The interface behavior includes the dynamic changes of the UI, and the response of the terminal device to the dynamic changes of the UI (such as the response of the terminal device to the user's UI operation). Resource files are usually prescriptive files for configuring resources required for program operation. Resource files include resource path definitions, resource allocations, etc.
[0170] In the embodiment of the present application, the development file includes a description file and a resource file. The description file is used to describe the interface and define the interface behavior of the first application according to the first 3D declarative paradigm; the resource file includes the configuration resources and prescriptive files required for the operation of the first application generated based on the first 3D declarative paradigm.
[0171] Exemplarily, part of the application code developed by the developer in the application development tool in the terminal device 500 (ie, the development file generated in accordance with the first 3D declarative paradigm) is as follows:
[0172]
[0173] The application code is a custom scene view component CustomSceneView. CustomSceneView is a structure or class (depending on the first 3D declarative paradigm) that is used to define a custom scene view component. x, y, z, and distance are application state variables related to the camera position, which are declared and bound using the @State decorator.
[0174] The build() method is used to build the UI layout of the scene view. In the Column component, there is a Model component that is used to load and display the 3D model file (DamagedHelmet.gltf file in .gltf format). The background() method is used to set the background of the scene (using the Environment.gltf file as the background). The width() and height() methods are used to set the width and height of the model.
[0175] The camera() method is used to configure the camera. The positionInAngles property uses two-way binding to determine the camera's position and viewing angle based on the x, y, z, and distance variables in the application state. The lookAt property indicates the camera's gaze point, and the up property indicates the camera's up direction.
[0176] The light() method is used to configure the light. Specifically, the application code sets a spotlight (type: 2) with an intensity of 20.0, no shadows, a green color ({x: 0.0, y: 1.0, z: 0.0}), and a position near the origin ({x: 0.0, y: 0.0, z: 3.0}).
[0177] In the embodiment of the present application, after generating the development file, the developer compiles the development file into an executable file through the compilation tool chain, and packages the executable file into an application installation package of an application (App) (such as the application installation package of the first application). Subsequently, the application installation package of the first application is uploaded to the server 501. The server 501 publishes the first application in the application store provided by itself, and provides the application installation package of the first application for users to download and use.
[0178] The user can use the user-side terminal device 502 to download the application installation package of the first application in the application store, install the first application on the terminal device 502 according to the downloaded application installation package, and generate an executable file under the installation path of the first application.
[0179] It should be understood that an executable file is a binary form of an application, usually an executable program or script. An executable file contains the code, data, and resources of the application, and can be directly executed on a computer. An executable file can be directly called by a user or an operating system to enable and execute the application.
[0180] It is understandable that in some embodiments of the present application, the developer can directly develop the UI of the first application on the terminal device 502 and run the first application on the terminal device 502. That is, the terminal device 500 and the terminal device 502 can be the same terminal device. The embodiments of the present application are not limited to this.
[0181] S302: The terminal device creates a view object according to the executable file in response to a first operation of the user on the first application.
[0182] In the embodiment of the present application, the first operation includes a preset operation of the user on the first application.
[0183] Specifically, the first operation includes a preset opening operation of the user opening the first application. Alternatively, the first operation includes a preset opening operation of the user opening the first application and a preset processing operation of the user setting various parameters in the first application. The preset opening operation includes various pre-set operations that can open the first application. The preset processing operation includes various pre-set operations that process various parameters in the first application.
[0184] In the embodiment of the present application, the view object may be a class or structure defined in C++, which is used to represent the relevant content and state of the scene. For example, the view object may be a C++ object corresponding to 3D JSView.
[0185] In one possible implementation, the terminal device receives a preset opening operation of a first application by a user, starts the first application, and when the first application starts, in response to the preset opening operation, loads the executable file through a package management tool and an application loading module to create a view object.
[0186] In some examples, first, the terminal device starts the first application, and the application development framework initializes the application root node of the first application. The application root node is the starting point of the first application, and the components, pages or views of the first application will be built under the application root node. Secondly, the application root node will create a page manager for managing and switching different pages or views in the first application. For example, the page manager can implement functions such as managing page layout, recording page history, and processing page parameters in the first application. After initializing the application root node of the first application, the application development framework loads the corresponding page file, parses the content in the page file (usually including the page's logic code, resource files, dependencies, etc.), and creates a page root node based on the components therein.
[0187] The page root node will call the internal build method to generate the page root node component (which can also be described as a subtree structure), and mount the page root node component under the page root node. Among them, the build method can define the layout, style of the component, and the nested relationship of subcomponents. Subsequently, the routing management class loads the corresponding page root node component according to the routing rules, instantiates the page root node component, and mounts the instantiated page root node on the page wrapper node. In this way, the page root node and its subcomponents become child nodes of the page wrapper node and can be correctly rendered and displayed on the page. Finally, the page wrapper node is mounted under the root node of the first application, that is, the page content is nested in the root node content so that the page can be rendered and displayed in the application.
[0188] In another possible implementation, the terminal device receives a user's preset opening operation for the first application and a preset processing operation for setting various parameters in the first application, starts the first application, responds to the user's preset processing operation for setting various parameters in the first application when the first application starts, determines the command line parameters corresponding to the preset processing operation or modifies the configuration file, dynamically loads the executable file through a package management tool and an application loading module, and creates a view object.
[0189] In other embodiments of the present application, after loading the executable file of the 3D scene to create a view object, the first application needs to parse the events, properties and methods in the 3D scene (such as the scene's object position, rotation, scaling and other information, and other scene-related states, such as camera position, lighting parameters, animation parameters, common properties, etc.) (also described as state data) and bind them to the corresponding view objects to achieve control and modification of the 3D scene.
[0190] For example, taking the generated view object as a 3D JSView C++ object as an example, if there are camera parameters and lighting settings in the 3D scene, the first application needs to parse these parameters and bind the parameters to the corresponding 3DJSView C++ object. In this way, in subsequent operations, the first application can control the camera position and lighting effects of the 3D scene by modifying these properties.
[0191] It is understandable that mapping state management to 3D JSView can achieve unified management and automatic update of the state of the 3D scene. This can simplify the development process, improve the maintainability and testability of the code, and enable the application to respond more flexibly to user operations and changes.
[0192] S303: The terminal device calculates and creates a drawing node through the component node object in the view object.
[0193] In the embodiment of the present application, the component node object is a visual element in a page or application, such as a 3D component.
[0194] In the embodiment of the present application, a drawing node (or rendering node) refers to a stage in a graphics rendering pipeline, which is used to process and render graphic elements in a scene.
[0195] In some examples, the terminal device uses the view object to create a component node object (which can also be described as a component node). For example, a 3D component node object is created through C++, and the object can represent a 3D model, scene, or other related 3D component. Then, the terminal device calculates the position and size of the component node object in the page according to the page layout and design needs, combined with algorithms (such as algorithms involving relative positioning, absolute positioning, and adaptive layout). Subsequently, the terminal device uses the view object to create a drawing node, and applies the position and size information of the component node object to the drawing node to ensure that the component node object is correctly displayed and laid out in the page. The drawing node with the set position and size information is then added as a child node to the DOM tree of the view object so that the call to the drawing node can be completed by calling the view object.
[0196] S304: The terminal device renders according to the drawing node and displays the rendering result.
[0197] In some examples, according to the state of the scene and the required rendering effect, the terminal device generates rendering instructions required for rendering in the drawing node, and these instructions include vertex positions, lighting, texture mapping and other information of the drawn object. By using the ring buffer, the main thread in the rendering thread writes the rendering instructions to the end of the buffer to complete the asynchronous data transmission. After the main thread generates enough rendering instructions and writes them to the ring buffer, the backend thread of the rendering thread completes the actual rendering operation by calling the rendering instructions triggered by the Flush instruction (the function of the Flush instruction is to notify the backend thread that the rendering instructions can be read from the ring buffer for processing). When the backend thread performs the actual rendering, it will perform a series of operations such as vertex processing, lighting calculation, texture mapping, etc. according to the received rendering instructions, and then cache the 2D rendering tasks and 3D rendering tasks in the buffer through unified rendering technology, render the 2D rendering tasks and 3D rendering tasks uniformly, and merge the 2D and 3D rendering results to obtain the rendering results. The process may include the processing of occlusion relationships, the calculation of blending effects, etc., to achieve seamless fusion display of 2D and 3D. Finally, the generated rendering result (such as texture) is input to the display screen of the terminal device for display, achieving a mixed display effect of 2D and 3D.
[0198] It should be understood that the main thread is mainly responsible for scheduling rendering tasks, sending rendering tasks to the backend thread, and the backend thread accepts the rendering instructions sent by the main thread, executes the rendering tasks, and generates rendering results. The backend thread usually runs on graphics hardware and uses the parallel performance of the hardware to accelerate the rendering process. The main thread does not need to wait for the backend thread to complete the rendering task, but can continue to generate new rendering instructions and write them into the buffer. The backend thread can read instructions from the buffer for rendering according to its own speed, improving overall efficiency and parallel processing capabilities. At the same time, synchronization and communication are required between the main thread and the backend thread to ensure the correctness and consistency of the rendering. This division of labor can improve rendering efficiency and make full use of the performance advantages of multi-core processors and graphics hardware.
[0199] Among them, the ring buffer is a special buffer structure that can be used cyclically, that is, when the end of the buffer is used, data can be written from the beginning of the buffer. In this way, data can be stored cyclically and the problem of buffer overflow can be avoided.
[0200] Through the above process, in the embodiment of the present application, the terminal device installs the application installation package of the first application and generates an executable file, which is obtained by compiling the application code of the first 3D declarative paradigm; the terminal device responds to the user's first operation on the first application and creates a view object according to the executable file; the terminal device calculates and creates a drawing node through the component node object in the view object; the terminal device renders according to the drawing node and displays the rendering result. The technical solution of the present application completes the development and deployment of 3D applications based on the unified first 3D declarative paradigm, reducing the learning cost and development difficulty. Moreover, the APIs with different functions designed in accordance with the first 3D declarative paradigm can perform fine control over scenes or models, achieve better display effects, and improve user experience. In the embodiment of the present application, a unified loading entry for 3D resource formats is provided based on the unified first 3D declarative paradigm, which solves the problem of few data formats supported by the current application development framework and helps to promote 3D applications.
[0201] It is understandable that the above examples are described by taking the example of a terminal device creating and displaying a rendering result. In actual applications, after generating a rendering result, the data in the rendering result may be updated, and a new rendering result may be generated based on the updated data.
[0202] Take updating the data in the rendering result as an example. Figure 6 As shown, the interface display method provided in the embodiment of the present application also includes steps S601-S605:
[0203] S601. The terminal device identifies each component node object.
[0204] In an embodiment of the present application, when creating a page, the terminal device identifies each component node object in the page according to the UI description.
[0205] Among them, UI description refers to the way of describing the structure, style and behavior of the user interface. UI description is used to define various elements, layouts, interactions and visual effects in an application or page.
[0206] Exemplarily, when creating a page, the terminal device identifies each component node object in the page according to the UI description and identifies each component node object, and assigns a unique identification ID (identity document) to each component node object. The identification ID can be any string or number, and can be named based on the type, location, parent-child relationship, etc. of the component node object.
[0207] In this way, by allocating a unique identification ID, the terminal device can easily manage and operate each component node object in the application, thereby improving the efficiency of application development and maintenance.
[0208] S602: The terminal device monitors the page state variables, marks the component node object to be updated as a dirty area for update, and stores it in the rendering pipeline object.
[0209] Among them, page state variables refer to variables used to save data and control interface behavior in front-end applications. They are used to store the current state data of front-end applications (such as user options, user operation status, page navigation status, pop-up window status, etc.). Terminal devices can change the behavior and presentation content of application pages by operating stored variables.
[0210] Among them, updating dirty areas refers to the collection of areas or components that are marked as needing to be re-rendered in the front-end framework when the page state changes. The data in the area or component has changed and needs to be updated.
[0211] It should be understood that re-rendering the entire page consumes a lot of power and is inefficient. By determining the components in the page that need to be re-rendered as the dirty update area, only the changed components can be selectively updated, which can reduce unnecessary computational rendering work and improve device performance and response speed.
[0212] The rendering pipeline object is a data structure inside the front-end application development framework, which is used to store component information to be updated.
[0213] In some embodiments of the present application, when the page state variable changes, the front-end application development framework of the terminal device will mark the custom component holding the state variable as an update dirty area and save it in the rendering pipeline object. Subsequently, the front-end application development framework will request the next vsync (vertical synchronization) signal, and when the next vsync signal arrives, it will execute the update task.
[0214] S603: The terminal device updates the dirty area.
[0215] In some embodiments of the present application, when the next vsync signal arrives, the rendering pipeline checks and executes update tasks (such as recalculating vertices, performing rasterization, performing fragment shading, etc.) of component node objects marked as dirty update areas.
[0216] Among them, the rendering pipeline is the process of the front-end rendering engine processing graphics tasks, which is used to convert front-end components and page elements into final image output.
[0217] It should be understood that updating according to the vsync signal can ensure that the update of the rendering pipeline is synchronized with the refresh of the display screen, avoid screen tearing on the terminal device display interface, and ensure that the graphics rendering update is completed in the interval between display screen refreshes, providing users with a smoother and more coherent visual experience.
[0218] In other embodiments of the present application, when the dirty area is updated and the update task is executed, the front-end framework will traverse the child nodes of the component and check the update conditions of each child node (such as identifying the update conditions of the child nodes inside the bulid function). For the child nodes that meet the update conditions (that is, the state variables have changed), the UI description method after the change of the child node state variables is re-executed, and the attributes and conditional variables of the dirty area (component node object to be updated) are updated. In this way, the update of the dirty area is completed.
[0219] S604: The terminal device determines the layout dirty area according to the updated update dirty area, and re-layouts the layout dirty area.
[0220] The dirty layout area refers to the set of nodes that need to be re-layouted and are marked by the front-end framework during the page rendering process. It is understandable that when a node is marked as a dirty layout area, the position, size and other properties of the node and its child nodes need to be recalculated and updated.
[0221] In some embodiments of the present application, the terminal device compares the attributes and conditional variables of the component node objects before and after the update (including the update dirty area), marks the changed components as layout dirty areas, and also marks the parent nodes of the child nodes marked as layout dirty areas as layout dirty areas. The layout dirty areas are saved in the rendering pipeline, and the rendering pipeline performs a re-layout operation on the layout dirty areas in the layout phase (such as recalculating the position, size, and other information of the nodes according to the current attributes and styles of the nodes), and updates the size, position, and other information of the component node objects corresponding to the layout dirty areas.
[0222] It should be understood that the layout of child nodes may affect the layout of parent nodes. Therefore, the child nodes and parent nodes are re-layouted to ensure that the page layout finally presented to the user is accurate and consistent.
[0223] S605: The terminal device determines the rendering dirty area according to the updated layout dirty area, re-renders the rendering dirty area, and displays the rendering result.
[0224] The rendering dirty area refers to the area or element set that needs to be redrawn during the page rendering process.
[0225] In some embodiments of the present application, the terminal device determines the rendering dirty area based on the updated layout dirty area, saves the rendering dirty area in the rendering pipeline, and in the attribute drawing stage, the rendering pipeline redraws the dirty area nodes according to the updated rendering instructions, and displays the rendering results on the terminal device display.
[0226] Thus, in the above update scheme, by marking the dirty area for update, layout of dirty area and rendering of dirty area, and performing the corresponding update, layout and drawing operations at the corresponding stage, the update mechanism is triggered when the display data changes. This ensures that the interface display content is synchronized with the real-time graphic data, and the page can be updated in time to adapt to the changing page requirements.
[0227] For example, Figure 7 As shown, another interface display method provided in an embodiment of the present application includes the following steps S701-S704.
[0228] S701: A terminal device calls a first interface of a first application in response to a first operation of a user on a first application.
[0229] In the embodiment of the present application, the first application is an application program that implements a 3D function. For example, the first application is a game application that includes 3D objects (such as 3D game characters, buildings, etc.).
[0230] In an embodiment of the present application, the first operation may be a preset operation for triggering the first application of the terminal device to display the first object. Optionally, the preset operation includes a preset shortcut operation or a voice command. The embodiment of the present application does not limit the specific implementation form of the first operation.
[0231] In an embodiment of the present application, the first object is a visual object that can be displayed on a screen of a terminal device. For example, the visual object includes visual elements in various forms such as images, texts, buttons, and icons.
[0232] In the embodiment of the present application, the first interface is a functional interface in the first application for realizing the display of the first object, for example, an API interface.
[0233] In an embodiment of the present application, before the terminal device calls the first interface of the first application in response to the user's first operation on the first application, the method also includes: the terminal device installs the first application based on the application installation package of the first application.
[0234] The application installation package includes an executable file, and the executable file includes a first interface and a second interface. The first interface and the second interface are both interfaces implemented according to the 3D declarative paradigm.
[0235] In an embodiment of the present application, a terminal device receives a first operation of a user on a first application, and in response to the first operation, calls a first interface in the first application.
[0236] It is understandable that multiple functions can be implemented in the first application, and each function has its corresponding functional interface. The terminal device determines the function that the user intends to implement according to the user's first operation, and calls the interface corresponding to the function to implement the function.
[0237] S702. The terminal device displays a first interface of a first application. The first interface includes a first object of the first application. The type of the first object is a 3D type. The first interface is used to implement display of the first object.
[0238] In the embodiment of the present application, the first interface is a display interface including a first object.
[0239] In an embodiment of the present application, after the terminal device calls the first interface, the first object is displayed on the first interface.
[0240] In an embodiment of the present application, a terminal device displays a first interface of a first application, including: the terminal device calls a first interface to create a first 3D view object; the terminal device creates a first 3D component node object according to the first 3D view object, and creates a corresponding first 3D drawing node in the first 3D component node object; the terminal device renders according to the first 3D drawing node to generate a first object; the terminal device displays a first interface including the first object.
[0241] In an embodiment of the present application, after the terminal device displays the first interface, the method also includes: the terminal device adds the information of the object to be updated in the first interface to the first dirty area in response to the first indication; the first indication is used to trigger the terminal device to update the first interface; the information of the object to be updated includes the identification number of the object to be updated; the terminal device updates the object data of the object to be updated according to the information of the object to be updated in the first dirty area; the object data includes attribute data and / or conditional variables; the terminal device determines the first update object among the objects to be updated, and the first update object includes the object to be updated whose object data changes before and after the update; the terminal device determines the associated object in the first interface that has a parent-child relationship with the first update object, and adds the information of the first update object and the information of the associated object to the second dirty area; the terminal device updates the first interface according to the information of the component in the second dirty area.
[0242] S703. The terminal device calls a second interface of the first application in response to a second operation of the user on the first application; wherein the first interface and the second interface are interfaces determined based on the same coding rule, and the type of the coding rule is declarative.
[0243] In the embodiment of the present application, the second operation may be a preset operation for triggering the first application of the terminal device to display the second object.
[0244] In the embodiment of the present application, the second interface is a functional interface in the first application for realizing the display of the second object.
[0245] In an embodiment of the present application, the encoding rules include 3D declarative paradigm rules.
[0246] In the embodiment of the present application, both the first interface and the second interface are interfaces implemented according to the 3D declarative paradigm.
[0247] Optionally, the first interface or the second interface includes any one or more of the following: an interface for setting a 3D model and creating a 3D object, an interface for setting whether the camera in the 3D scene can move, an interface for setting the background of the 3D scene, an interface for setting transparency, an interface for adding custom drawn objects, an interface for adding a cube, an interface for adding a sphere, an interface for adding a cone, and an interface for setting 3D motion effects.
[0248] S704. The terminal device displays a second interface of the first application; the second interface includes a second object of the first application, the type of the second object is a 3D type, and the second interface is used to implement the display of the second object.
[0249] In the embodiment of the present application, the second interface is a display interface including a second object.
[0250] In the embodiment of the present application, after the terminal device calls the second interface, the second object is displayed on the second interface.
[0251] In an embodiment of the present application, a terminal device displays a second interface of a first application, including: the terminal device calls a second interface to create a second 3D view object; the terminal device creates a second 3D component node object according to the second 3D view object, and creates a corresponding second 3D drawing node in the second 3D component node object; the terminal device renders according to the second 3D drawing node to generate a second object; and the terminal device displays a second interface including the second object.
[0252] In some other embodiments of the present application, the method further includes: the terminal device calls the third interface of the first application in response to the user's third operation on the first application; and the terminal device displays the third interface of the first application.
[0253] The third interface is a functional interface for realizing display of a third object in the first application, and the third interface is an interface realized according to a 2D declarative paradigm.
[0254] In the embodiment of the present application, the application development framework of the 3D declarative paradigm and the 2D declarative paradigm are the same.
[0255] The third interface includes a third object of the first application, and the type of the third object is a 2D type.
[0256] In a possible implementation, taking an application scenario in which the third interface only includes 2D objects and displays the 2D objects separately as an example, the terminal device displays the third interface of the first application, including: the terminal device calls the third interface to create a 2D view object; the terminal device creates a 2D component node object based on the 2D view object, and creates a corresponding 2D drawing node in the 2D component node object; the terminal device renders based on the 2D drawing node to generate a third object; the terminal device displays the third interface including the third object.
[0257] In another possible implementation, taking the third interface including both 2D objects and 3D objects and displaying scenes of 2D objects and 3D objects at the same time (such as a game scene, a user avatar or name is a 2D visualization element, and a game character or game scene is a 3D visualization element) as an example, the terminal device displays the third interface of the first application, including: the terminal device calls the second interface to create a second 3D view object; the terminal device creates a second 3D component node object according to the second 3D view object, and creates a corresponding second 3D drawing node in the second 3D component node object; the terminal device calls the third interface to create a 2D view object; the terminal device creates a 2D component node object according to the 2D view object, and creates a corresponding 2D drawing node in the 2D component node object; the terminal device renders according to the second 3D drawing node and the 2D drawing node based on a unified rendering algorithm to generate a second object and a third object; the terminal device displays a third interface including the second object and the third object.
[0258] In another possible implementation, taking the scenario in which the third interface includes both 2D objects and 3D objects and displays both 2D objects and 3D objects at the same time as an example, the terminal device displays the third interface of the first application, including: the terminal device calls the second interface to create a second 3D view object; the terminal device creates a second 3D component node object according to the second 3D view object, and creates a corresponding second 3D drawing node in the second 3D component node object; the terminal device renders according to the second 3D drawing node to generate a second object; the terminal device calls the third interface to create a 2D view object; the terminal device creates a 2D component node object according to the 2D view object, and creates a corresponding 2D drawing node in the 2D component node object; the terminal device renders according to the 2D drawing node to generate a third object; the terminal device displays a third interface including the second object and the third object.
[0259] In this way, when displaying 2D objects and 3D objects at the same time, the 2D objects and the 3D objects can be rendered in a unified rendering manner and in separate rendering manners, thereby achieving fusion display of 2D and 3D.
[0260] The interface display method provided in the embodiment of the present application completes the development and deployment of 3D applications based on a unified 3D declarative paradigm, reducing the learning cost and development difficulty. Moreover, by following the first 3D declarative paradigm to design APIs with different functions, it is possible to finely control scenes or models, achieve better display effects, and improve user experience.
[0261] For example, Figure 8As shown, an interactive schematic diagram of an interface display method for implementing the technical solution of an embodiment of the present application. The developer generates a development file (also understood as an application code) according to the first 3D declarative paradigm, and then compiles the development file into an executable file through the editing tool chain. The terminal device on the development side packages the executable file into an application installation package of the application. After installing the application, the terminal device on the application side creates a view object (such as a 3DJSView C++ object) according to the executable file, and creates multiple component node objects (such as 3D components, scene viewer components (sceneviewer compoenet), etc.) on the view object, and binds the parameters of the calculation component node object (such as layout, color, texture, shadow and other parameters) to the component node object. Subsequently, a rendering node (or described as a drawing node) is created, and the parameters of the component node object are applied to the rendering node. The rendering node starts the back-end rendering service (render service) according to the acquired parameters, and the back-end rendering service transmits the parameters to the 3D engine (engine), and the rendering operation is completed by the 3D engine. At the same time, the back-end rendering service will share the rendering context (render context) in the GPU to speed up the rendering efficiency. The 3D engine completes the rendering operation and generates a rendering result (such as a texture layer), and synthesizes the rendering result and displays it on the screen.
[0262] The rendering node may include multiple types of rendering nodes, such as rosen sceneviewer render and flutter sceneviewer render.
[0263] The system architecture and business scenarios described in this application are intended to more clearly illustrate the technical solutions of this application, and do not constitute the sole limitation on the technical solutions provided by this application. A person of ordinary skill in the art will appreciate that, with the evolution of the system architecture and the emergence of new business scenarios, the technical solutions provided by this application are equally applicable to similar technical problems.
[0264] It is understandable that, in order to realize the above functions, the above terminal device includes a hardware structure and / or software module corresponding to each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present application.
[0265] The embodiment of the present application can divide the functional modules of the above-mentioned terminal device according to the above-mentioned method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0266] like Fig. 9 , which is a schematic diagram of the structure of another terminal device provided in an embodiment of the present application, and the terminal device 900 can be used to implement the methods described in the above method embodiments. Exemplarily, the terminal device 900 may specifically include: a processing module 901, an acquisition module 902, and a display module 903.
[0267] The processing module 901 is used to execute the support terminal device 900 to execute Figures 3 to 7 The processing function of any one of the items.
[0268] The acquisition module 902 is used to execute the support terminal device 900 to execute Figures 3 to 7 The acquisition function of any item in. For example, obtaining the currently displayed image, etc.
[0269] The display module 903 may be used to display a screen according to the display driving data, etc. And / or, the display module 903 may also be used to support the terminal device 900 to perform other display operations performed by the terminal device in the embodiment of the present application.
[0270] Optional, Fig. 9 The terminal device 900 shown may also include a communication module ( Fig. 9 ), a communication module, which is used to support the terminal device 900 in executing the steps of communication between the terminal device and other devices in the embodiment of the present application.
[0271] Optional, Fig. 9 The terminal device 900 shown may also include a storage module ( Fig. 9 (not shown in the figure), the storage module stores programs or instructions. When the processing module 901 executes the program or instruction, Fig. 9 The terminal device 900 shown can execute the method shown in the above method embodiment.
[0272] Fig. 9 The technical effects of the terminal device 900 shown can refer to the technical effects of the method described in the above method embodiment, and will not be repeated here. Fig. 9The processing module 901 involved in the terminal device 900 shown can be implemented by a processor or a processor-related circuit component, which can be a processor or a processing module. The communication module can be implemented by a transceiver or a transceiver-related circuit component, which can be a transceiver or a transceiver module. The display module 903 can be implemented by display screen-related components.
[0273] The present application also provides a chip system, such as Fig.10 As shown, the chip system 1000 includes at least one processor 1001 and at least one interface circuit 1002. As an example, when the chip system 1000 includes a processor and an interface circuit, the processor may be Fig.10 The processor 1001 shown in the solid line frame (or the processor 1001 shown in the dotted line frame) may be an interface circuit. Fig.10 The interface circuit 1002 shown in the solid line frame (or the interface circuit 1002 shown in the dotted line frame). When the chip system 1000 includes two processors and two interface circuits, the two processors include Fig.10 The processor 1001 shown in the solid line frame and the processor 1001 shown in the dotted line frame, the two interface circuits include Fig.10 The interface circuit 1002 shown in the solid line frame and the interface circuit 1002 shown in the dotted line frame are not limited to this.
[0274] The processor 1001 and the interface circuit 1002 can be interconnected via a line. For example, the interface circuit 1002 can be used to receive a signal. For another example, the interface circuit 1002 can be used to send a signal to another device (such as the processor 1001). Exemplarily, the interface circuit 1002 can read instructions stored in a memory and send the instructions to the processor 1001. When the instructions are executed by the processor 1001, the various steps in the above embodiment can be executed. Of course, the chip system can also include other discrete devices, which is not specifically limited in the embodiments of the present application.
[0275] Optionally, there may be one or more processors in the chip system. The processor may be implemented by hardware or by software. When implemented by hardware, the processor may be a logic circuit, an integrated circuit, etc. When implemented by software, the processor may be a general-purpose processor implemented by reading software code stored in a memory.
[0276] Optionally, the chip system may further include a memory ( Fig.10As shown in the figure, the memory may be one or more, and the memory may be integrated with the processor or may be separately arranged with the processor, which is not limited in the present application. Exemplarily, the memory may be a non-transient processor, such as a read-only memory (ROM), which may be integrated with the processor on the same chip or may be arranged on different chips, and the present application does not specifically limit the type of memory and the arrangement of the memory and the processor.
[0277] Exemplarily, the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD), or other integrated chips.
[0278] It should be understood that each step in the above method embodiment can be completed by an integrated logic circuit of hardware in a processor or by instructions in the form of software. The method steps disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware processor, or by a combination of hardware and software modules in a processor.
[0279] The embodiment of the present application also provides a computer storage medium, in which computer instructions are stored. When the computer instructions are executed on a terminal device, the terminal device executes the method described in the above method embodiment.
[0280] Computer-readable storage media include, but are not limited to, any of the following: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and other media that can store program codes.
[0281] An embodiment of the present application provides a computer program product, which includes: a computer program or instructions, when the computer program or instructions are executed on a computer, the computer executes the method described in the above method embodiment.
[0282] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory so that the device executes the methods in the above-mentioned method embodiments.
[0283] Among them, the terminal device, computer storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here.
[0284] The steps of the method or algorithm described in conjunction with the disclosure of the embodiments of the present application can be implemented in hardware or by executing software instructions by a processor. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (RAM), flash memory, read-only memory, erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, compact disc read-only memory (CD-ROM) or any other form of storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC).
[0285] Through the description of the above implementation methods, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed; that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0286] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The various embodiments can be combined with each other or referenced to each other without conflict. The device embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0287] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0288] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0289] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the software product is stored in a storage medium, including a number of instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0290] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. An interface display method, characterized in that: include: The terminal device calls a first interface of the first application in response to a first operation of the user on the first application; The terminal device displays a first interface of the first application, where the first interface includes a first object of the first application; the type of the first object is a 3D type, and the first interface is used to implement display of the first object; The terminal device calls a second interface of the first application in response to a second operation of the user on the first application; wherein the first interface and the second interface are interfaces determined based on the same coding rule; and the type of the coding rule is declarative; The terminal device displays a second interface of the first application, where the second interface includes a second object of the first application; the type of the second object is a 3D type, and the second interface is used to implement display of the second object.
2. The method according to claim 1, characterized in that The encoding rules include 3D declarative paradigm rules; Before the terminal device calls the first interface of the first application in response to the first operation of the user on the first application, the method further includes: The terminal device installs the first application based on the application installation package of the first application; wherein the application installation package includes an executable file, and the executable file includes the first interface and the second interface; the first interface and the second interface are both interfaces implemented according to the 3D declarative paradigm.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: The terminal device calls a third interface of the first application in response to a third operation of the user on the first application; wherein the third interface is an interface implemented according to a 2D declarative paradigm; The terminal device displays a third interface of the first application; wherein the third interface includes a third object of the first application, the type of the third object is a 2D type, and the third interface is used to implement the display of the third object.
4. The method according to claim 1 or 2, characterized in that: The terminal device displays a first interface of the first application, including: The terminal device calls the first interface to create a first 3D view object; The terminal device creates a first 3D component node object according to the first 3D view object, and creates a corresponding first 3D rendering node in the first 3D component node object; The terminal device performs rendering according to the first 3D rendering node to generate the first object; The terminal device displays the first interface including the first object.
5. The method according to claim 3, characterized in that: The terminal device displays a third interface of the first application, including: The terminal device calls the third interface to create a 2D view object; The terminal device creates a 2D component node object according to the 2D view object, and creates a corresponding 2D drawing node in the 2D component node object; The terminal device performs rendering according to the 2D drawing node to generate the third object; The terminal device displays the third interface including the third object.
6. The method according to claim 3, characterized in that The terminal device displays a third interface of the first application, including: The terminal device calls the second interface to create a second 3D view object; The terminal device creates a second 3D component node object according to the second 3D view object, and creates a corresponding second 3D rendering node in the second 3D component node object; The terminal device calls the third interface to create a 2D view object; The terminal device creates a 2D component node object according to the 2D view object, and creates a corresponding 2D drawing node in the 2D component node object; The terminal device performs rendering according to the second 3D rendering node and the 2D rendering node based on a unified rendering algorithm to generate the second object and the third object; The terminal device displays the third interface including the second object and the third object.
7. The method according to any one of claims 3 to 6, characterized in that: The first interface and the second interface are both interfaces implemented according to the 3D declarative paradigm; the application development framework of the 3D declarative paradigm and the 2D declarative paradigm are the same.
8. The method according to claim 7, characterized in that The first interface or the second interface includes any one or more of the following: an interface for setting a 3D model and creating a 3D object, an interface for setting whether the camera in the 3D scene can move, an interface for setting the background of the 3D scene, an interface for setting transparency, an interface for adding custom drawn objects, an interface for adding a cube, an interface for adding a sphere, an interface for adding a cone, and an interface for setting 3D motion effects.
9. The method according to any one of claims 1 to 8, characterized in that: After the terminal device displays the first interface, the method further includes: The terminal device adds information of the object to be updated in the first interface to the first dirty area in response to the first indication; the first indication is used to trigger the terminal device to update the first interface; the information of the object to be updated includes an identification number of the object to be updated; The terminal device updates object data of the object to be updated according to information of the object to be updated in the first dirty area; the object data includes attribute data and / or conditional variables; The terminal device determines a first update object among the objects to be updated, where the first update object includes the object to be updated whose object data changes before and after the update; The terminal device determines, in the first interface, an associated object that has a parent-child relationship with the first update object, and adds information about the first update object and information about the associated object to a second dirty area; The terminal device updates the first interface according to the information of the components in the second dirty area.
10. A terminal device, characterized in that: include: one or more processors; Memory; One or more computer programs are stored in the memory, and the one or more computer programs include instructions. When the instructions are executed by the terminal device, the terminal device executes the method according to any one of claims 1 to 9.