Dynamic UI interface construction method, device and system based on JSON (JavaScript Object Notation) information

Through the dynamic construction method of UI interface based on JSON information, the layout structure requirements are analyzed and component construction is performed, and the problem of low update efficiency of UI interface construction in the existing technology is solved, achieving more efficient and convenient interface updates and user experience improvements.

CN118885170APending Publication Date: 2024-11-01SHENZHEN GREEN CONNECTION TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410852151.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-27
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

The existing UI interface construction update method relies on hard-coded or predefined templates, which lacks flexibility, resulting in low efficiency and convenience of building updates, making it difficult to adapt to rapidly changing interface needs.

Method used

Using the dynamic construction method of UI interface based on JSON information, we use the target application, pre-built mapping component tables and JSON files to parse layout structure requirements information, perform data analysis and component construction operations, and realize dynamic update of the UI interface.

Benefits of technology

It improves the efficiency and convenience of dynamic construction of the UI interface, enhances update flexibility and application iteration efficiency, reduces development costs, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118885170A_ABST
    Figure CN118885170A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of UI generation, and discloses a dynamic UI construction method, device and system based on JSON information, and the method comprises the steps: determining a mapping component table and a JSON file according to a target application needing to dynamically construct the UI; determining target JSON data according to the layout structure demand information and the JSON file; according to the mapping component table, executing data analysis operation on the target JSON data to obtain UI component layout information; according to the UI component layout information, executing an interface rendering component construction operation to obtain a rendering component construction result; and according to the rendering component construction result, executing a UI interface display operation to enable the target application to realize UI interface dynamic update. Visibly, the dynamic construction efficiency, convenience, construction accuracy and reliability of the UI interface can be improved by implementing the method, the updating flexibility and application iteration efficiency of the UI interface are further improved, the expandability of the system and the customization feasibility of the UI interface are further improved, the development process is accelerated, and the development cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of UI generation, and in particular to a method, device and system for dynamically constructing a UI interface based on JSON information. Background Art

[0002] With the rapid development of information technology and the continuous improvement of users' requirements for product experience, building and updating the UI interface has become a key link in meeting user needs.

[0003] Currently, the main way to build and update the UI interface is for developers to manually modify the code and redeploy the application, relying on hard-coded or predefined templates to build and update the UI interface, which lacks flexibility, has low building and updating efficiency and convenience, and is difficult to adapt to the rapidly changing interface building and updating needs. Therefore, the existing UI interface building and updating methods have the problem of low building and updating efficiency and convenience. It can be seen that it is particularly important to provide a new UI interface dynamic construction method to improve the building and updating efficiency and convenience of the UI interface. Summary of the invention

[0004] The present invention provides a method, device and system for dynamically constructing a UI interface based on JSON information, which can improve the efficiency and convenience of dynamic construction of the UI interface, thereby improving the update flexibility and application iteration efficiency of the UI interface.

[0005] In order to solve the above technical problems, the first aspect of the present invention discloses a method for dynamically constructing a UI interface based on JSON information, the method comprising:

[0006] Determine a target application for which a UI interface needs to be dynamically constructed, and determine a pre-constructed mapping component table and a pre-deployed JSON file based on the target application;

[0007] Determine target JSON data according to the determined layout structure requirement information for the target UI interface and the JSON file; the target application is used to display the target UI interface;

[0008] According to the mapping component table, a corresponding data parsing operation is performed on the target JSON data to obtain UI component layout information for the target UI interface;

[0009] According to the UI component layout information, a corresponding interface rendering component construction operation is performed to obtain a rendering component construction result;

[0010] According to the rendering component construction result, the corresponding UI interface display operation is performed to enable the target application to dynamically update the UI interface.

[0011] As an optional implementation, in the first aspect of the present invention, before determining the pre-built mapping component table and the pre-deployed JSON file according to the target application, the method further includes:

[0012] Determine, according to the determined target application and the preset target data exchange format, comprehensive component information to be used by the target application, wherein the comprehensive component information includes information of a target development framework and component information of one or more components based on the target development framework, wherein all the components include at least one set type component and / or at least one user-defined type component related to the target development framework;

[0013] According to the comprehensive component information, a corresponding mapping table construction operation is performed to obtain a mapping component table, wherein the mapping component table is used to represent a mapping relationship between the set type component and the user-defined type component;

[0014] According to the mapping component table, perform corresponding file creation and deployment operations to obtain a JSON file;

[0015] Among them, the target development framework is used to parse and process the JSON file, the data exchange format of the JSON file matches the target data exchange format, the file name of the JSON file matches the file name of the code file corresponding to the determined target development framework, and the grouping form of the folder associated with the JSON file matches the directory folder path of the target development framework.

[0016] As an optional implementation, in the first aspect of the present invention, determining the comprehensive component information to be used by the target application according to the determined target application and the preset target data exchange format includes:

[0017] According to the determined target application and the standard library information corresponding to the target development framework, a corresponding first component identification operation is performed to obtain one or more set type components, and according to the target application, the preset target data exchange format and the user component requirement information, a corresponding second component identification operation is performed to obtain one or more custom type components;

[0018] According to the determined component function usage information, the attribute division result is determined, and according to the attribute division result and the target data exchange format, the corresponding format definition operation is performed on all the set type components and all the custom type components to obtain comprehensive component information.

[0019] As an optional implementation, in the first aspect of the present invention, the corresponding file creation and deployment operations are performed according to the mapping component table to obtain a JSON file, including:

[0020] According to the format definition information corresponding to the mapping component table, a JSON file creation operation is performed to obtain a JSON file;

[0021] According to the determined file deployment type, determine the target deployment location for deploying the JSON file, and deploy the JSON file to the target deployment location. The file deployment type includes a static deployment type or a dynamically updated deployment type. The target deployment location includes one or more of application resources, servers, and cloud storage.

[0022] As an optional implementation, in the first aspect of the present invention, after performing a JSON file creation operation according to the format definition information corresponding to the mapping component table to obtain the JSON file, the method further includes:

[0023] Determine file format information and / or file attribute information corresponding to the JSON file, and determine whether the JSON file meets a preset file verification condition based on the file format information and / or the file attribute information;

[0024] When it is determined that the JSON file meets the file verification condition, the steps of determining a target deployment location for deploying the JSON file according to the determined file deployment type and deploying the JSON file to the target deployment location are performed.

[0025] As an optional implementation, in the first aspect of the present invention, judging whether the JSON file meets a preset file verification condition according to the file format information and / or the file attribute information includes:

[0026] According to the file format information, determine whether the JSON file meets a preset format error condition to obtain a first judgment result; when the first judgment result is yes, determine that the JSON file does not meet the preset file verification condition; when the first judgment result is no, determine that the JSON file meets the preset file verification condition;

[0027] and / or,

[0028] According to the file attribute information, determine whether the JSON file meets the preset attribute omission condition to obtain a second judgment result; when the second judgment result is yes, determine that the JSON file does not meet the preset file verification condition; when the second judgment result is no, determine that the JSON file meets the preset file verification condition.

[0029] As an optional implementation, in the first aspect of the present invention, before determining the target JSON data according to the determined layout structure requirement information for the target UI interface and the JSON file, the method further includes:

[0030] Acquire real-time operation information of a target user on a target UI interface, and determine layout structure requirement information for the target UI interface according to the real-time operation information; and / or,

[0031] Obtain the pre-operation information of the target user for the target UI interface, and determine the pre-loaded data corresponding to the target user based on the pre-operation information; determine the layout structure requirement information for the target UI interface based on the pre-loaded data.

[0032] As an optional implementation, in the first aspect of the present invention, performing corresponding data parsing operations on the target JSON data according to the mapping component table to obtain UI component layout information for the target UI interface includes:

[0033] According to the set JSON decoding library, a corresponding first parsing operation is performed on the target JSON data to obtain a data decoding result;

[0034] According to the mapping component table, a corresponding second parsing operation is performed on the data decoding result to obtain UI component layout information for the target UI interface, and the UI component layout information includes at least one or more of UI component type information, UI component attribute information and subcomponent information.

[0035] As an optional embodiment, in the first aspect of the present invention, the method further comprises:

[0036] Determine the execution status corresponding to the data parsing operation and / or the interface rendering component construction operation, and judge whether the execution status meets the preset abnormal content condition;

[0037] When it is determined that the execution status meets the abnormal content condition, specific abnormal information is determined according to the data parsing operation and / or the interface rendering component construction operation, and corresponding error handling operations are performed according to the specific abnormal information;

[0038] The abnormal content condition includes one or more of an abnormal JSON format condition, an abnormal component type condition, and an abnormal component attribute condition.

