User interface rendering method and device, electronic equipment and medium

By compiling, generating and dynamic library files in embedded system devices, the problem of full OTA upgrades required for the interface update of embedded system devices is solved, the system flexibility and dynamic update capabilities are improved, resource consumption is reduced, and system stability is enhanced.

CN120162041APending Publication Date: 2025-06-17GD MIDEA AIR CONDITIONING EQUIP CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311741128.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-15
Publication Date
2025-06-17

AI Technical Summary

Technical Problem

Embedded system devices require full OTA upgrades when updating interfaces or pages, resulting in lack of dynamics, high OTA upgrade costs and system stability risks.

Method used

Dynamic library files are generated by using source code files, custom function files and resource files, and dynamically distributed to the device. By linking dynamic library files, components are created based on dynamic library files, and the system flexibility and dynamic update capabilities are improved.

Benefits of technology

It realizes the flexibility of the system and the improvement of dynamic update capabilities, saves resources, improves efficiency, and ensures system stability, thereby better meeting the implementation of embedded screen dynamic pages and business needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120162041A_ABST
    Figure CN120162041A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and provides a user interface rendering method and device, electronic equipment and a medium, and the method comprises the steps: downloading a dynamic library file from a server based on a network request; the dynamic library file is obtained by compiling a source code file corresponding to a user interface configuration file, a user-defined function file required for configuring the user interface and a resource file; linking the dynamic library file, and initializing the dynamic library file; and calling a component creation function in the dynamic library file, creating at least one component, and rendering the component into a screen. The dynamic library file is generated by compiling the source code file, the user-defined function file and the resource file and is dynamically issued to the equipment, the flexibility and dynamic updating capacity of the system are improved by linking the dynamic library file and creating the component based on the dynamic library file, meanwhile, resources are saved, efficiency is improved, and system stability is guaranteed; therefore, the dynamic page and business requirements of the embedded screen end can be better met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular, to a user interface rendering method, apparatus, electronic device, and medium. Background Art

[0002] Embedded system devices usually use the Linux or RTOS system as the operating system, and at the same time use an application framework to implement the display of the user interface or page. In an embedded system, the update of the interface or page usually requires a full OTA (Over-the-Air Technology) upgrade. Even if there are only small changes, the entire firmware needs to be republished, which leads to the following problems: lack of dynamics, high OTA upgrade costs, and system stability risks. Summary of the Invention

[0003] This application aims to at least solve one of the technical problems existing in the prior art. For this purpose, this application proposes a user interface rendering method. By using source code files, custom function files, and resource files to compile and generate dynamic library files, and dynamically sending them to the device, by linking the dynamic library files and creating components based on the dynamic library files, the flexibility and dynamic update ability of the system are improved, while saving resources, improving efficiency, and ensuring system stability, so as to better meet the implementation of dynamic pages and business requirements on the embedded screen side.

[0004] This application also proposes a user interface rendering apparatus, an electronic device, and a storage medium.

[0005] According to the user interface rendering method of the first aspect embodiment of this application, it includes:

[0006] Downloading a dynamic library file from a server based on a network request; the dynamic library file is obtained by compiling the source code file corresponding to the user interface configuration file, the custom function file required for configuring the user interface, and the resource file;

[0007] Linking the dynamic library file and initializing the dynamic library file;

[0008] Invoking a component creation function in the dynamic library file to create at least one component and rendering the component to the screen.

[0009] By using source code files, custom function files, and resource files to compile and generate dynamic library files, and dynamically sending them to the device, by linking the dynamic library files and creating components based on the dynamic library files, the flexibility and dynamic update ability of the system are improved, while saving resources, improving efficiency, and ensuring system stability, so as to better meet the implementation of dynamic pages and business requirements on the embedded screen side.

[0010] According to an embodiment of the present application, calling the component creation function in the dynamic library file to create at least one component includes:

[0011] Obtain the address of the component creation function in the dynamic library file;

[0012] Based on the address of the component creation function, call the component creation function;

[0013] Based on the component attribute information and component layout information in the component creation function, create at least one component.

[0014] According to an embodiment of the present application, after calling the component creation function in the dynamic library file to create at least one component and rendering the component to the screen, it further includes:

[0015] Obtain the gesture event triggered by the user interface;

[0016] Run the custom function associated with the trigger component corresponding to the gesture event to call the function in the dynamic library file to execute the operation associated with the gesture event.

