Method and device for executing display function, terminal equipment and storage medium
By utilizing pre-configured XML files and function registry entries on the Android platform to dynamically call the configuration parameters and function objects of view components, the problem of repetitive code modification in the development of card components on TV is solved, achieving efficient function expansion and maintenance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN TCL NEW-TECH CO LTD
- Filing Date
- 2026-01-13
- Publication Date
- 2026-05-15
AI Technical Summary
On the Android platform, during the development of the TV card component, whenever a new function needs to be added or the display format needs to be adjusted, both the XML file and the Java/Kotlin code must be modified, resulting in a large workload and the possibility of omissions.
By receiving execution instructions from view components, determining configuration parameter values and function objects, and utilizing pre-configured XML files and function registry entries, the application's own business functions can be dynamically invoked without rewriting code in each view component.
It significantly reduces development workload, lowers maintenance costs, improves code reusability and system flexibility, and simplifies the process of feature expansion and maintenance.
Smart Images

Figure CN122053902A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of software engineering technology, and specifically to a method, apparatus, terminal device, and storage medium for performing display functions. Background Technology
[0002] On the Android platform, TV card components are typically built using custom views. Developers need to write programs based on Java or Kotlin code and use Extensible Markup Language (XML) layout files to define the appearance and interaction logic of the cards.
[0003] In this development model, whenever any card component needs to add new features or adjust its display, it is often necessary to modify both the corresponding XML file and the Java / Kotlin code, resulting in a large workload and frequent changes, and making it easy to overlook certain aspects. Summary of the Invention
[0004] This application provides a method, apparatus, terminal device, and storage medium for performing display functions, enabling view components to call the business functions inherent in the application itself, without having to rewrite code in each view component to implement a certain display function, significantly reducing development workload and lowering maintenance costs.
[0005] The technical solution adopted by this invention to solve the problem is as follows: On one hand, this application provides a method for performing a display function, comprising: Receive the execution instruction for the first display function in the view component; In response to the execution command, determine the configuration parameter values and function object corresponding to the first display function; Based on the configuration parameter values and the function object, the program used to implement the first display function is executed, and the execution result of the first display function is obtained.
[0006] In some embodiments of this application, in response to an execution instruction, the configuration parameter values and function objects corresponding to the first display function are determined, including: Based on a pre-configured Extensible Markup Language (XML) file, determine the configuration parameter values corresponding to the first display function; Based on the pre-configured function registry, determine the function object corresponding to the first display function.
[0007] In some embodiments of this application, the configuration parameter values corresponding to the first display function are determined based on a pre-configured Extensible Markup Language (XML) file, including: The configuration parameter value corresponding to the first function identifier of the first display function is read from the XML file through the attribute collection interface.
[0008] In some embodiments of this application, before determining the configuration parameter values corresponding to the first display function based on a pre-configured Extensible Markup Language (XML) file, the method further includes: In the XML file, the first display function is declared based on the first function identifier, along with the configuration parameter values corresponding to the first display function.
[0009] In some embodiments of this application, a program for implementing a first display function is executed based on configuration parameter values and a function object, and the execution result of the first display function is obtained, including: Input the configuration parameter values into the function object so that the function object executes the program used to implement the first display function and obtains the execution result.
[0010] In some embodiments of this application, in response to an execution instruction, determining the configuration parameter value and function object corresponding to the first display function further includes: Get the current state of the view component; If the current state meets the execution conditions for the first display function, in response to the execution instruction, the configuration parameter values and function objects corresponding to the first display function are determined.
[0011] In some embodiments of this application, the method further includes: Receive instructions to add new functions for the second display function; The response function adds a new instruction, which declares the second display function in the XML file based on the second function identifier of the second display function, as well as the configuration parameter values corresponding to the second display function; Add the corresponding function object for the second display function to the function registry so that the view component supports the second display function.
[0012] Secondly, embodiments of the present invention also provide an apparatus for performing a display function, comprising: The receiving module is used to receive the execution instructions of the first display function in the view component; The determination module is used to determine the configuration parameter values and function objects corresponding to the first display function in response to the execution command; The execution module is used to execute the program for implementing the first display function based on the configuration parameter values and the function object, and obtain the execution result of the first display function.
[0013] Thirdly, this application also provides a terminal device, which includes: One or more processors; Memory; and One or more applications, wherein the applications are stored in memory and configured to be executed by a processor to implement the method of performing display functions of any of the first aspects.
[0014] Fourthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, the computer program being loaded by a processor to perform the steps of the method for performing display functions according to any one of the first aspects.
[0015] The beneficial effects of this invention are as follows: By determining the configuration parameter values corresponding to the display function, calling the function objects included in the application itself, executing the program in the function object used to implement the display function, and obtaining the execution result, the view component can call the business functions of the application itself without having to rewrite code in each view component to implement a certain display function, which significantly reduces the development workload and lowers the maintenance cost. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a schematic diagram of a system for performing display functions according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating one embodiment of the method for performing a display function provided by this invention. Figure 3 This is a schematic diagram of the display of the TV-end card component provided in an embodiment of the present invention; Figure 4 This is a flowchart illustrating a specific embodiment of the display function provided in this invention. Figure 5 This is a schematic block diagram of the device for performing display functions provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of an embodiment of the terminal device provided in this invention. Detailed Implementation
[0018] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0019] In the description of this application, the terms "first," "second," "third," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first," "second," "third," etc., may explicitly or implicitly include one or more of the stated features.
[0020] In this application, the term "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described as "exemplary" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use this application. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that this application can be made without using these specific details. In other instances, well-known structures and processes are not described in detail to avoid obscuring the description of this application with unnecessary detail. Therefore, this application is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0021] It should be noted that since the method in this application embodiment is executed in a terminal device, the processing objects of each terminal device exist in the form of data or information, such as time, which is essentially time information. It can be understood that if size, quantity, position, etc. are mentioned in subsequent embodiments, they are all corresponding data that exist so that the terminal device can process them. Specific details will not be elaborated here.
[0022] This application provides a method, apparatus, terminal device, and storage medium for performing display functions, which will be described in detail below.
[0023] Please see Figure 1 , Figure 1 This is a schematic diagram of a system for performing display functions according to an embodiment of this application. The system for performing display functions may include a terminal device 100, which integrates a device for performing display functions, such as... Figure 1 Terminal devices in the process.
[0024] In this embodiment, the terminal device 100 is mainly used to receive the execution instruction of the first display function in the view component; in response to the execution instruction, determine the configuration parameter value and function object corresponding to the first display function; execute the program to implement the first display function based on the configuration parameter value and function object, and obtain the execution result of the first display function, so that the view component can call the business function of the application itself, without having to rewrite the code in each view component to implement a certain display function, which significantly reduces the development workload and reduces maintenance costs.
[0025] In this embodiment, the terminal device 100 can be an independent server, a server network, or a server cluster. For example, the terminal device 100 described in this embodiment includes, but is not limited to, a computer, a network host, a single network server, a set of multiple network servers, or a cloud server composed of multiple servers. The cloud server is composed of a large number of computers or network servers based on cloud computing.
[0026] It is understood that the terminal device 100 used in the embodiments of this application can be a device that includes both receiving and transmitting hardware, that is, a device having receiving and transmitting hardware capable of performing bidirectional communication on a bidirectional communication link. Such a device may include: cellular or other communication devices having a single-line display, a multi-line display, or a cellular or other communication device without a multi-line display. Specifically, the terminal device 100 may be a desktop terminal or a mobile terminal, and the terminal device 100 may also be one of a mobile phone, tablet computer, laptop computer, etc.
[0027] Those skilled in the art will understand that Figure 1 The application environment shown is merely one application scenario of the solution in this application and does not constitute a limitation on the application scenario of the solution in this application. Other application environments may include those that are more specific to this application. Figure 1 The number of more or fewer terminal devices shown, for example Figure 1 Only one terminal device is shown in the image. It is understood that the system performing the display function may also include one or more other services, which are not specified here.
[0028] In addition, such as Figure 1 As shown, the system that performs the display function may also include a memory 200 for storing data, such as program data, such as the function object corresponding to the first display function, the function object corresponding to the second display function, etc., and configuration data, such as configuration parameter values, etc.
[0029] It should be noted that, Figure 1 The schematic diagram of the system performing the display function shown is merely an example. The system and scenario for performing the display function described in this application embodiment are for the purpose of more clearly illustrating the technical solution of this application embodiment and do not constitute a limitation on the technical solution provided by this application embodiment. As those skilled in the art will know, with the evolution of the system performing the display function and the emergence of new business scenarios, the technical solution provided by this application embodiment is also applicable to similar technical problems.
[0030] First, this application provides a method for executing a display function. The executing entity of this method is a device for executing a display function, which is applied to a terminal device. The method for executing a display function includes: receiving an execution instruction for a first display function in a view component; in response to the execution instruction, determining the configuration parameter value and function object corresponding to the first display function; and executing a program for implementing the first display function based on the configuration parameter value and function object to obtain the execution result of the first display function.
[0031] like Figure 2 The diagram shown is a flowchart of an embodiment of the method for performing a display function in this application. The method for performing a display function may include the following steps S201 to S203, as detailed below: Step S201: Receive the execution instruction of the first display function in the view component.
[0032] In one specific embodiment, the entity performing this step can be an application software on the television, which displays content in various styles based on a custom view. For example, the content can be displayed in the form of cards, such as... Figure 3 As shown, the TV app can recommend movies in the form of cards.
[0033] In this context, the view component refers to a custom View component used to display content in card format. The first display function can be a specific function executed on the user interface that is related to content display or user interaction, such as playing a video or displaying a carousel of posters; this embodiment does not impose specific limitations. The execution command is the command that triggers the execution of the first display function, and can be generated by user interaction (such as clicking or swiping) or system events (such as scheduled tasks or data updates); this embodiment does not impose specific limitations. For example, a user clicking the "play" button on a card will generate an execution command to "play video".
[0034] In this embodiment, user or system operations can be converted into processable instructions to ensure the initiation of the function call process. For example, when a user clicks the "Carousel" button on a card, the system receives the "Start Carousel" execution instruction, providing a basis for subsequent steps. From the perspective of the underlying code implementation, this step means that when the application executes the program of the view component, it runs to a certain line of code that executes the first display function, at which point the application needs to execute the first display function.
[0035] Step S202: In response to the execution command, determine the configuration parameter value and function object corresponding to the first display function.
[0036] In one specific embodiment, the configuration parameter values are parameters required for the operation of the first display function, such as the interval time of the carousel function (interval=5000ms) and the video ID of the playback function (videoId="123"). Configuration parameter values can be declared through an XML file and can be stored in key-value pairs for easy unified management and dynamic adjustment. A function object refers to a program module that implements a specific function; essentially, it is a set of predefined fixed capabilities, such as playing video (PlayVideoCapability) and opening a details page (OpenDetailPageCapability). It's important to note that a function object is an independent, reusable, fixed capability module implemented in the application. It's not bound to any specific view component but exists as a global capability, providing services to multiple view components. Function objects are typically implemented as classes, containing one or more methods to perform display functions. For example, a carousel function object (CarouselCapability) is used to implement timed image switching; a play function object (PlayVideoCapability) is used to call a media player to load and play videos.
[0037] Step S203: Execute the program used to implement the first display function based on the configuration parameter values and the function object, and obtain the execution result of the first display function.
[0038] In one specific embodiment, the execution result refers to the output after the function is run, which may be a UI update (such as switching carousel images), data return (such as video playback address), or status change (such as playback progress update). In this embodiment, configuration parameter values can be passed to a function object to trigger the execution of a specific function, and the execution result can be returned to update the UI or drive subsequent logic. For example, the carousel function switches images periodically according to the interval parameter, and the playback function loads the corresponding video according to the videoId.
[0039] Compared to related technologies where the code for the functions required by each card component is repeatedly written in the code of each card component, the method of this application enables the view component to call the business functions that the application itself has, without having to rewrite the code in each view component to implement a certain display function, which significantly reduces the workload of development and lowers the maintenance cost.
[0040] In one specific embodiment, in response to an execution instruction, determining the configuration parameter value and function object corresponding to the first display function includes: determining the configuration parameter value corresponding to the first display function based on a pre-configured Extensible Markup Language (XML) file; and determining the function object corresponding to the first display function based on a pre-configured function registry.
[0041] This embodiment describes how an application, upon receiving an execution instruction, specifically determines the configuration parameter values and function objects required for the first display function. Extensible Markup Language (XML) is a markup language used for storing and transmitting data. Its characteristics include clear structure, ease of reading and writing, and support for custom tags. The XML file is pre-configured and contains various display function identifiers and required configuration parameter values, such as color, size, position, and animation effects. The function registry is a data structure maintained by the application to store the mapping relationship between function identifiers and function implementation objects. Each display function has a unique function identifier and corresponds to a function object that implements that function.
[0042] The application parses the XML file and finds the corresponding configuration parameter values based on the function identifier of the first displayed function (such as "fun1"). These configuration parameter values are used in subsequent function execution to ensure that the function is displayed as expected. The application also queries the function registry to find the corresponding function object based on the function identifier of the first displayed function. The function object is responsible for executing the specific display logic to achieve the required functional effect.
[0043] In one specific embodiment, determining the configuration parameter value corresponding to the first display function based on a pre-configured Extensible Markup Language (XML) file includes: reading the configuration parameter value corresponding to the first function identifier of the first display function from the XML file through an attribute collection interface.
[0044] In this embodiment, the attribute set interface refers to the AttributeSet interface provided in the Android framework, which is used to parse custom attributes from the XML layout file during the initialization of a custom view. This interface allows the reading of tag attribute values defined in the XML.
[0045] In one specific embodiment, before determining the configuration parameter value corresponding to the first display function based on a pre-configured Extensible Markup Language (XML) file, the method further includes: declaring the first display function and the configuration parameter value corresponding to the first display function in the XML file based on the first function identifier.
[0046] In this embodiment, the display functions required by the view components can be declared in advance in an XML file (by defining the function identifiers) and their configuration parameter values. This allows for direct retrieval of this information by reading the XML file during subsequent development and maintenance, eliminating the need to hardcode these functions and their parameters in the implementation code of each view component. This approach significantly improves code reusability and maintainability, and reduces development costs. For example, if multiple card components need to implement a "carousel" function, the function identifier "fun1" and its configuration parameter values (such as...) can be uniformly declared in XML. <function name="fun1" interval="5000" / > Then, in the function registry, "fun1" is matched with the application's carousel function object "CarouselCapability", which allows the function and its parameters to be configured once and reused in multiple places.
[0047] In one specific embodiment, executing a program to implement a first display function based on configuration parameter values and a function object, and obtaining the execution result of the first display function, includes: inputting configuration parameter values into the function object so that the function object executes the program to implement the first display function, and obtaining the execution result.
[0048] In this embodiment, configuration parameter values defined in the XML file can be dynamically passed to the functional object, triggering the functional object to execute the corresponding business logic, thereby achieving the specific effect of the first display function. This demonstrates that view components can flexibly call fixed functions already implemented within the application and execute them according to preset parameters, without having to rewrite the function code and set the parameters in each view component.
[0049] In one specific embodiment, in response to the execution statement, determining the configuration parameter value and function object corresponding to the first display function further includes: obtaining the current state of the view component; and if the current state meets the execution conditions of the first display function, in response to the execution instruction, determining the configuration parameter value and function object corresponding to the first display function.
[0050] In this embodiment, the current state of the view component refers to its running state at a certain moment, such as whether it is visible, interactive, or performing other tasks. The execution condition refers to the conditions that the first display function must meet to execute normally, such as the view component being visible or not disabled.
[0051] By obtaining the current state of the view component and checking whether the execution conditions of the first display function are met before execution, the function can be avoided at inappropriate times, thus preventing abnormal interface display or functional conflicts. For example, if the view component is currently invisible (such as being obscured by other components or in the background), the carousel function does not need to be executed, saving system resources and avoiding unnecessary calculations.
[0052] In one specific embodiment, the method further includes: receiving a function addition instruction for the second display function; responding to the function addition instruction, declaring the second display function and the configuration parameter values corresponding to the second display function in an XML file based on the second function identifier of the second display function; and adding the function object corresponding to the second display function in the function registry so that the view component supports the second display function.
[0053] In this embodiment, the second display function is the display function to be added. The function addition instruction is a command triggered by the developer or the system, explicitly requiring the addition of a new display function to the view component. It may be generated through user interface operations, API calls, or configuration file modifications. The second function identifier is a unique name or code that identifies the second display function, used to accurately locate the function in the XML file and function registry.
[0054] Since both configuration parameter values and function objects are managed through external XML files and function registry entries, modifying function behavior or adding new functions only requires modifying the corresponding XML files and registry entries. The XML file declares the second function identifier and the corresponding configuration parameter value, and the function registry adds the correspondence between the second function identifier and the corresponding function object. No source code needs to be modified, which greatly reduces maintenance costs and improves the system's flexibility and scalability.
[0055] Furthermore, because the functional execution logic is decoupled from the view components, different view components can share the same functional implementation, further improving code reusability.
[0056] As a specific implementation method, such as Figure 4 As shown, the application first loads the XML layout file to initialize the interface structure, and then instantiates the custom card view. During the parsing phase, the application extracts functionNames and other attribute parameters from the XML to clarify the function identifiers and configuration information to be called. Then, by matching the parsed function identifiers with the pre-maintained function registry, the application can dynamically locate the corresponding function object. After a successful match, the application executes the fixed function logic and performs parameterized operation in combination with the parameters defined in the XML. Finally, the execution result is returned and rendered to the user interface to complete the function presentation.
[0057] The method provided in this application completely decouples function definition from implementation. It uses XML files to declare functions and configuration parameters, and a function registry establishes the association between function identifiers and specific implementation objects. This allows developers to add new functions simply by declaring the function identifier and configuring the parameters in the XML file, and registering the corresponding function object in the registry, without modifying the underlying code of the view components. This significantly improves the efficiency of function expansion and reduces maintenance complexity.
[0058] To better implement the method for performing the display function in the embodiments of this application, based on the method for performing the display function, the embodiments of this application also provide an apparatus for performing the display function, such as... Figure 5 As shown, the device 500 that performs the display function includes: The receiving module 510 is used to receive the execution instruction of the first display function in the view component; The determination module 520 is used to determine the configuration parameter values and function objects corresponding to the first display function in response to the execution command; The execution module 530 is used to execute a program for implementing the first display function based on the configuration parameter values and the function object, and obtain the execution result of the first display function.
[0059] In this embodiment of the application, by determining the configuration parameter value corresponding to the display function, calling the function object included in the application itself, executing the program in the function object used to implement the display function, and obtaining the execution result, the view component can call the business function of the application itself without having to rewrite the code in each view component to implement a certain display function, which significantly reduces the development workload and lowers the maintenance cost.
[0060] In some embodiments of this application, the determining module 520, in response to an execution instruction, determines the configuration parameter values and function object corresponding to the first display function, including: Based on a pre-configured Extensible Markup Language (XML) file, determine the configuration parameter values corresponding to the first display function; Based on the pre-configured function registry, determine the function object corresponding to the first display function.
[0061] In some embodiments of this application, the determining module 520 determines the configuration parameter values corresponding to the first display function based on a pre-configured Extensible Markup Language (XML) file, including: The configuration parameter value corresponding to the first function identifier of the first display function is read from the XML file through the attribute collection interface.
[0062] In some embodiments of this application, before determining the configuration parameter value corresponding to the first display function based on a pre-configured Extensible Markup Language (XML) file, the determining module 520 is further configured to: In the XML file, the first display function is declared based on the first function identifier, along with the configuration parameter values corresponding to the first display function.
[0063] In some embodiments of this application, the execution module 530 executes a program for implementing a first display function based on configuration parameter values and a function object, and obtains the execution result of the first display function, including: Input the configuration parameter values into the function object so that the function object executes the program used to implement the first display function and obtains the execution result.
[0064] In some embodiments of this application, the determining module 520, in response to an execution instruction, determines the configuration parameter values and function object corresponding to the first display function, and further includes: Get the current state of the view component; If the current state meets the execution conditions for the first display function, in response to the execution instruction, the configuration parameter values and function objects corresponding to the first display function are determined.
[0065] In some embodiments of this application, the apparatus 500 for performing the display function is further configured to: Receive instructions to add new functions for the second display function; The response function adds a new instruction, which declares the second display function in the XML file based on the second function identifier of the second display function, as well as the configuration parameter values corresponding to the second display function; Add the corresponding function object for the second display function to the function registry so that the view component supports the second display function.
[0066] This application embodiment also provides a terminal device, which integrates any of the devices for performing display functions provided in this application embodiment. The terminal device includes: One or more processors; Memory; and One or more applications, wherein the applications are stored in memory and configured to be executed by a processor, wherein the steps of the method for executing the display function in any of the embodiments described above are performed.
[0067] This application also provides a terminal device that integrates any of the devices for performing display functions provided in this application. For example... Figure 6 As shown, it illustrates a structural schematic diagram of the terminal device involved in the embodiments of this application. Specifically: The terminal device may include components such as a processor 601 with one or more processing cores, a memory 602 with one or more computer-readable storage media, a power supply 603, and an input unit 604. Those skilled in the art will understand that... Figure 6 The terminal device structure shown does not constitute a limitation on the terminal device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein: The processor 601 is the control center of the terminal device. It connects various parts of the terminal device via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 602, and by calling data stored in the memory 602, it performs various functions and processes data of the terminal device, thereby providing overall monitoring of the terminal device. Optionally, the processor 601 may include one or more processing cores; preferably, the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 601.
[0068] The memory 602 can be used to store software programs and modules. The processor 601 executes various functional applications and data processing by running the software programs and modules stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 602 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 602 may also include a memory controller to provide the processor 601 with access to the memory 602.
[0069] The terminal device also includes a power supply 603 that supplies power to the various components. Preferably, the power supply 603 can be logically connected to the processor 601 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 603 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0070] The terminal device may also include an input unit 604, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0071] Although not shown, the terminal device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 601 in the terminal device loads the executable files corresponding to the processes of one or more applications into the memory 602 according to the following instructions, and the processor 601 runs the applications stored in the memory 802 to realize various functions, as follows: Receive the execution instruction for the first display function in the view component; In response to the execution command, determine the configuration parameter values and function object corresponding to the first display function; Based on the configuration parameter values and the function object, the program used to implement the first display function is executed, and the execution result of the first display function is obtained.
[0072] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0073] Therefore, embodiments of this application provide a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), a magnetic disk, or an optical disk, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps of any of the methods for performing display functions provided in embodiments of this application. For example, the computer program loaded by the processor can execute the following steps: Receive the execution instruction for the first display function in the view component; In response to the execution command, determine the configuration parameter values and function object corresponding to the first display function; Based on the configuration parameter values and the function object, the program used to implement the first display function is executed, and the execution result of the first display function is obtained.
[0074] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the detailed descriptions of other embodiments above, which will not be repeated here.
[0075] In practice, each of the above units or structures can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units or structures, please refer to the previous method embodiments, which will not be repeated here.
[0076] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0077] The foregoing has provided a detailed description of a method, apparatus, terminal device, and storage medium for performing display functions according to embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for performing a display function, characterized in that, include: Receive the execution instruction for the first display function in the view component; In response to the execution instruction, determine the configuration parameter value and function object corresponding to the first display function; Based on the configuration parameter values and the functional object, a program for implementing the first display function is executed, and the execution result of the first display function is obtained.
2. The method for performing the display function according to claim 1, characterized in that, The step of determining the configuration parameter value and function object corresponding to the first display function in response to the execution instruction includes: Based on a pre-configured Extensible Markup Language (XML) file, determine the configuration parameter values corresponding to the first display function; Based on a pre-configured function registry, the function object corresponding to the first display function is determined.
3. The method for performing the display function according to claim 2, characterized in that, The determination of configuration parameter values corresponding to the first display function based on a pre-configured Extensible Markup Language (XML) file includes: The configuration parameter value corresponding to the first function identifier of the first display function is read from the XML file through the attribute collection interface.
4. The method for performing the display function according to claim 2, characterized in that, Before determining the configuration parameter values corresponding to the first display function based on a pre-configured Extensible Markup Language (XML) file, the method further includes: The XML file declares the first display function based on the first function identifier, as well as the configuration parameter values corresponding to the first display function.
5. The method for performing the display function according to claim 1, characterized in that, The step of executing a program to implement the first display function based on the configuration parameter values and the function object, and obtaining the execution result of the first display function, includes: The configuration parameter values are input into the function object so that the function object executes a program to implement the first display function and obtains the execution result.
6. The method for performing the display function according to claim 1, characterized in that, The step of determining the configuration parameter value and function object corresponding to the first display function in response to the execution instruction further includes: Get the current state of the view component; If the current state meets the execution conditions of the first display function, in response to the execution instruction, the configuration parameter value and function object corresponding to the first display function are determined.
7. The method for performing the display function according to claim 2, characterized in that, Also includes: Receive instructions to add new functions for the second display function; In response to the function addition instruction, the second display function is declared in the XML file based on the second function identifier of the second display function, as well as the configuration parameter values corresponding to the second display function; Add the function object corresponding to the second display function to the function registry so that the view component supports the second display function.
8. A device for performing a display function, characterized in that, include: The receiving module is used to receive the execution instructions of the first display function in the view component; The determining module is used to determine the configuration parameter values and function objects corresponding to the first display function in response to the execution instruction; An execution module is used to execute a program to implement the first display function based on the configuration parameter values and the function object, and to obtain the execution result of the first display function.
9. A terminal device, characterized in that, The terminal device includes: one or more processors, a memory, and one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the method of performing display functions as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, It stores a computer program, which is loaded by a processor to perform the steps of the method for performing the display function as described in any one of claims 1 to 7.