[0039] The second aspect of the present invention discloses a device for dynamically constructing a UI interface based on JSON information, the device comprising:

[0040] A determination module is used to determine a target application for which a UI interface needs to be dynamically constructed, and to determine a pre-constructed mapping component table and a pre-deployed JSON file according to the target application;

[0041] A data determination module, used to determine target JSON data according to the determined layout structure requirement information for the target UI interface and the JSON file; the target application is used to display the target UI interface;

[0042] A data parsing module, used to perform corresponding data parsing operations on the target JSON data according to the mapping component table, and obtain UI component layout information for the target UI interface;

[0043] A component construction module is used to perform corresponding interface rendering component construction operations according to the UI component layout information to obtain a rendering component construction result;

[0044] The interface display module is used to perform corresponding UI interface display operations according to the rendering component construction result, so that the target application can realize dynamic update of the UI interface.

[0045] As an optional implementation, in the second aspect of the present invention, the determination module is further used to determine, before determining the pre-built mapping component table and the pre-deployed JSON file according to the target application, the comprehensive component information to be used by the target application according to the determined target application and the preset target data exchange format, the comprehensive component information including information of the target development framework and component information of one or more components based on the target development framework, all of the components including at least one set type component and / or at least one custom type component related to the target development framework;

[0046] The device also includes:

[0047] A mapping table construction module, used to perform a corresponding mapping table construction operation according to the comprehensive component information to obtain a mapping component table, wherein the mapping component table is used to represent a mapping relationship between the set type component and the user-defined type component;

[0048] A file deployment module, used to perform corresponding file creation and deployment operations according to the mapping component table to obtain a JSON file;

[0049] Among them, the target development framework is used to parse and process the JSON file, the data exchange format of the JSON file matches the target data exchange format, the file name of the JSON file matches the file name of the code file corresponding to the determined target development framework, and the grouping form of the folder associated with the JSON file matches the directory folder path of the target development framework.

[0050] As an optional implementation, in the second aspect of the present invention, the determination module determines the comprehensive component information to be used by the target application according to the determined target application and the preset target data exchange format, specifically including:

[0051] According to the determined target application and the standard library information corresponding to the target development framework, a corresponding first component identification operation is performed to obtain one or more set type components, and according to the target application, the preset target data exchange format and the user component requirement information, a corresponding second component identification operation is performed to obtain one or more custom type components;

[0052] According to the determined component function usage information, the attribute division result is determined, and according to the attribute division result and the target data exchange format, the corresponding format definition operation is performed on all the set type components and all the custom type components to obtain comprehensive component information.

[0053] As an optional implementation, in the second aspect of the present invention, the file deployment module performs corresponding file creation and deployment operations according to the mapping component table, and the manner of obtaining the JSON file specifically includes:

[0054] According to the format definition information corresponding to the mapping component table, a JSON file creation operation is performed to obtain a JSON file;

[0055] According to the determined file deployment type, determine the target deployment location for deploying the JSON file, and deploy the JSON file to the target deployment location. The file deployment type includes a static deployment type or a dynamically updated deployment type. The target deployment location includes one or more of application resources, servers, and cloud storage.

[0056] As an optional implementation, in the second aspect of the present invention, the file deployment module is also used to perform the JSON file creation operation according to the format definition information corresponding to the mapping component table, and after obtaining the JSON file, determine the file format information and / or file attribute information corresponding to the JSON file, and judge whether the JSON file meets the preset file verification conditions based on the file format information and / or the file attribute information; when it is judged that the JSON file meets the file verification conditions, execute the steps of determining the target deployment location for deploying the JSON file according to the determined file deployment type, and deploying the JSON file to the target deployment location.

[0057] As an optional implementation, in the second aspect of the present invention, the file deployment module determines whether the JSON file meets the preset file verification condition according to the file format information and / or the file attribute information. Specifically, the method includes:

[0058] According to the file format information, determine whether the JSON file meets a preset format error condition to obtain a first judgment result; when the first judgment result is yes, determine that the JSON file does not meet the preset file verification condition; when the first judgment result is no, determine that the JSON file meets the preset file verification condition;

[0059] and / or,

[0060] According to the file attribute information, determine whether the JSON file meets the preset attribute omission condition to obtain a second judgment result; when the second judgment result is yes, determine that the JSON file does not meet the preset file verification condition; when the second judgment result is no, determine that the JSON file meets the preset file verification condition.

[0061] As an optional embodiment, in the second aspect of the present invention, the determination module is also used to obtain the real-time operation information of the target user for the target UI interface before the data determination module determines the target JSON data based on the determined layout structure requirement information for the target UI interface and the JSON file, and determine the layout structure requirement information for the target UI interface based on the real-time operation information; and / or obtain the pre-operation information of the target user for the target UI interface, and determine the pre-loaded data corresponding to the target user based on the pre-operation information; and determine the layout structure requirement information for the target UI interface based on the pre-loaded data.

[0062] As an optional implementation, in the second aspect of the present invention, the data parsing module performs corresponding data parsing operations on the target JSON data according to the mapping component table, and the method of obtaining UI component layout information for the target UI interface specifically includes:

[0063] According to the set JSON decoding library, a corresponding first parsing operation is performed on the target JSON data to obtain a data decoding result;

[0064] According to the mapping component table, a corresponding second parsing operation is performed on the data decoding result to obtain UI component layout information for the target UI interface, and the UI component layout information includes at least one or more of UI component type information, UI component attribute information and subcomponent information.

[0065] As an optional implementation, in the second aspect of the present invention, the device further includes:

[0066] An error handling module, used to determine the execution status corresponding to the data parsing operation and / or the interface rendering component construction operation, and judge whether the execution status meets the preset abnormal content condition;

[0067] When it is determined that the execution status meets the abnormal content condition, specific abnormal information is determined according to the data parsing operation and / or the interface rendering component construction operation, and corresponding error handling operations are performed according to the specific abnormal information;

[0068] The abnormal content condition includes one or more of an abnormal JSON format condition, an abnormal component type condition, and an abnormal component attribute condition.

[0069] A third aspect of the present invention discloses an electronic device, comprising:

[0070] A memory storing executable program code;

[0071] a processor coupled to the memory;

[0072] The processor calls the executable program code stored in the memory to execute the method for dynamically constructing a UI interface based on JSON information disclosed in the first aspect of the present invention.

[0073] The fourth aspect of the present invention discloses a computer storage medium, which stores computer instructions. When the computer instructions are called, they are used to execute the method for dynamically constructing a UI interface based on JSON information disclosed in the first aspect of the present invention.

[0074] The fifth aspect of the present invention discloses a system for dynamically constructing a UI interface based on JSON information, the system comprising a device for dynamically constructing a UI interface based on JSON information as disclosed in the second aspect of the present invention, and a NAS device communicatively connected to the device for dynamically constructing a UI interface based on JSON information; or, the system comprises an electronic device as disclosed in the third aspect of the present invention, and a NAS device communicatively connected to the electronic device.

[0075] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0076] In an embodiment of the present invention, a target application that needs to dynamically construct a UI interface is determined, and based on the target application, a pre-constructed mapping component table and a pre-deployed JSON file are determined; based on the determined layout structure requirement information for the target UI interface and the JSON file, target JSON data is determined; the target application is used to display the target UI interface; based on the mapping component table, corresponding data parsing operations are performed on the target JSON data to obtain UI component layout information for the target UI interface; based on the UI component layout information, corresponding interface rendering component construction operations are performed to obtain rendering component construction results; based on the rendering component construction results, corresponding UI interface display operations are performed to enable the target application to achieve dynamic update of the UI interface. It can be seen that the present invention can determine the target JSON data according to the layout structure requirement information, and then perform data parsing operations, component construction operations and interface display operations based on the target JSON data to realize the dynamic construction of the UI interface, which is conducive to improving the comprehensiveness and rationality of the dynamic construction method of the UI interface, and then is conducive to improving the dynamic construction efficiency and convenience of the UI interface, and is also conducive to improving the construction accuracy and reliability of the UI interface, thereby helping to improve the update flexibility and application iteration efficiency of the UI interface, and further helping to improve the scalability of the system and the customization feasibility of the UI interface, speeding up the development process, reducing development costs and improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0077] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0078] Figure 1 It is a flowchart of a method for dynamically constructing a UI interface based on JSON information disclosed in an embodiment of the present invention;

[0079] Figure 2It is a flowchart of another method for dynamically constructing a UI interface based on JSON information disclosed in an embodiment of the present invention;

[0080] Figure 3 It is a structural diagram of a device for dynamically constructing a UI interface based on JSON information disclosed in an embodiment of the present invention;