[0017] According to an embodiment of the present application, linking the dynamic library file includes:

[0018] Determine the path information and opening method of the dynamic library file;

[0019] Use the path information and the opening method as parameters of the linking function, and run the linking function to link the dynamic library file.

[0020] According to an embodiment of the present application, initializing the dynamic library file includes:

[0021] Call the initialization function;

[0022] Based on the initialization function, initialize the dynamic library file.

[0023] According to an embodiment of the present application, after downloading the dynamic library file from the server based on a network request, it further includes:

[0024] If the dynamic library file needs to be updated, send a Hypertext Transfer Protocol network request to the server;

[0025] Based on the target dynamic library file sent by the Hypertext Transfer Protocol network request, update the dynamic library file.

[0026] According to an embodiment of the present application, the source code file is generated based on the configuration information in the user interface configuration file; the source code file includes code files for component creation, component attribute setting, and component layout operations.

[0027] A user interface rendering device according to an embodiment of the second aspect of the present application includes:

[0028] A dynamic library file download module, configured to download a dynamic library file from a server based on a network request; the dynamic library file is obtained by compiling a user interface configuration file, a custom function file required for configuring the user interface, and a resource file;

[0029] A linking module, configured to link the dynamic library file and initialize the dynamic library file;

[0030] A rendering module, configured to call a component creation function in the dynamic library file to create at least one component and render the component to the screen.

[0031] An electronic device according to an embodiment of the third aspect of the present application includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the user interface rendering method described in any one of the above is implemented.

[0032] A non-transitory computer-readable storage medium according to an embodiment of the fourth aspect of the present application has a computer program stored thereon. When the computer program is executed by a processor, the user interface rendering method described in any one of the above is implemented.

[0033] One or more of the above technical solutions in the embodiments of the present application have at least one of the following technical effects:

[0034] By compiling source code files, custom function files, and resource files to generate a dynamic library file and dynamically distributing it to the device, creating components based on the linked dynamic library file, the flexibility and dynamic update ability of the system are improved, while resources are saved, efficiency is increased, and system stability is ensured, so as to better meet the implementation of dynamic pages and business requirements on embedded screens.

[0035] Additional aspects and advantages of the present application will be given in part in the following description, become apparent in part from the following description, or be learned through the practice of the present application. Description of the Drawings

[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0037] Figure 1It is one of the schematic flowcharts of the user interface rendering method provided by the embodiments of the present application;

[0038] Figure 2 It is the schematic flowchart of generating a dynamic library file provided by the embodiments of the present application;

[0039] Figure 3 It is the second schematic flowchart of the user interface rendering method provided by the embodiments of the present application;

[0040] Figure 4 It is the schematic module diagram of the user interface rendering device provided by the embodiments of the present application;

[0041] Figure 5 It is the schematic structural diagram of the electronic device provided by the embodiments of the present application. Detailed implementation manners

[0042] The following further describes the implementation manners of the present application in detail with reference to the accompanying drawings and embodiments. The following embodiments are used to illustrate the present application, but cannot be used to limit the scope of the present application.

[0043] In the description of the embodiments of the present application, it should be noted that the terms "first", "second", and "third" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance.

[0044] In the embodiments of the present application, unless otherwise clearly defined and limited, the first feature being "on" or "under" the second feature may be that the first and second features are in direct contact, or the first and second features are indirectly in contact through an intermediate medium. Moreover, the first feature being "above", "over" and "on" the second feature may be that the first feature is directly above or obliquely above the second feature, or merely indicates that the first feature has a higher horizontal height than the second feature. The first feature being "under", "below" and "beneath" the second feature may be that the first feature is directly below or obliquely below the second feature, or merely indicates that the first feature has a lower horizontal height than the second feature.

[0045] In the description of this specification, the descriptions with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the embodiments of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, without conflict, those skilled in the art may combine the different embodiments or examples described in this specification and the features of the different embodiments or examples.

[0046] It should be noted that in an embedded system, the update of the interface or page usually requires a full OTA upgrade. Even if there are only minor changes, the entire firmware needs to be republished, which leads to the following problems:

[0047] Lack of dynamics: Since the configuration information of the interface or page is usually statically embedded in the firmware, these information cannot be dynamically updated or modified during runtime. This results in a lack of flexibility in the system and makes it difficult to respond to changes in user requirements and optimization of the interface design.