[0081] Figure 4 It is a structural diagram of another device for dynamically constructing a UI interface based on JSON information disclosed in an embodiment of the present invention;

[0082] Figure 5 It is a structural schematic diagram of an electronic device disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0083] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0084] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, device, product or end including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products or ends.

[0085] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0086] The present invention discloses a method, device and system for dynamically constructing a UI interface based on JSON information, which can determine target JSON data according to layout structure requirement information, and then perform data parsing operations, component construction operations and interface display operations based on the target JSON data to realize dynamic construction of the UI interface, which is conducive to improving the comprehensiveness and rationality of the dynamic construction method of the UI interface, and then is conducive to improving the dynamic construction efficiency and convenience of the UI interface, and is also conducive to improving the construction accuracy and reliability of the UI interface, thereby facilitating the update flexibility and application iteration efficiency of the UI interface, and further conducive to improving the scalability of the system and the feasibility of customization of the UI interface, speeding up the development process, reducing development costs and improving user experience. The following are detailed descriptions.

[0087] Embodiment 1

[0088] See also Figure 1 , Figure 1 This is a flow chart of a method for dynamically constructing a UI interface based on JSON information disclosed in an embodiment of the present invention. Figure 1 The described method can be applied to a device for dynamically constructing a UI interface based on JSON information, wherein the device may include a server, wherein the server includes a local server or a cloud server, which is not limited in the embodiment of the present invention. Figure 1 As shown, the method for dynamically building a UI interface based on JSON information includes the following operations:

[0089] 101. Determine the target application that needs to dynamically build the UI interface, and determine the pre-built mapping component table and the pre-deployed JSON file based on the target application.

[0090] Optionally, the mapping component table may correspond to a Dynamic Widget Builder, which may be understood as being used to parse JSON data and JSON strings into Flutter Widgets. Specifically, it may receive a JSON string and a Build Context (a context for building a Widget tree), and then return a parsed Widget instance. In addition, DynamicWidgetBuilder may also be understood as being used to interpret JSON and recursively construct corresponding Widget objects according to the types and properties defined in JSON. The process involves identifying fields in JSON, such as type (declaring the type of Widget to be created), and properties specific to the type (such as size, color, child Widget, etc.), and then using this information to construct an actual Flutter Widget, which is not limited in the embodiments of the present invention.

[0091] Furthermore, the above-mentioned recursive construction of the corresponding Widget object according to the types and attributes defined in JSON may include: preparing a JSON string: using the Dynamic Widget JsonExportor class of the present invention to export the written JSON string, uploading it to the server, and the client obtains the JSON corresponding to the server through the interface and uses DynamicWidgetBuilder to parse the JSON: after importing the UGDynamicWidget library, use the DynamicWidgetBuilder class provided by it to parse the JSON string; DynamicWidgetBuilder is the core class in UGDynamicWidget, responsible for converting the JSON string into a Flutter Widget; building a Widget tree: DynamicWidgetBuilder will recursively build a complete Widget tree according to the component types and attributes defined in the JSON string. In the process, it will map each JSON object to the corresponding Flutter Widgets, and configure correct properties for these widgets; display the parsed widgets: After the parsing is completed, the obtained top-level widgets can be directly added to the interface of the Flutter application. This widget is usually a container (such as Scaffold, Container, etc.), which contains the entire UI layout dynamically generated according to the JSON string, which is not limited in this embodiment of the present invention.

[0092] Optionally, the mapping component table may be a JSON mapping component table established by the backend; the JSON file may be a JSON file that needs to be dynamically updated, which is not limited in the embodiment of the present invention.

[0093] Optionally, the JSON file can describe in detail the types, properties (such as size, color, text, etc.) of various widgets (ie, components) to be constructed, and the hierarchical relationships therebetween, which is not limited in the embodiment of the present invention.

[0094] Optionally, the present solution may further include a UI editor (i.e., corresponding to DynamicWidgetJsonExportor), which may export the layout designed in the visual UI editor by dragging and dropping or the like as a JSON configuration, so that the designer may directly participate in the UI design process without writing Dart code. Subsequently, these JSON configurations may be used to render the corresponding UI in the application through DynamicWidgetBuilder, which is not limited in the embodiments of the present invention.

[0095] Furthermore, the UI editor is used to convert the Flutter Widget back to a JSON string, which is mainly used in scenarios where the UI layout edited by a visualization tool needs to be exported as a JSON configuration; specifically, a FlutterWidget tree is received, and then the Widget tree is traversed to convert it into a JSON representation. This process requires converting various properties and configurations of the Widget into corresponding JSON fields and values. Finally, this method generates a JSON string / target JSON data that can be parsed by the DynamicWidgetBuilder.build method, which is not limited in the embodiment of the present invention.

[0096] Furthermore, the above conversion of the Flutter Widget back to a JSON string is illustrated as follows: the developer needs to write a flutter interface to export a JSON result (such as a JSON file or a JSON string or JSON data) through the DynamicWidgetJsonExportor of this solution. This JSON result defines the structure and properties of the Flutter Widget to be constructed, which is not limited in this embodiment of the present invention.

[0097] Furthermore, the application principle of the UI editor is explained with examples: Initialization: Use the DynamicWidgetJsonExporter class to instantiate an exporter object, which is responsible for managing the conversion process, including initializing the necessary resources and configurations; Pass the root widget: Pass the root node of a Flutter widget tree to the exporter, which can be any widget, such as a Scaffold or Container; Traverse the widget tree: The exporter starts from the root widget and recursively traverses the entire widget tree. For each widget encountered, the exporter will call the corresponding "Widget exporter" (a function or class specially written to convert a specific type of widget into a JSON structure); Collect attributes: During the traversal process, for each widget, the exporter will collect all the key attributes and configurations of the widget, including (but not limited to) size, color, border, etc. Spacing, alignment, text content, etc., depending on the type of Widget; Convert to JSON: The exporter converts these properties and configurations into corresponding JSON fields and values. This conversion process may require corresponding data formatting or conversion according to the characteristics and attribute types of the Widget to ensure that the generated JSON correctly reflects the configuration of the Widget; Processing child widgets: For container class widgets (such as Column, Row, Stack, etc.), the exporter will specially process their child widgets, recursively process these child widgets, convert them into JSON representation, and use them as an attribute of the current Widget JSON object (usually an array); Generate JSON structure: After completing the traversal of the entire Widget tree and collecting attributes, the exporter will build a complete JSON object, which will reflect the structure and configuration of the entire incoming Flutter Widget tree; Export JSON string: Convert this JSON object into a string form for storage or transmission over the network; The developer can save this JSON string as a file, send it to a server, or use it elsewhere to reconstruct the original Widget tree in the future, which is not limited in the embodiment of the present invention.

[0098] Furthermore, DynamicWidgetJsonExportor is used in combination with DynamicWidgetBuilder to provide Flutter applications with a high degree of flexibility and dynamism, allowing developers and designers to collaborate more quickly and efficiently, thereby speeding up the development process, reducing development costs, and improving user experience, which is not limited in the embodiments of the present invention.

[0099] 102. Determine target JSON data according to the determined layout structure requirement information and JSON file for the target UI interface; the target application is used to display the target UI interface.

[0100] Optionally, the layout structure requirement information for the target UI interface may be understood as the currently required UI layout and structure information, which is not limited in the embodiment of the present invention.

[0101] Optionally, determine the JSON data. For example, obtain a previously deployed JSON file from the server, usually through a network request, such as using an HTTP GET request, to obtain the JSON description of the currently required UI layout and structure (i.e., the target JSON data). This process is the starting point for dynamic UI rendering and determines which layout of UI to render next. The embodiment of the present invention does not limit this.

[0102] Optionally, compliance checking may also be included, specifically: ensuring that the JSON data complies with specific formats and specifications, and that the Dynamic Widget library has its expected format, for example: each Widget definition should contain at least one "type" field to specify the Widget type, which is not limited in the embodiment of the present invention.

[0103] 103. According to the mapping component table, a corresponding data parsing operation is performed on the target JSON data to obtain UI component layout information for the target UI interface.

[0104] Optionally, the above-mentioned corresponding data parsing operation is performed on the target JSON data. For example: the system will read the target JSON data, and map each part of the target JSON data into a corresponding UI component or layout according to the relationship defined in the mapping table; during the parsing process, certain custom logic can be implemented as needed, such as conditional rendering, etc., which is not limited in the embodiment of the present invention.

[0105] Further optionally, the above-mentioned corresponding data parsing operations are performed on the target JSON data, specifically: (1) Reading JSON: In the Flutter application, the target JSON data is obtained by network request or reading local files; (2) Using the JSON parsing library: Using the jsonDecode() method in the dart:convert library provided by Flutter, the JSON string is decoded into a Dart Map or List object; (3) Traversal and parsing: According to the decoded data structure, recursively traverse the data, for each Widget definition, identify its type, attributes and child Widgets (if any), which are not limited in the embodiment of the present invention.

[0106] 104. According to the UI component layout information, a corresponding interface rendering component construction operation is executed to obtain a rendering component construction result.

[0107] Optionally, the above-mentioned corresponding interface rendering component construction operation is illustrated by the following examples: (1) Widgets construction: dynamically construct Widgets through the program, dynamically select the corresponding FlutterWidget class according to the "type" field in each Widget definition, and use the properties of these definitions to create instances; (2) Setting properties: setting Widget properties according to the data in JSON, it is necessary to convert the data type (such as string, number) in JSON into the corresponding type required by Flutter properties; (3) Nesting child widgets: if a Widget definition contains a list of child widgets, recursively create instances for these child widgets and add them as child nodes to the parent widget, which is not limited in the embodiments of the present invention.

[0108] 105. According to the rendering component construction result, the corresponding UI interface display operation is performed to enable the target application to dynamically update the UI interface.

[0109] Optionally, the above-mentioned corresponding UI interface display operation is performed, for example: (1) Integration into the application: Once the entire Widget tree is built according to the JSON data, it can be displayed at any location in the Flutter application, for example, as part of the content of a page or a pop-up window; (2) Dynamic update: Listen to data update events, such as user operations or backend data updates. When the event is triggered, the process from reading JSON to building Widgets is re-executed to realize dynamic update of the UI, which is not limited in the embodiments of the present invention.

[0110] Optionally, this solution may also include but is not limited to: (1) Type safety and conversion: When processing data in JSON, attention should be paid to type conversion and safety, for example, converting a string to a color or enumeration type; (2) Performance considerations: Recursively constructing a large or complex widget tree may affect performance, so consider optimization strategies such as caching and lazy loading; (3) Scalability: When designing, consider new widget types or attributes that may be added in the future. Ease of addition and expansion is a key factor in selecting or designing such a system, and the embodiments of the present invention do not limit this.

[0111] Optionally, examples are provided for the actual application scenarios of the present solution: (1) For dynamic UI generation: DynamicWidgetBuilder can dynamically generate UI based on JSON obtained from the server, which is particularly useful for applications that need to be updated in real time based on server data. For example, customized interfaces can be displayed for different users, or the UI can be modified without updating the application version; (2) For UI editor: DynamicWidgetJsonExportor can export the layout designed in the visual UI editor by dragging and dropping as a JSON configuration, so that designers can directly participate in the UI design process without writing Dart code. Subsequently, these JSON configurations can be used to render the corresponding UI in the application through DynamicWidgetBuilder; further, the combination of these two classes provides Flutter applications with a high degree of flexibility and dynamism, allowing developers and designers to collaborate more quickly and efficiently, thereby speeding up the development process, reducing development costs, and improving user experience, which is not limited in the embodiments of the present invention.

[0112] Optionally, this solution implements a parser for parsing JSON and building a corresponding UI interface. Specifically: first define a string or file in JSON format. The format of the JSON is very similar to the Flutter widget code, which is used to describe the hierarchical structure of the UI and the properties of each component. The above-defined JSON is passed to the UGDynamicWidget library. The parser provided in the library will parse the JSON and generate a corresponding Flutter Widget object. The parser returns a FlutterWidget object, which can be used directly anywhere in the Flutter application, such as directly adding it to the page layout. Furthermore, the definition of the UI is separated from the code, making the UI more flexible and able to be dynamically changed without recompiling the entire application, which is not limited in the embodiments of the present invention.

[0113] Optionally, this solution designs a set of mechanisms to enable the system to support flexible expansion of new widget types; specifically: by using JSON to define the UI, as long as the project supports parsing the new widget types proposed in these JSONs, new widgets can be easily introduced into the UI without changing the underlying code; based on the UGDynamicWidget library, a parser is designed that can parse a wide range of JSON structures and map them to Flutter Widgets. The parser can be extended to support more widget types without modifying the original parsing process; after writing the corresponding parsing code for the new widget type, by registering these new parser extensions (plug-ins), the dynamic widget library can recognize and use these new widget types, achieving a high degree of scalability and flexibility; further, the project can easily adapt to changes in UI requirements, whether it is to change the UI by dynamically sending JSON through the backend, or to enrich the functions of the application by adding new widget types, which becomes very convenient, and the embodiments of the present invention are not limited.

[0114] It can be seen that the dynamic construction method of UI interface based on JSON information described in the embodiment of the present invention can determine the target JSON data according to the layout structure requirement information, and then perform data parsing operations, component construction operations and interface display operations based on the target JSON data to realize the dynamic construction of UI interface, which is conducive to improving the comprehensiveness and rationality of the dynamic construction method of UI interface, and then conducive to improving the dynamic construction efficiency and convenience of UI interface, and also conducive to improving the construction accuracy and reliability of UI interface, so as to improve the update flexibility and application iteration efficiency of UI interface, and further conducive to improving the scalability of the system and the customization feasibility of UI interface, speeding up the development process, reducing development costs and improving user experience.

[0115] In an optional embodiment, before determining the target JSON data according to the determined layout structure requirement information and JSON file for the target UI interface, the method may further include the following operations:

[0116] Acquire real-time operation information of a target user on a target UI interface, and determine layout structure requirement information for the target UI interface based on the real-time operation information; and / or,

[0117] Obtain the target user's pre-operation information for the target UI interface, and determine the pre-loaded data corresponding to the target user based on the pre-operation information; determine the layout structure requirement information for the target UI interface based on the pre-loaded data.

[0118] Optionally, the layout structure requirement information is determined based on the real-time operation information. For example, the layout structure requirement information required by the user is determined by obtaining the triggering instruction actions such as dragging and clicking of the user in the visual UI editor. The embodiment of the present invention is not limited to this.

[0119] Optionally, the layout structure requirement information is determined based on the pre-operation information. For example, pre-loading is performed through the pre-action of the user's operation. When the user operates to the current page, the backend JSON has been downloaded from the previous interface. The App performance seen by the user is consistent with the page written by pure Flutter code, without the lag of dynamic loading. This embodiment of the present invention is not limited.

[0120] Further optionally, the complete process of implementing the preloading function based on the preceding operation information is illustrated by the following examples: (1) Determine the timing of preloading: Analyze the user's behavior process and operation habits to determine at which links preloading is most appropriate. For example, when a user is browsing a list and is about to enter the details page, it can be predicted that the user is about to view the details of a certain list item; (2) Design a preloading strategy: Design the preloading logic according to the characteristics of the application. It can be a simple preloading of the data of the next page, or it can be an intelligent predictive loading based on the user's behavior pattern; (3) Implement the preloading function: Implementing the preloading function in a Flutter application usually involves the following program logic: Listen to the user's preceding actions (such as list scrolling, clicking, etc.), start a background task to load data when a specific behavior is detected, send an HTTP request to the server and request the JSON data that may be required for the next page, and store the data in the local cache after obtaining it for immediate access; (4) Optimize the user's waiting perception: If the data loading takes some time, an appropriate loading indicator can be provided to keep the user's attention on the current operation. After the loading is completed, the loading indicator is removed and the preloaded content is displayed. The embodiments of the present invention are not limited to this.

[0121] It can be seen that this optional embodiment can determine the layout structure requirement information through the real-time operation information and / or pre-operation information of the target user, which is conducive to improving the diversity, flexibility and comprehensiveness of the layout structure requirement information determination method, and further conducive to improving the efficiency and convenience of determining the layout structure requirement information, and is also conducive to improving the accuracy and reliability of the determined layout structure requirement information.

[0122] In another optional embodiment, the above-mentioned performing corresponding data parsing operations on the target JSON data according to the mapping component table to obtain UI component layout information for the target UI interface may include:

[0123] According to the set JSON decoding library, the corresponding first parsing operation is performed on the target JSON data to obtain a data decoding result;

[0124] According to the mapping component table, a corresponding second parsing operation is performed on the data decoding result to obtain UI component layout information for the target UI interface, and the UI component layout information includes at least one or more of UI component type information, UI component attribute information and subcomponent information.

[0125] Optionally, the JSON decoding library may be a dart:convert library provided by Flutter, or may be other libraries capable of implementing corresponding decoding functions, which is not limited in this embodiment of the present invention.

[0126] Optionally, the first parsing operation may be to decode the target JSON data using the jsonDecode() method in the dart:convert library provided by Flutter, which is not limited in this embodiment of the present invention.