[0048] High OTA upgrade cost: Full OTA upgrade requires the transmission of the entire firmware. Regardless of the actual size of the changes, it will increase the data transmission volume and upgrade time, and also increase the cost and complexity of system maintenance.

[0049] System stability risk: Frequent full OTA upgrades may pose risks to system stability. Especially when there are interruptions or errors during the transmission process, it may cause the device to malfunction.

[0050] Based on the above problems, the embodiments of this application provide a user interface rendering method. Figure 1 It is one of the flow diagrams of the user interface rendering method provided by the embodiments of this application. Referring to Figure 1 , the embodiments of this application provide a user interface rendering method, including:

[0051] Step 100, download a dynamic library file from the server based on a network request;

[0052] The execution subject of the embodiments of this application is an embedded application or an embedded device.

[0053] It should be noted that the dynamic library file is obtained by compiling the source code file corresponding to the user interface configuration file, the custom function file required for configuring the user interface, and the resource file. Among them, the source code file is generated based on the configuration information in the user interface configuration file; the source code file includes code files for component creation, component property setting, and component layout operations. Among them, the format of the user interface configuration file can be.json,.xml, and binary files compiled according to preset rules, the format of the source code file can be ui.c and ui.h, the format of the custom function file can be events.c and events.h, and the format of the resource file can be.ttf and.png.

[0054] For example, referring to Figure 2 , the steps for generating the dynamic library file are as follows:

[0055] Step a, parse the user interface configuration file, i.e., the UI (User Interface) configuration file: The application needs to read the UI configuration file and parse the fields therein, such as fields like type, styles, and layouts. Then, according to preset rules, these fields are converted into corresponding component class names, property information, layout information, etc.

[0056] Step b, generate the ui.c and ui.h source code files: Based on the parsed configuration information, generate the ui.c and ui.h source code files. In ui.c, functions for creating components can be written, including code for setting component properties and layouts. In ui.h, the dependent resources of the components can be declared for subsequent inclusion during compilation.

[0057] Step c, write custom code (i.e., custom function files): Write custom code, such as functions for implementing click events of components, utility functions, etc. These codes can be written separately into one or more source files.

[0058] Step d, prepare the resource files: Place the prepared resource files (such as images, style sheets, layout files, etc.) into a directory and ensure that the paths are accessible during the compilation process.

[0059] Step e, write a compilation script or project file: Create a compilation script or project file to tell the embedded application's provided compiler which source files need to be compiled and link them into a dynamic library file. At the same time, in the compilation script or project file, ensure that the paths to ui.c, custom function files, and resource files are included.

[0060] Step f, configure the compilation environment: According to the embedded application and compiler used, configure the compilation environment, including setting the compiler path, relevant compilation options, link libraries, etc.

[0061] Step g, execute the compilation: Run the compilation script or execute the compilation command in the command line to compile the ui.c and ui.h source code files, custom function files, and resource files together into a dynamic library file, such as a.so file or a.dll file.

[0062] Under the condition that the device starts up or receives a push / scheduled trigger, download the dynamic library file from the server (or remote server) through a network request. After the download is complete, save the dynamic library file at a specified location on the device. Among them, the network request refers to an HTTP (HyperText Transfer Protocol) request. Optionally, other protocols or technologies can also be used to obtain the dynamic library file, such as the File Transfer Protocol (FTP).

[0063] Step 200: Link the dynamic library file and initialize the dynamic library file;

[0064] In an embedded system, due to resource and memory limitations, dynamic link libraries are more flexible and space-saving than static link libraries. Therefore, in the embodiments of this application, the generated dynamic library file is embedded into the embedded application and dynamically loaded and linked when needed by the application program. It can be understood that linking a dynamic library file means associating a program with one or more dynamic library files during compilation and building of a program so that functions and resources provided in these dynamic library files can be used during runtime.

[0065] The embedded application uses the dlopen function to link the dynamic library file. Specifically, determine the path information and opening mode of the dynamic library file, and then use the path information and opening mode as parameters of the linking function, and run the linking function to link the dynamic library file. For example, the dlopen function is:

[0066] void* dlopen(const char* filename, int flag);