[0127] Optionally, the data decoding result may be a Dart Map or List object, that is, a decoded data structure, which is not limited in the embodiment of the present invention.

[0128] Optionally, the first parsing operation and the second parsing operation are illustrated by way of example: firstly parsing using a JSON parsing library (ie, a JSON decoding library), and then parsing into UI components according to DynamicWidgetBuilder (ie, a mapping component table), which is not limited in the embodiment of the present invention.

[0129] Optionally, the sub-component information may be understood as the information of the sub-Widget, which is not limited in the embodiment of the present invention.

[0130] It can be seen that this optional embodiment can perform parsing operations on the target JSON data through two levels: the JSON decoding library and the mapping component table, and thus obtain the UI component layout information, which is beneficial to improving the progressiveness, rationality and comprehensiveness of the method for determining the UI component layout information, and thus is beneficial to improving the accuracy and reliability of the determined UI component layout information.

[0131] In yet another optional embodiment, the method may further include the following operations:

[0132] Determine the execution status corresponding to the data parsing operation and / or the interface rendering component construction operation, and judge whether the execution status meets the preset abnormal content conditions;

[0133] When it is determined that the execution status meets the abnormal content condition, specific abnormal information is determined according to the data parsing operation and / or the interface rendering component construction operation, and corresponding error handling operations are performed according to the specific abnormal information;

[0134] The abnormal content conditions include one or more of abnormal JSON format conditions, abnormal component type conditions, and abnormal component attribute conditions.

[0135] Optionally, the above-mentioned judgment of whether the execution status satisfies a preset abnormal content condition is illustrated by way of example: judging whether there are abnormalities such as JSON format errors (i.e. corresponding to JSON format abnormal conditions), unsupported Widget types (i.e. corresponding to component type abnormal conditions), attribute value type mismatch (i.e. corresponding to component attribute abnormal conditions) in the data parsing and / or component construction process; if so, it is determined that the abnormal content condition is met; if not, it is determined that the abnormal content condition is not met, and this is not limited in the embodiments of the present invention.

[0136] Optionally, the specific exception information may include, but is not limited to, specific information regarding exceptions such as JSON format error, unsupported Widget type, and attribute value type mismatch, which is not limited in the embodiment of the present invention.

[0137] Optionally, corresponding error handling operations are performed, which may include but are not limited to log recording, user prompts, or providing a rollback UI, etc., which are not limited in the embodiments of the present invention.

[0138] It can be seen that this optional embodiment can determine the specific exception information and perform corresponding error handling operations when the data parsing operation and / or the interface rendering component construction operation meets the exception conditions, which is beneficial to improving the comprehensiveness and integrity of the dynamic construction method of the UI interface, and further beneficial to improving the timeliness, accuracy and rationality of error handling in the dynamic construction of the UI interface, thereby helping to improve the security and stability of the dynamic construction of the UI interface.

[0139] Embodiment 2

[0140] See also Figure 2 , Figure 2 This is a flow chart of another method for dynamically constructing a UI interface based on JSON information disclosed in an embodiment of the present invention. Figure 2 The described method can be applied to a device for dynamically constructing a UI interface based on JSON information, wherein the device may include a server, wherein the server includes a local server or a cloud server, which is not limited in the embodiment of the present invention. Figure 2 As shown, the method for dynamically building a UI interface based on JSON information includes the following operations:

[0141] 201. According to the determined target application and the preset target data exchange format, determine the comprehensive component information to be used by the target application.

[0142] Optionally, the comprehensive component information includes information of the target development framework and component information of one or more components based on the target development framework. All components include at least one set type component and / or at least one custom type component related to the target development framework, which is not limited in this embodiment of the present invention.

[0143] Optionally, the comprehensive component information to be used by the target application can be understood as information of all Flutter Widget types to be used in the target application, which is not limited in this embodiment of the present invention.

[0144] Optionally, the target data exchange format may be a JSON format, which is not limited in the embodiment of the present invention.

[0145] Optionally, the target development framework may be Flutter, and the component may be understood as a Flutter Widget, which is not limited in this embodiment of the present invention.

[0146] Optionally, the set type component can be understood as a component in a standard Flutter library; the custom type component can be understood as a customizable component, which is not limited in the embodiment of the present invention.

[0147] 202. According to the comprehensive component information, a corresponding mapping table construction operation is performed to obtain a mapping component table.

[0148] Optionally, the mapping component table is used to indicate a mapping relationship between a set type component and a user-defined type component, which is not limited in the embodiment of the present invention.

[0149] Optionally, the corresponding mapping table construction operation is performed above. For example, a mapping table (which can be a simple Key-Value correspondence table) is established to associate the widget name defined in JSON with the actual Flutter widget type. This mapping table will be used as a reference for the dynamic widget parser to parse JSON, which is not limited in this embodiment of the present invention.

[0150] 203. According to the mapping component table, corresponding file creation and deployment operations are performed to obtain a JSON file.

[0151] Optionally, the designed JSON files are stored on the server so that they can be accessed through network requests. These JSON files predefine the layout of the UI, controls and their properties, etc. and the JSON files stored on the server can be dynamically updated, thereby realizing dynamic changes of the UI without republishing the application, which is not limited to the embodiments of the present invention.

[0152] Optionally, the target development framework is used to parse and process JSON files, the data exchange format of the JSON file matches the target data exchange format, the file name of the JSON file matches the file name of the code file corresponding to the determined target development framework, and the grouping form of the folder associated with the JSON file matches the directory folder path of the target development framework, which is not limited in this embodiment of the present invention.

[0153] Optionally, the file name of the JSON file matches the file name of the code file corresponding to the determined target development framework, which can be understood as: the JSON file name is consistent with the Flutter file name, which is not limited in this embodiment of the present invention.

[0154] Optionally, the grouping form of the folder associated with the above JSON file matches the directory folder path of the target development framework, which can be understood as: the grouping form of the folder is consistent with the folder path of the file component of Flutter, which is not limited in this embodiment of the present invention.

[0155] Furthermore, the JSON of the Flutter component can be exported through UGDynamicWidgetJsonExportor, which is convenient for developers to quickly replace Json after development. Before exporting, real-time preview can be performed through the test environment to prevent abnormal problems when publishing to the release environment, improve development efficiency, reduce errors, and ensure that the actual performance of the application is consistent with expectations. Real-time preview allows developers to instantly view the effects of these changes while updating application code or content, without waiting for the application to be recompiled or deployed, which is not limited in the embodiments of the present invention.

[0156] Further optionally, the present solution may also include, but is not limited to: (1) application integration: in the Flutter application, the dynamic widget library is used to read and parse these JSON files, and the corresponding widget tree is constructed according to the JSON content and displayed on the UI interface; (2) dynamic update and cache processing: if the JSON file is stored on the server, it is also necessary to implement a cache mechanism and automatic update check logic to optimize application performance and update experience, which is not limited in the embodiments of the present invention.

[0157] 204. Determine a target application for which a UI interface needs to be dynamically constructed, and determine a pre-constructed mapping component table and a pre-deployed JSON file based on the target application.

[0158] 205. Determine target JSON data according to the determined layout structure requirement information and JSON file for the target UI interface; the target application is used to display the target UI interface.

[0159] 206. According to the mapping component table, a corresponding data parsing operation is performed on the target JSON data to obtain UI component layout information for the target UI interface.

[0160] 207. According to the UI component layout information, a corresponding interface rendering component construction operation is performed to obtain a rendering component construction result.

[0161] 208. According to the rendering component construction result, a corresponding UI interface display operation is performed to enable the target application to dynamically update the UI interface.

[0162] In the embodiment of the present invention, for other descriptions of step 201 to step 208, please refer to other detailed descriptions of step 101 to step 105 in embodiment 1, and the embodiment of the present invention will not be repeated here.

[0163] It can be seen that the embodiment of the present invention can determine the target JSON data according to the layout structure requirement information, and then perform data parsing operations, component construction operations and interface display operations based on the target JSON data to realize the dynamic construction of the UI interface, which is conducive to improving the comprehensiveness and rationality of the dynamic construction method of the UI interface, and then it is conducive to improving the dynamic construction efficiency and convenience of the UI interface, and it is also conducive to improving the construction accuracy and reliability of the UI interface, so as to improve the update flexibility and application iteration efficiency of the UI interface, and further to improve the scalability of the system and the customization feasibility of the UI interface, speed up the development process, reduce development costs and improve user experience; and, it can also provide a mapping table construction method and a file creation and deployment method, which is conducive to improving the comprehensiveness and integrity of the dynamic construction method of the UI interface based on JSON information, and then it is conducive to improving the pertinence and rationality of the mapping component table and JSON file used, so as to improve the dynamic construction accuracy and reliability of the UI interface.