[0067] Among them, the filename parameter is a string pointing to the path containing the dynamic library file, and the flag parameter is used to specify the opening mode of the dynamic library file, such as lazy binding, immediate binding, etc. Among them, lazy binding means that functions and variables in the dynamic library are symbolically resolved and bound only when they are first called or accessed, and immediate binding means that functions and variables in the dynamic library are symbolically resolved and bound when the library file is loaded.

[0068] When calling the dlopen function, the path of the dynamic library file needs to be passed as the filename parameter, and the opening mode of the dynamic library file needs to be passed as the flag parameter to the function so that the embedded application can locate and load the dynamic library file. After successfully calling the dlopen function, a handle pointing to the dynamic library file will be returned, and this handle can be used to call functions in the dynamic library file or access variables defined therein. When the dynamic library file is no longer needed, the dlclose function can be used to close this handle and release resources.

[0069] When the dynamic library file is loaded and linked to the application program, an initialization operation will also be performed. Among them, the initialization process may include steps such as loading the library file, parsing the symbol table, and allocating memory. Specifically, call the initialization function, and then initialize the dynamic library file based on the initialization function. For example, when loading the dynamic library file, the initialization function init_library is automatically called, and the initialization work of the dynamic library file is implemented based on this initialization function.

[0070] Optionally, different operating systems and compilers have different requirements and constraints for initialization functions. The initialization function of the dynamic library file will only be called once when the library is loaded for the first time, and subsequent loading of the same library will not trigger the call of the initialization function again.

[0071] Step 300, call the component creation function in the dynamic library file to create at least one component and render the component onto the screen.

[0072] By calling the component creation function in the dynamic library file, create one or more component instances. Here, the component creation function will return an object or handle representing the component. Render the created component instances onto the screen, where the rendering method depends on the graphics library or framework used. For example, for a web application, HTML and CSS can be used to render the components; for a desktop application, functions or methods provided by the GUI library can be used for rendering.

[0073] Optionally, if it is necessary to update the component according to user interaction or other events, the corresponding function in the dynamic library file can be called to update the state or properties of the component and re-render it onto the screen.

[0074] The user interface rendering method provided by the embodiments of the present application downloads the dynamic library file from the server based on a network request; the dynamic library file is obtained by compiling the source code file corresponding to the user interface configuration file, the custom function file required for configuring the user interface, and the resource file; link the dynamic library file and initialize the dynamic library file; call the component creation function in the dynamic library file to create at least one component and render the component onto the screen. By using the source code file, custom function file, and resource file to compile and generate the dynamic library file, and dynamically distributing it to the device based on the HTTP request, and creating components based on the dynamic library file by linking, the problem of frequent OTA upgrades is solved, the flexibility and dynamic update ability of the system are improved, while resources are saved, efficiency is increased, and system stability is ensured, so as to better meet the implementation of the dynamic page and business requirements of the embedded screen terminal.

[0075] Based on the above embodiments, the calling the component creation function in the dynamic library file to create at least one component includes:

[0076] Step 311, obtain the address of the component creation function in the dynamic library file;

[0077] Step 312, call the component creation function based on the address of the component creation function;

[0078] Step 313, create at least one component based on the component attribute information and component layout information in the component creation function.

[0079] It should be noted that the component attribute information includes various attributes or configuration items of the component, which are used to define the appearance, behavior and functions of the component; the component layout information includes the arrangement and relative positions of the components in the interface, which defines the relationships and organizational structures among the components.

[0080] After loading the dynamic library file, obtain the address of the component creation function in the dynamic library file, and based on this address, call the component creation function. Then, based on the component attribute information and component layout information in the component creation function, create at least one component.

[0081] For example, use the dlsym function to obtain the address of the component creation function create_component, and convert it into a function pointer createComponent. Then, create a component by calling the createComponent function and perform corresponding error handling.

[0082] By loading the dynamic library file and dynamically creating components based on the component creation functions therein, the embodiments of the present application can achieve more flexible, streamlined and customized application development and maintenance, while improving the stability and security of the system.

[0083] Based on the above embodiments, after calling the component creation function in the dynamic library file to create at least one component and rendering the component to the screen, it further includes:

[0084] Step 321, obtain the gesture event triggered by the user interface;

[0085] Step 322, run the custom function associated with the trigger component corresponding to the gesture event to call the function in the dynamic library file to execute the operation associated with the gesture event.