[0164] In an optional embodiment, the above-mentioned determination of the comprehensive component information to be used by the target application according to the determined target application and the preset target data exchange format may include:

[0165] According to the determined target application and the standard library information corresponding to the target development framework, a corresponding first component identification operation is performed to obtain one or more set type components, and according to the target application, the preset target data exchange format and the user component requirement information, a corresponding second component identification operation is performed to obtain one or more custom type components;

[0166] According to the determined component function and use information, the attribute division result is determined, and according to the attribute division result and the target data exchange format, the corresponding format definition operation is performed on all set type components and all user-defined type components to obtain comprehensive component information.

[0167] Optionally, the type component is set, which can be understood as a component in a standard Flutter library, and is not limited in this embodiment of the present invention.

[0168] Optionally, a custom type component can be understood as a component filled in according to the user's own needs and JSON rules, which is not limited in the embodiment of the present invention.

[0169] Optionally, the above-mentioned corresponding format definition operation is performed according to the attribute division result. For example: when designing the JSON format, it is necessary to determine the attribute division result based on the function, purpose and possible variability of the Widget, and define a corresponding JSON format for each component. This process needs to determine which attributes are required and which are optional, and define standard names for these attributes to obtain comprehensive component information, which is not limited in the embodiments of the present invention.

[0170] Furthermore, after a thorough requirements analysis and prototype design phase, developers can clearly identify the importance of each attribute to define their roles in the JSON format, which is not limited in the embodiments of the present invention.

[0171] It can be seen that this optional embodiment can provide a specific method for determining comprehensive component information, which is conducive to improving the comprehensiveness and rationality of the method for determining comprehensive component information, and further conducive to improving the accuracy and reliability of the determined comprehensive component information, thereby facilitating improving the subsequent mapping component table constructed based on the comprehensive component information. The pertinence, fit and accuracy.

[0172] In another optional embodiment, the above-mentioned corresponding file creation and deployment operations are performed according to the mapping component table to obtain a JSON file, which may include:

[0173] According to the format definition information corresponding to the mapping component table, execute the JSON file creation operation to obtain the JSON file;

[0174] According to the determined file deployment type, determine the target deployment location for deploying the JSON file, and deploy the JSON file to the target deployment location. The file deployment type includes a static deployment type or a dynamic update deployment type. The target deployment location includes one or more of application resources, servers, and cloud storage.

[0175] Optionally, the above-mentioned JSON file creation operation is performed according to the format definition information corresponding to the mapping component table. For example: according to the JSON format defined in the mapping component table, a specific JSON file is created to describe the required UI layout and component properties, which is not limited in the embodiment of the present invention.

[0176] Optionally, the above determines the target deployment location for deploying the JSON file based on the determined file deployment type, and deploys the JSON file to the target deployment location. For example: for static deployment, the JSON file can be directly included in the application resources; for scenarios that require dynamic updates (i.e., dynamic update deployment types), the JSON file can be deployed to a server or cloud storage and dynamically obtained through network requests in the application, which is not limited in the embodiments of the present invention.

[0177] Further optionally, when the file deployment type is a static deployment type, the corresponding target deployment location may be an application resource; when the file deployment type is a dynamic update deployment type, the corresponding target deployment location may be a server or cloud storage, which is not limited in the embodiments of the present invention.

[0178] It can be seen that this optional embodiment can provide a specific method for determining a JSON file, which is conducive to improving the comprehensiveness and rationality of the method for determining a JSON file, and further helps to improve the pertinence, accuracy and reliability of the determined JSON file.

[0179] In yet another optional embodiment, after executing the JSON file creation operation according to the format definition information corresponding to the mapping component table to obtain the JSON file, the method may further include the following operations:

[0180] Determine the file format information and / or file attribute information corresponding to the JSON file, and determine whether the JSON file meets the preset file verification condition according to the file format information and / or file attribute information;

[0181] When it is determined that the JSON file meets the file verification condition, the above steps of determining the target deployment location for deploying the JSON file according to the determined file deployment type and deploying the JSON file to the target deployment location are performed.

[0182] Optionally, determining whether the file verification condition is met can be understood as: verifying the validity and correctness of the JSON file through tools or writing unit tests to ensure that there are no format errors or attribute omissions, which is not limited in the embodiments of the present invention.

[0183] Further optionally, when it is determined that the JSON file does not meet the file verification condition, a corresponding file verification exception handling operation is performed on the JSON file until the JSON file meets the file verification condition, which is not limited in this embodiment of the present invention.

[0184] It can be seen that this optional embodiment can provide a method for determining whether a JSON file satisfies the file verification conditions, and execute subsequent JSON file deployment operations when the file verification conditions are met, which is conducive to improving the comprehensiveness and integrity of the JSON file determination method, and further helps to improve the accuracy, reliability and effectiveness of the determined JSON file, and is also conducive to improving the timeliness, accuracy and reliability of the deployment of JSON files.

[0185] In yet another optional embodiment, judging whether the JSON file satisfies a preset file verification condition according to the file format information and / or the file attribute information may include:

[0186] According to the file format information, determine whether the JSON file meets the preset format error condition to obtain a first judgment result; when the first judgment result is yes, determine that the JSON file does not meet the preset file verification condition; when the first judgment result is no, determine that the JSON file meets the preset file verification condition;

[0187] and / or,

[0188] According to the file attribute information, determine whether the JSON file meets the preset attribute missing condition to obtain a second judgment result; when the second judgment result is yes, determine that the JSON file does not meet the preset file verification condition; when the second judgment result is no, determine that the JSON file meets the preset file verification condition.

[0189] Optionally, the above-mentioned determination of whether the JSON file satisfies a preset format error condition based on the file format information can be understood as: determining whether the JSON file has a format error; if so, determining that the format error condition is satisfied; if not, determining that the format error condition is not satisfied, which is not limited in the embodiment of the present invention.

[0190] Optionally, the above-mentioned judging whether the JSON file satisfies a preset attribute missing condition based on the file attribute information can be understood as: judging whether there is an attribute missing condition in the JSON file; if so, determining that the attribute missing condition is met; if not, determining that the attribute missing condition is not met, which is not limited in the embodiment of the present invention.

[0191] It can be seen that this optional embodiment can determine the file verification condition satisfaction result of the JSON file through the file format level and / or the file attribute level, which is conducive to improving the diversity, flexibility, pertinence and comprehensiveness of the file verification condition satisfaction result determination method, and further helps to improve the accuracy and reliability of the determined file verification condition satisfaction result, thereby helping to improve the verification accuracy and effectiveness of the JSON file.

[0192] Embodiment 3

[0193] See also Figure 3 , Figure 3 This is a schematic diagram of a structure of a device for dynamically building a UI interface based on JSON information disclosed in an embodiment of the present invention. Figure 3 The described device may include a server, wherein the server includes a local server or a cloud server, which is not limited in the embodiment of the present invention. Figure 3 As shown, the UI interface dynamic construction device based on JSON information may include:

[0194] The determination module 301 is used to determine the target application that needs to dynamically construct the UI interface, and determine the pre-constructed mapping component table and the pre-deployed JSON file according to the target application.

[0195] The data determination module 302 is used to determine the target JSON data according to the determined layout structure requirement information and JSON file for the target UI interface; the target application is used to display the target UI interface.

[0196] The data parsing module 303 is used to perform corresponding data parsing operations on the target JSON data according to the mapping component table to obtain UI component layout information for the target UI interface.

[0197] The component construction module 304 is used to perform corresponding interface rendering component construction operations according to the UI component layout information to obtain a rendering component construction result.

[0198] The interface display module 305 is used to perform corresponding UI interface display operations according to the rendering component construction result, so that the target application can realize dynamic update of the UI interface.

[0199] It can be seen that implementation Figure 3 The described UI interface dynamic construction device based on JSON information can determine the target JSON data according to the layout structure requirement information, and then perform data parsing operations, component construction operations and interface display operations based on the target JSON data to realize the dynamic construction of the UI interface, which is conducive to improving the comprehensiveness and rationality of the dynamic construction method of the UI interface, and then conducive to improving the dynamic construction efficiency and convenience of the UI interface, and also conducive to improving the construction accuracy and reliability of the UI interface, thereby facilitating the update flexibility and application iteration efficiency of the UI interface, and further conducive to improving the scalability of the system and the customization feasibility of the UI interface, speeding up the development process, reducing development costs and improving user experience.