[0086] When the UI interface receives a gesture event, it triggers the custom function written in events of the trigger component and executes the function in the dynamic library file, which specifically includes the following steps:

[0087] Step 1, trigger the gesture event: When the user performs a gesture operation (such as clicking, swiping, etc.) on the UI interface, the operating system or application will receive the corresponding gesture event.

[0088] Step 2, trigger the custom function in the component: After receiving the gesture event, the component associated with the gesture event (i.e., the trigger component) will call the previously registered custom function (such as updating the interface, performing specific operations, etc.) to handle the event. Among them, the custom function is written by the developer according to the requirements of the component and is called when a specific gesture event occurs.

[0089] Step 3: Execute functions in the dynamic library file: In the custom functions of the component, some functions provided in the dynamic library file need to be executed, that is, call the functions in the dynamic library file to perform operations associated with the gesture event.

[0090] Based on the above steps 1 - 3, the overall processing procedure is as follows: When the user performs a gesture operation on the UI interface, the corresponding component will trigger its custom function, and these custom functions will call the functions in the dynamic library to perform specific operations, thereby implementing functions related to the gesture event.

[0091] In a specific embodiment, assume there is a UI interface of an image viewer, which includes an ImageViewer component, and the user can use gestures to zoom in or out the image.

[0092] Attribute information: The ImageViewer component includes an attribute imagePath for specifying the path of the image to be displayed. The ImageViewer component also includes an attribute scaleFactor for specifying the current zoom ratio of the image.

[0093] Custom functions: onPinchGesture(scale:number): When the user performs a pinch gesture operation, this function will be triggered, and it receives a parameter scale representing the zoom ratio of the gesture. updateImageScale(): This function is used to update the zoom ratio of the image and call the functions in the dynamic library file to re - render the image.

[0094] Dynamic library file function: renderImage(imagePath:string,scaleFactor:number): This function receives the image path and the zoom ratio as parameters, and is used to render the image at the specified path and zoom it according to the specified zoom ratio.

[0095] When the user performs a pinch gesture operation, the onPinchGesture(scale) function will be triggered. It will adjust the value of the scaleFactor attribute according to the zoom ratio of the gesture, and then call the updateImageScale() function. In the updateImageScale() function, imagePath and scaleFactor will be passed as parameters to the dynamic library file function renderImage(imagePath,scaleFactor) to achieve re - rendering the image and displaying it according to the specified zoom ratio.

[0096] In the embodiments of the present application, by combining the custom functions of components and the functions of dynamic library files, a flexible, efficient, easy-to-maintain, and extensible gesture operation function can be realized, enhancing the user experience. At the same time, placing the functions related to gesture events in the dynamic library file can utilize the underlying optimizations and performance improvements.

[0097] Based on the above embodiments, after downloading the dynamic library file from the server based on a network request, the following further steps are included:

[0098] Step 331, if the dynamic library file needs to be updated, send a Hypertext Transfer Protocol network request to the server;

[0099] Step 332, update the dynamic library file based on the target dynamic library file sent down based on the Hypertext Transfer Protocol network request.

[0100] If the dynamic library file needs to be updated, the latest target dynamic library file can be obtained by sending an HTTP network request to the server and updated. The implementation steps include: in an embedded application, when it is detected that the dynamic library file needs to be updated, an HTTP request is constructed, including the URL of the server, the request method (such as GET or POST), and other necessary parameters. The HTTP request is sent to the server. After receiving the HTTP request, the server processes it according to the content of the request and returns the target dynamic library file as a response to the embedded application. After receiving the response from the server, the embedded application saves the returned target dynamic library file locally. Then, depending on the platform and language, corresponding methods can be used to complete the update of the dynamic library. For example, in C / C++, appropriate functions can be used to load and replace the dynamic library file; in Java, a class loader can be used to load the new version of the dynamic library file. After the update is completed, the embedded application can reload the dynamic library file and apply the updated functions.

[0101] In the embodiments of the present application, by sending an HTTP network request to the server, the latest version of the dynamic library file can be obtained in real time, ensuring that the embedded application always uses the latest functions and fixes. Based on this, updating the target dynamic library file based on the HTTP network request can achieve timely, flexible, efficient, controllable, and secure update of the dynamic library file, thereby improving the stability of the embedded application and the user experience.

[0102] To further analyze and explain the user interface rendering method proposed in the present application, refer to Figure 3 and the following embodiments.

[0103] The embodiments of the present application specifically propose a rendering method for an embedded screen terminal, which specifically includes the following steps:

[0104] (1) Determine the UI configuration file, as well as the function code file corresponding to the implementation of the corresponding event, and resource files such as required pictures and fonts, through protocols such as styles and layouts agreed upon by custom components.

[0105] (2) Convert the UI configuration file into source code through a Python script, bind the function code and components in the configuration to events, and generate a series of.c and.h files through a standard template in combination with resource files.

[0106] (3) Compile the.h and.c files and resource files, etc. into a.so dynamic library file through the compiler of the embedded system.

[0107] (4) Obtain the.so dynamic library file through methods such as HTTP requests.

[0108] (5) The embedded application uses the dlopen function to link to the dynamic library file obtained in the previous step, and executes the initialization method in the dynamic library file to complete the preparation work of the dynamic library file.

[0109] (6) After successful linking, execute the functions in the dynamic library file, create UI components and execute functions such as events, and render the UI components on the screen.

[0110] (7) When a gesture event is triggered by a UI component, execute the corresponding function event in the dynamic library file.

[0111] In the embodiment of the present application, a dynamic library file is compiled and generated by using source code files, custom function files and resource files, and is dynamically sent to the device based on an HTTP request. By linking the dynamic library file and creating components based on the dynamic library file, the problem of frequent OTA upgrades is solved, the flexibility and dynamic update ability of the system are improved, and at the same time, resources are saved, efficiency is improved and system stability is ensured, so as to better meet the implementation of dynamic pages and business requirements on the embedded screen side.

[0112] Reference Figure 4 , Figure 4 is a schematic diagram of the modules of the user interface rendering device provided by the embodiment of the present application. The user interface rendering device of the present application includes a dynamic library file download module 401, a linking module 402, and a rendering module 403.

[0113] The dynamic library file download module 401 is used to download the dynamic library file from the server based on a network request; the dynamic library file is obtained by compiling the user interface configuration file, the custom function file required for configuring the user interface, and the resource file.

[0114] The linking module 402 is used to link the dynamic library file and initialize the dynamic library file.

[0115] The rendering module 403 is used to call the component creation function in the dynamic library file, create at least one component, and render the component to the screen.

[0116] The user interface rendering device provided by the embodiment of the present application downloads the dynamic library file from the server based on a network request; the dynamic library file is obtained by compiling the source code file corresponding to the user interface configuration file, the custom function file required for configuring the user interface, and the resource file; link the dynamic library file and initialize the dynamic library file; call the component creation function in the dynamic library file, create at least one component, and render the component to the screen. By using the source code file, custom function file, and resource file to compile and generate the dynamic library file, and dynamically distributing it to the device based on the HTTP request, and creating components based on the dynamic library file by linking the dynamic library file, the problem of frequent OTA upgrades is solved, the flexibility and dynamic update ability of the system are improved, while saving resources, improving efficiency, and ensuring system stability, so as to better meet the implementation of dynamic pages and business requirements on the embedded screen side.

[0117] In one embodiment, the rendering module 403 is specifically used for:

[0118] Obtain the address of the component creation function in the dynamic library file;

[0119] Based on the address of the component creation function, call the component creation function;

[0120] Create at least one component based on the component attribute information and component layout information in the component creation function.

[0121] In one embodiment, the rendering module 403 is further used for:

[0122] Obtain the gesture event triggered by the user interface;

[0123] Run the custom function associated with the trigger component corresponding to the gesture event to call the function in the dynamic library file to perform the operation associated with the gesture event.

[0124] In one embodiment, the linking module 402 is specifically used for:

[0125] Determine the path information and opening method of the dynamic library file;

[0126] Use the path information and the opening method as parameters of the linking function, and run the linking function to link the dynamic library file.

[0127] In one embodiment, the linking module 402 is specifically used for:

[0128] Call the initialization function;

[0129] Initialize the dynamic library file based on the initialization function.

[0130] In one embodiment, the dynamic library file download module 401 is further configured to:

[0131] If the dynamic library file needs to be updated, send a Hypertext Transfer Protocol network request to the server;

[0132] Update the dynamic library file based on the target dynamic library file sent in the Hypertext Transfer Protocol network request.