[0200] In an optional embodiment, the determination module 301 is also used to determine the comprehensive component information to be used by the target application according to the determined target application and the preset target data exchange format before determining the pre-built mapping component table and the pre-deployed JSON file according to the target application, the comprehensive component information including the information of the target development framework and the component information of one or more components based on the target development framework, all components including at least one set type component and / or at least one custom type component related to the target development framework.

[0201] like Figure 4 As shown, the device may also include:

[0202] The mapping table construction module 306 is used to perform corresponding mapping table construction operations according to the comprehensive component information to obtain a mapping component table, where the mapping component table is used to represent the mapping relationship between the set type component and the user-defined type component.

[0203] The file deployment module 307 is used to perform corresponding file creation and deployment operations according to the mapping component table to obtain a JSON file;

[0204] Among them, the target development framework is used to parse and process JSON files, the data exchange format of the JSON file matches the target data exchange format, the file name of the JSON file matches the file name of the code file corresponding to the determined target development framework, and the grouping form of the folder associated with the JSON file matches the directory folder path of the target development framework.

[0205] It can be seen that implementation Figure 4 The described device can provide a mapping table construction method and a file creation and deployment method, which is conducive to improving the comprehensiveness and integrity of the dynamic construction method of the UI interface based on JSON information, and then is conducive to improving the pertinence and rationality of the mapping component table and JSON file used, thereby helping to improve the accuracy and reliability of the dynamic construction of the UI interface.

[0206] In another optional embodiment, the determination module 301 determines the comprehensive component information to be used by the target application according to the determined target application and the preset target data exchange format, specifically including:

[0207] According to the determined target application and the standard library information corresponding to the target development framework, a corresponding first component identification operation is performed to obtain one or more set type components, and according to the target application, the preset target data exchange format and the user component requirement information, a corresponding second component identification operation is performed to obtain one or more custom type components;

[0208] According to the determined component function and use information, the attribute division result is determined, and according to the attribute division result and the target data exchange format, the corresponding format definition operation is performed on all set type components and all user-defined type components to obtain comprehensive component information.

[0209] It can be seen that implementation Figure 4 The described device can also provide a specific method for determining comprehensive component information, which is conducive to improving the comprehensiveness and rationality of the method for determining comprehensive component information, and further conducive to improving the accuracy and reliability of the determined comprehensive component information, thereby facilitating improving the pertinence, fit and accuracy of the subsequent mapping component table constructed based on the comprehensive component information.

[0210] In another optional embodiment, the file deployment module 307 performs corresponding file creation and deployment operations according to the mapping component table, and the manner of obtaining the JSON file specifically includes:

[0211] According to the format definition information corresponding to the mapping component table, execute the JSON file creation operation to obtain the JSON file;

[0212] According to the determined file deployment type, determine the target deployment location for deploying the JSON file, and deploy the JSON file to the target deployment location. The file deployment type includes a static deployment type or a dynamic update deployment type. The target deployment location includes one or more of application resources, servers, and cloud storage.

[0213] It can be seen that implementation Figure 4 The described device can also provide a specific JSON file determination method, which is conducive to improving the comprehensiveness and rationality of the JSON file determination method, and further helps to improve the pertinence, accuracy and reliability of the determined JSON file.

[0214] In another optional embodiment, the file deployment module 307 is also used to perform a JSON file creation operation according to the format definition information corresponding to the mapping component table, and after obtaining the JSON file, determine the file format information and / or file attribute information corresponding to the JSON file, and judge whether the JSON file meets the preset file verification conditions according to the file format information and / or file attribute information; when it is judged that the JSON file meets the file verification conditions, execute the above-mentioned steps of determining the target deployment location for deploying the JSON file according to the determined file deployment type, and deploying the JSON file to the target deployment location.

[0215] It can be seen that implementation Figure 4The described device can also provide a method for determining whether a JSON file satisfies a file verification condition, and execute subsequent JSON file deployment operations when the file verification condition is met, which is conducive to improving the comprehensiveness and integrity of the JSON file determination method, and thus is conducive to improving the accuracy, reliability and effectiveness of the determined JSON file, and is also conducive to improving the timeliness, accuracy and reliability of the deployment of the JSON file.

[0216] In another optional embodiment, the file deployment module 307 determines whether the JSON file meets the preset file verification condition according to the file format information and / or the file attribute information in a manner specifically including:

[0217] According to the file format information, determine whether the JSON file meets the preset format error condition to obtain a first judgment result; when the first judgment result is yes, determine that the JSON file does not meet the preset file verification condition; when the first judgment result is no, determine that the JSON file meets the preset file verification condition;

[0218] and / or,

[0219] According to the file attribute information, determine whether the JSON file meets the preset attribute missing condition to obtain a second judgment result; when the second judgment result is yes, determine that the JSON file does not meet the preset file verification condition; when the second judgment result is no, determine that the JSON file meets the preset file verification condition.

[0220] It can be seen that implementation Figure 4 The described device can also determine the file verification condition satisfaction result of the JSON file through the file format level and / or the file attribute level, which is conducive to improving the diversity, flexibility, pertinence and comprehensiveness of the file verification condition satisfaction result determination method, and further helps to improve the accuracy and reliability of the determined file verification condition satisfaction result, thereby helping to improve the verification accuracy and effectiveness of the JSON file.

[0221] In another optional embodiment, the determination module 301 is also used to obtain the real-time operation information of the target user for the target UI interface before the data determination module 302 determines the target JSON data based on the determined layout structure requirement information and JSON file for the target UI interface, and determine the layout structure requirement information for the target UI interface based on the real-time operation information; and / or obtain the pre-operation information of the target user for the target UI interface, and determine the pre-loaded data corresponding to the target user based on the pre-operation information; and determine the layout structure requirement information for the target UI interface based on the pre-loaded data.

[0222] It can be seen that implementation Figure 4The described device can also determine the layout structure requirement information through the real-time operation information and / or pre-operation information of the target user, which is conducive to improving the diversity, flexibility and comprehensiveness of the layout structure requirement information determination method, and further conducive to improving the efficiency and convenience of determining the layout structure requirement information, and is also conducive to improving the accuracy and reliability of the determined layout structure requirement information.

[0223] In another optional embodiment, the data parsing module 303 performs corresponding data parsing operations on the target JSON data according to the mapping component table, and obtains the UI component layout information for the target UI interface in a manner specifically including:

[0224] According to the set JSON decoding library, the corresponding first parsing operation is performed on the target JSON data to obtain a data decoding result;

[0225] According to the mapping component table, a corresponding second parsing operation is performed on the data decoding result to obtain UI component layout information for the target UI interface, and the UI component layout information includes at least one or more of UI component type information, UI component attribute information and subcomponent information.

[0226] It can be seen that implementation Figure 4 The described device can also perform parsing operations on the target JSON data through two levels: the JSON decoding library and the mapping component table, and thus obtain UI component layout information, which is beneficial to improving the progressiveness, rationality and comprehensiveness of the method for determining the UI component layout information, and thus is beneficial to improving the accuracy and reliability of the determined UI component layout information.

[0227] In yet another optional embodiment, Figure 4 As shown, the device may also include:

[0228] The error handling module 308 is used to determine the execution status corresponding to the data parsing operation and / or the interface rendering component construction operation, and determine whether the execution status meets the preset abnormal content condition;

[0229] When it is determined that the execution status meets the abnormal content condition, specific abnormal information is determined according to the data parsing operation and / or the interface rendering component construction operation, and corresponding error handling operations are performed according to the specific abnormal information;

[0230] The abnormal content conditions include one or more of abnormal JSON format conditions, abnormal component type conditions, and abnormal component attribute conditions.

[0231] It can be seen that implementation Figure 4The described device can also determine specific exception information and perform corresponding error handling operations when the data parsing operation and / or the interface rendering component construction operation meets the exception conditions, which is conducive to improving the comprehensiveness and integrity of the dynamic construction method of the UI interface, and then to improving the timeliness, accuracy and rationality of error handling in the dynamic construction of the UI interface, thereby helping to improve the security and stability of the dynamic construction of the UI interface.

[0232] Embodiment 4

[0233] See also Figure 5 , Figure 5 is a schematic diagram of the structure of an electronic device disclosed in an embodiment of the present invention. Figure 5 The electronic device described may include a server, wherein the server includes a local server or a cloud server, which is not limited in the embodiment of the present invention. Figure 5 As shown, the electronic device may include:

[0234] A memory 401 storing executable program codes;

[0235] a processor 402 coupled to the memory 401;

[0236] Furthermore, it may also include an input interface 403 and an output interface 404 coupled to the processor 402;