[0133] In one embodiment, the source code file is generated based on the configuration information in the user interface configuration file; the source code file includes code files for component creation, component property setting, and component layout operations.

[0134] Figure 5 Illustrates a schematic diagram of the physical structure of an electronic device, as Figure 5 shown. The electronic device may include: a processor 510, a communications interface 520, a memory 530, and a communication bus 540. Among them, the processor 510, the communications interface 520, and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logical instructions in the memory 530 to execute the following methods:

[0135] Download a dynamic library file from the server based on a network request; the dynamic library file is obtained by compiling the source code file corresponding to the user interface configuration file, the custom function file required to configure the user interface, and the resource file;

[0136] Link the dynamic library file and initialize the dynamic library file;

[0137] Call the component creation function in the dynamic library file to create at least one component and render the component to the screen.

[0138] In addition, when the logical instructions in the above-mentioned memory 530 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or a part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.

[0139] In another aspect, an embodiment of the present application further provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is configured to execute the user interface rendering method provided in the above-mentioned embodiments, for example, including:

[0140] Downloading a dynamic library file from a server based on a network request; the dynamic library file is obtained by compiling a source code file corresponding to a user interface configuration file, a custom function file required for configuring the user interface, and a resource file;

[0141] Linking the dynamic library file and initializing the dynamic library file;

[0142] Invoking a component creation function in the dynamic library file to create at least one component and rendering the component to the screen.

[0143] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative labor.

[0144] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0145] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

[0146] The above embodiments are only used to illustrate the present application, rather than to limit the present application. Although the present application has been described in detail with reference to the embodiments, those of ordinary skill in the art should understand that various combinations, modifications, or equivalent replacements of the technical solutions of the present application do not deviate from the spirit and scope of the technical solutions of the present application, and should all be covered by the scope of the claims of the present application.

Claims

1. A user interface rendering method, characterized in that, Including: Downloading a dynamic library file from a server based on a network request; The dynamic library file is obtained by compiling the source code file corresponding to the user interface configuration file, the custom function file required for configuring the user interface, and the resource file; Linking the dynamic library file and initializing the dynamic library file; Invoking a component creation function in the dynamic library file to create at least one component and rendering the component to the screen.

2. The user interface rendering method according to claim 1, characterized in that, The step of invoking a component creation function in the dynamic library file to create at least one component includes: Obtaining the address of the component creation function in the dynamic library file; Invoking the component creation function based on the address of the component creation function; Creating at least one component based on the component attribute information and component layout information in the component creation function.

3. The user interface rendering method according to claim 1, characterized in that, After invoking the component creation function in the dynamic library file to create at least one component and rendering the component to the screen, it further includes: Obtaining a gesture event triggered by the user interface; Running a custom function associated with the triggered component corresponding to the gesture event to invoke a function in the dynamic library file to perform an operation associated with the gesture event.

4. The user interface rendering method according to claim 1, characterized in that, The step of linking the dynamic library file includes: Determining the path information and opening method of the dynamic library file; Using the path information and the opening method as parameters of a linking function and running the linking function to link the dynamic library file.

5. The user interface rendering method according to claim 1, characterized in that, The step of initializing the dynamic library file includes: Invoking an initialization function; Initializing the dynamic library file based on the initialization function.

6. The user interface rendering method according to any one of claims 1 to 5, characterized in that, After downloading the dynamic library file from the server based on a network request, it further includes: If the dynamic library file needs to be updated, sending a Hypertext Transfer Protocol network request to the server; Updating the dynamic library file based on the target dynamic library file sent in the Hypertext Transfer Protocol network request.

7. The user interface rendering method according to claim 1, characterized in that, The source code file is generated based on the configuration information in the user interface configuration file; the source code file includes code files for component creation, component attribute setting, and component layout operations.

8. A user interface rendering device, characterized in that, Including: A dynamic library file download module for downloading a dynamic library file from a server based on a network request; The dynamic library file is obtained by compiling the user interface configuration file, the custom function file required for configuring the user interface, and the resource file; A linking module for linking the dynamic library file and initializing the dynamic library file; A rendering module for invoking a component creation function in the dynamic library file to create at least one component and rendering the component to the screen.

9. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the user interface rendering method according to any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium, on which a computer program is stored, characterized in that,When the computer program is executed by a processor, it implements the user interface rendering method according to any one of claims 1 to 7.