[0237] The processor 402 calls the executable program code stored in the memory 401 to execute the steps in the method for dynamically constructing a UI interface based on JSON information described in the first or second embodiment.

[0238] Embodiment 5

[0239] An embodiment of the present invention discloses a computer storage medium storing a computer program for electronic data exchange, wherein the computer program enables a computer to execute the steps of the method for dynamically constructing a UI interface based on JSON information described in the first or second embodiment.

[0240] Embodiment 6

[0241] An embodiment of the present invention discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute the steps in the method for dynamically constructing a UI interface based on JSON information described in Embodiment 1 or Embodiment 2.

[0242] Embodiment 7

[0243] An embodiment of the present invention discloses a system for dynamically constructing a UI interface based on JSON information. The system includes a device for dynamically constructing a UI interface based on JSON information as described in the third embodiment, and a NAS device that is communicatively connected to the device for dynamically constructing a UI interface based on JSON information; or, the system includes an electronic device as described in the fourth embodiment, and a NAS device that is communicatively connected to the electronic device.

[0244] The device embodiments described above are only illustrative, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.

[0245] Through the specific description of the above embodiments, those skilled in the art can clearly understand that each implementation method 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 above technical solution can be essentially or partly contributed to the prior art in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

[0246] Finally, it should be noted that the method, device and system for dynamically constructing a UI interface based on JSON information disclosed in the embodiments of the present invention only disclose the preferred embodiments of the present invention, which are only used to illustrate the technical solution of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, it should be understood by those skilled in the art that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for dynamically constructing a UI interface based on JSON information, characterized in that: The method comprises: Determine a target application for which a UI interface needs to be dynamically constructed, and determine a pre-constructed mapping component table and a pre-deployed JSON file based on the target application; Determine target JSON data according to the determined layout structure requirement information for the target UI interface and the JSON file; the target application is used to display the target UI interface; According to the mapping component table, a corresponding data parsing operation is performed on the target JSON data to obtain UI component layout information for the target UI interface; According to the UI component layout information, a corresponding interface rendering component construction operation is performed to obtain a rendering component construction result; According to the rendering component construction result, the corresponding UI interface display operation is performed to enable the target application to dynamically update the UI interface.

2. The method for dynamically constructing a UI interface based on JSON information according to claim 1, characterized in that: Before determining the pre-built mapping component table and the pre-deployed JSON file according to the target application, the method further includes: Determine, according to the determined target application and the preset target data exchange format, comprehensive component information to be used by the target application, wherein the comprehensive component information includes information of a target development framework and component information of one or more components based on the target development framework, wherein all the components include at least one set type component and / or at least one user-defined type component related to the target development framework; According to the comprehensive component information, a corresponding mapping table construction operation is performed to obtain a mapping component table, wherein the mapping component table is used to represent a mapping relationship between the set type component and the user-defined type component; According to the mapping component table, perform corresponding file creation and deployment operations to obtain a JSON file; Among them, the target development framework is used to parse and process the JSON file, the data exchange format of the JSON file matches the target data exchange format, the file name of the JSON file matches the file name of the code file corresponding to the determined target development framework, and the grouping form of the folder associated with the JSON file matches the directory folder path of the target development framework.

3. The method for dynamically constructing a UI interface based on JSON information according to claim 2, characterized in that: Determining the comprehensive component information to be used by the target application according to the determined target application and the preset target data exchange format includes: According to the determined target application and the standard library information corresponding to the target development framework, a corresponding first component identification operation is performed to obtain one or more set type components, and according to the target application, the preset target data exchange format and the user component requirement information, a corresponding second component identification operation is performed to obtain one or more custom type components; According to the determined component function usage information, the attribute division result is determined, and according to the attribute division result and the target data exchange format, the corresponding format definition operation is performed on all the set type components and all the custom type components to obtain comprehensive component information.

4. The method for dynamically constructing a UI interface based on JSON information according to claim 2, characterized in that: According to the mapping component table, corresponding file creation and deployment operations are performed to obtain a JSON file, including: According to the format definition information corresponding to the mapping component table, a JSON file creation operation is performed to obtain a JSON file; Determine a target deployment location for deploying the JSON file according to the determined file deployment type, and deploy the JSON file to the target deployment location, wherein the file deployment type includes a static deployment type or a dynamically updated deployment type, and the target deployment location includes one or more of application resources, servers, and cloud storage; And, after performing a JSON file creation operation according to the format definition information corresponding to the mapping component table to obtain the JSON file, the method further includes: Determine file format information and / or file attribute information corresponding to the JSON file, and determine whether the JSON file meets a preset file verification condition based on the file format information and / or the file attribute information; When it is determined that the JSON file meets the file verification condition, the steps of determining a target deployment location for deploying the JSON file according to the determined file deployment type and deploying the JSON file to the target deployment location are performed.

5. The method for dynamically constructing a UI interface based on JSON information according to claim 4, characterized in that: The determining, according to the file format information and / or the file attribute information, whether the JSON file satisfies a preset file verification condition includes: According to the file format information, determine whether the JSON file meets a preset format error condition to obtain a first judgment result; when the first judgment result is yes, determine that the JSON file does not meet the preset file verification condition; when the first judgment result is no, determine that the JSON file meets the preset file verification condition; and / or, According to the file attribute information, determine whether the JSON file meets the preset attribute omission condition to obtain a second judgment result; when the second judgment result is yes, determine that the JSON file does not meet the preset file verification condition; when the second judgment result is no, determine that the JSON file meets the preset file verification condition.

6. The method for dynamically constructing a UI interface based on JSON information according to any one of claims 1 to 5, characterized in that: Before determining the target JSON data according to the determined layout structure requirement information for the target UI interface and the JSON file, the method further includes: Acquire real-time operation information of a target user on a target UI interface, and determine layout structure requirement information for the target UI interface according to the real-time operation information; and / or, Obtain the pre-operation information of the target user for the target UI interface, and determine the pre-loaded data corresponding to the target user based on the pre-operation information; determine the layout structure requirement information for the target UI interface based on the pre-loaded data.

7. The method for dynamically constructing a UI interface based on JSON information according to claim 1, characterized in that: The step of performing corresponding data parsing operations on the target JSON data according to the mapping component table to obtain UI component layout information for the target UI interface includes: According to the set JSON decoding library, a corresponding first parsing operation is performed on the target JSON data to obtain a data decoding result; According to the mapping component table, a corresponding second parsing operation is performed on the data decoding result to obtain UI component layout information for the target UI interface, and the UI component layout information includes at least one or more of UI component type information, UI component attribute information and subcomponent information.

8. The method for dynamically constructing a UI interface based on JSON information according to claim 7, characterized in that: The method further comprises: Determine the execution status corresponding to the data parsing operation and / or the interface rendering component construction operation, and judge whether the execution status meets the preset abnormal content condition; When it is determined that the execution status meets the abnormal content condition, specific abnormal information is determined according to the data parsing operation and / or the interface rendering component construction operation, and corresponding error handling operations are performed according to the specific abnormal information; The abnormal content condition includes one or more of an abnormal JSON format condition, an abnormal component type condition, and an abnormal component attribute condition.

9. A device for dynamically building a UI interface based on JSON information, characterized in that: The device comprises: A determination module is used to determine a target application for which a UI interface needs to be dynamically constructed, and to determine a pre-constructed mapping component table and a pre-deployed JSON file according to the target application; A data determination module, used to determine target JSON data according to the determined layout structure requirement information for the target UI interface and the JSON file; the target application is used to display the target UI interface; A data parsing module, used to perform corresponding data parsing operations on the target JSON data according to the mapping component table, and obtain UI component layout information for the target UI interface; A component construction module is used to perform corresponding interface rendering component construction operations according to the UI component layout information to obtain a rendering component construction result; The interface display module is used to perform corresponding UI interface display operations according to the rendering component construction result, so that the target application can realize dynamic update of the UI interface.

10. An electronic device, characterized in that: The electronic device comprises: A memory storing executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the method for dynamically constructing a UI interface based on JSON information as described in any one of claims 1-8.

11. A computer storage medium, characterized in that: The computer storage medium stores computer instructions, which, when called, are used to execute the method for dynamically constructing a UI interface based on JSON information as described in any one of claims 1 to 8.

12. A UI interface dynamic construction system based on JSON information, characterized in that: The system includes the device for dynamically constructing a UI interface based on JSON information as described in claim 9, and a NAS device communicatively connected to the device for dynamically constructing a UI interface based on JSON information; or, the system includes the electronic device as described in claim 10, and a NAS device communicatively connected to the electronic device.

Citation Information

Cited By

  • Web-based dynamic rendering method and system

    CN120353462A