Graphical user interface generation method and device, storage medium and electronic equipment

By parsing the interface definition file and matching it with the template knowledge base, and combining semantic and structural similarity scores, the target interface template is generated. This solves the problem of uncontrollable generation process in existing technologies and achieves efficient and reliable graphical user interface generation.

CN121680846APending Publication Date: 2026-03-17TSINGHUA UNIVERSITY
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202511903702.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-16
Publication Date
2026-03-17

Smart Images

  • Figure CN121680846A_ABST
    Figure CN121680846A_ABST
Patent Text Reader

Abstract

The invention provides a graphical user interface generation method and device, a storage medium and electronic equipment, and relates to the technical field of computers.The method comprises the steps that an interface definition file input by a user is received; analyzing the interface definition file to obtain a semantic unit in the interface definition file, the semantic unit comprising an interface function, a data structure and a field meaning; matching the semantic unit with a pre-constructed template knowledge base to obtain a target interface template; and mapping data in the interface definition file to a corresponding node of the target interface template to generate a target graphical user interface. By applying the method provided by the embodiment of the invention, the generation efficiency and reliability of the graphical user interface can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to a graphical user interface generation method and device, storage medium and electronic equipment. BACKGROUND

[0002] With the development of large language model technology, graphical user interface generation methods based on model automatic reasoning have become a research hotspot. Such methods usually rely on an end-to-end generation paradigm, which can directly output interface code according to natural language description or structured specification, thereby improving development efficiency to a certain extent.

[0003] However, the existing technology generally has problems such as black-box generation process and uncontrollable output results. The internal decision mechanism of the model is not transparent, making it difficult for developers to intervene and optimize the generation path; at the same time, the output interface often deviates from the design expectation in layout, style and interaction logic, and needs to be repeatedly corrected manually, which cannot meet the demand for high reliability and high efficiency of automatic interface generation. SUMMARY

[0004] The technical problem to be solved by the present application is to provide a graphical user interface generation method, device, storage medium and electronic equipment, which can improve the efficiency and reliability of graphical user interface generation. The specific scheme is as follows:

[0005] A graphical user interface generation method, comprising:

[0006] receiving an interface definition file input by a user;

[0007] parsing the interface definition file to obtain semantic units in the interface definition file, the semantic units including interface functions, data structures and field meanings;

[0008] matching the semantic units with a pre-constructed template knowledge base to obtain a target interface template;

[0009] mapping data in the interface definition file to corresponding nodes of the target interface template to generate a target graphical user interface.

[0010] The above method can optionally comprise the following steps:

[0011] converting the semantic units into semantic vectors;

[0012] filtering candidate templates based on the semantic similarity between the semantic vectors and template vectors in the template knowledge base;

[0013] determine a target interface template matching the semantic feature from each of the candidate templates based on the structural similarity between the structured information in the interface definition file and each of the candidate templates and the semantic similarity.

[0014] The method can further include:

[0015] calculating a tree structure similarity between the structured information in the interface definition file and each of the candidate templates;

[0016] calculating a comprehensive similarity score of each of the candidate templates based on the tree structure similarity and the semantic similarity;

[0017] determining the target interface template matching the semantic feature from each of the candidate templates based on the comprehensive similarity score.

[0018] The method can further include:

[0019] determining a data carrying state of the target interface template relative to the structured information in the interface definition file;

[0020] determining a node operation strategy for a node in the interface template based on the data carrying state;

[0021] performing a corresponding operation on the node according to the node operation strategy and injecting data corresponding to the node in the structured information in the interface definition file into the node.

[0022] The method can further include:

[0023] calling a pre-trained inference model to analyze the structured information in the interface definition file and the interface template;

[0024] obtaining an operation table output by the inference model, the operation table being used to indicate a to-be-processed node and a node operation strategy of the to-be-processed node.

[0025] A graphical user interface generation device can include:

[0026] a receiving unit configured to receive an interface definition file input by a user;

[0027] The parsing unit is configured to parse the interface definition file to obtain semantic units in the interface definition file, wherein the semantic units include interface functions, data structures, and field meanings.

[0028] The matching unit is configured to match the semantic units with a pre-constructed template knowledge base to obtain a target interface template.

[0029] The generating unit is configured to map data in the interface definition file to corresponding nodes of the target interface template to generate a target graphical user interface.

[0030] The device described above, optionally, the matching unit comprises:

[0031] The conversion sub-unit is configured to convert the semantic units into semantic vectors.

[0032] The first execution sub-unit is configured to filter candidate templates based on semantic similarities between the semantic vectors and template vectors in the template knowledge base.

[0033] The determination sub-unit is configured to determine a target interface template that matches the semantic features from the candidate templates based on structural similarities between structured information in the interface definition file and each candidate template and the semantic similarities.

[0034] The device described above, optionally, the determination sub-unit comprises:

[0035] The first calculation module is configured to calculate tree structure similarities between the structured information in the interface definition file and each candidate template.

[0036] The second calculation module is configured to calculate a comprehensive similarity score of each candidate template based on the tree structure similarity of the candidate template and the semantic similarity.

[0037] The determination module is configured to determine a target interface template that matches the semantic features from the candidate templates based on the comprehensive similarity score.

[0038] A storage medium comprises a storage instruction, wherein the instruction controls a device where the storage medium is located to perform the graphical user interface generation method described above when the instruction is executed.

[0039] An electronic device comprises a memory and one or more instructions, wherein the one or more instructions are stored in the memory and are configured to be executed by one or more processors to perform the graphical user interface generation method described above.

[0040] This application provides a method, apparatus, storage medium, and electronic device for generating a graphical user interface (GUI). The method includes: receiving an interface definition file input by a user; parsing the interface definition file to obtain semantic units in the interface definition file, wherein the semantic units include interface functions, data structures, and field meanings; matching the semantic units with a pre-built template knowledge base to obtain a target interface template; and mapping the data in the interface definition file to the corresponding nodes of the target interface template to generate a target GUI. Applying the method provided in this application can improve the efficiency and reliability of GUI generation. Attached Figure Description

[0041] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0042] Figure 1 A flowchart of a graphical user interface generation method provided in this application;

[0043] Figure 2 A schematic diagram of the template bearing state provided in this application;

[0044] Figure 3 A schematic diagram of a graphical user interface generation device provided in this application;

[0045] Figure 4 This is a schematic diagram of the structure of an electronic device provided in this application. Detailed Implementation

[0046] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0047] In this application, the terms "comprising" or "including" or any other variation thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.

[0048] Embodiments of the present application provide a graphical user interface generation method, which can be applied to an electronic device, such as a mobile terminal, a tablet computer, or a server. The method flowchart of the method is shown in Figure 1 The method specifically includes the following steps.

[0049] S101: Receive an interface definition file input by a user.

[0050] In this embodiment, the interface definition file is a normative document used to describe a data interface or a service.

[0051] Specifically, the interface definition file input by the user can be received through various interactive channels. For example, when the electronic device is an integrated development environment plug-in, the user can specify a local interface definition file through a file selector or a drag-and-drop operation of a graphical interface. When the electronic device is a server, the system can provide a standard RESTful upload interface to receive file content transmitted by a client through an HTTP POST request, or automatically obtain a target file through a remote resource locator specified by a configuration file.

[0052] S102: Parse the interface definition file to obtain semantic units in the interface definition file, the semantic units including interface functions, data structures, and field meanings.

[0053] In this embodiment, the semantic unit refers to an information unit with independent business or functional significance extracted from the interface definition. The interface function represents the business action or purpose completed by the interface, the data structure describes the hierarchical organization form of the core data object involved in the interface, and the field meaning refers to the business interpretation and constraints of each basic constituent unit (field) in the data object.

[0054] Specifically, when implementing the parsing, a corresponding parser needs to be called according to the specific format of the interface definition file. First, syntax verification is performed to ensure that the file format is correct, and then an abstract representation, such as an abstract syntax tree or a specific domain object model, is constructed.

[0055] On this basis, the internal model is traversed to extract the semantic units. For example, from the fields or endpoint paths of the interface, combined with simple natural language processing such as keyword extraction, interface functions such as "user login" and "order query" can be summarized. From the definition, the object, attribute and array nesting relationship are extracted to form a tree model representing the data structure. For each leaf node (i.e. field) in the tree model, its name, data type, format and description text are extracted to form the complete field meaning of the field.

[0056] S103: Match the semantic units with a pre-constructed template knowledge base to obtain a target interface template.

[0057] In the embodiment, the template knowledge base refers to a pre-constructed and maintained structured repository that stores a large number of high-quality interface design patterns. The target interface template refers to an interface design prototype retrieved from the knowledge base that best fits the semantics of the current interface.

[0058] Specifically, each interface template in the template knowledge base includes a renderable interface code snippet, and a UI component tree, layout relationship and component attributes corresponding to the interface code snippet. In these attributes, semantic placeholders are pre-defined, such as "user name label", "product list container" and "submit button", to represent the semantics of the data or interaction expected to be carried by the position.

[0059] In the embodiment, the interface function can be used for coarse screening to filter out templates that are completely unrelated in terms of function. Then, for the candidate templates, two kinds of similarity are calculated in parallel: one is the structural similarity between the data structure and the template UI component tree, which can be measured by calculating the edit distance or overlap between the two trees; the other is the semantic similarity between the field meaning and the semantic placeholder text in the template, which is specifically converted into a vector by a text embedding model and then the cosine similarity is calculated.

[0060] Finally, the two similarity scores are weighted and fused to obtain a comprehensive matching score for each candidate template. The template with the highest score is selected as the target interface template.

[0061] In an optional embodiment, when the semantic similarity is low, the weight of the structural similarity can be appropriately increased to ensure that a structurally usable template can still be obtained when a perfect semantic match cannot be found.

[0062] S104: Map the data in the interface definition file to the corresponding nodes of the target interface template to generate a target graphical user interface.

[0063] In the embodiment, the nodes of the target interface template can be filled, adjusted or extended according to the specific content of the interface definition. The nodes correspond to specific components or their attributes in the template UI component tree. The target graphical user interface refers to the finally generated visual interface code that can be directly run or deployed.

[0064] Specifically, the mapping process can be as follows:

[0065] When there is a field in the interface that corresponds to the semantic placeholder of the node in height, the data binding operation is performed, that is, the example value of the field or the simulated value generated according to its type is filled into the corresponding attribute of the node.

[0066] When the number of data items of an array type field in the interface exceeds the preset capacity of the corresponding list container node in the template, the node loop and copy operation is performed, and a plurality of node instances are generated in a loop to carry all data items according to the single item style in the template.

[0067] When there are certain fields in the interface that do not find suitable semantic placeholder nodes corresponding to them in the template, conditional node generation can be triggered. For example, a lightweight component generation model is called to insert a basic text display or input component at a suitable position in the template tree according to the semantics and type of the field.

[0068] After completing the mapping operation of all nodes, the interface description tree obtained by mapping is compiled into component code of the target front-end framework, or rendered into standard HTML, CSS and JavaScript files, so as to obtain the target graphical user interface. In addition, in order to ensure the usability of the generated interface, simple layout checking or style reconciliation based on rules can be introduced before or after compilation, such as checking whether the element overflows the container, whether the main operation button is visible, etc.

[0069] By using the method provided in the embodiment, the graphical user interface generation efficiency and reliability can be improved.

[0070] In an embodiment provided in the present application, based on the above scheme, optionally, the matching of the semantic unit with the pre-constructed template knowledge base to obtain the target interface template comprises:

[0071] Converting the semantic unit into a semantic vector;

[0072] Filtering candidate templates based on the semantic similarity between the semantic vector and the template vector in the template knowledge base;

[0073] Determining the target interface template that matches the semantic features in each of the candidate templates based on the structural similarity between the structured information in the interface definition file and the structure of each candidate template, and the semantic similarity.

[0074] In the embodiment, the semantic vector refers to a high-dimensional numerical vector representing deep semantics of a semantic unit in text form converted by an embedding model.

[0075] Optionally, the template vector stored in the template knowledge base is a vector representation comprehensively representing design intention and component semantics of each interface template generated in advance. The semantic similarity specifically refers to a score obtained by calculating the distance between two semantic vectors.

[0076] Specifically, when converting a semantic unit into a semantic vector, different processing strategies can be adopted for different types of semantic units. For example, for a general text such as “interface function”, the description text (e.g., “user login authentication”) can be directly input into a pre-trained language model to obtain its vector representation. For a “data structure” and “field meaning” composed of multiple fields, the names, types, and description texts of all fields can be spliced into a comprehensive semantic paragraph, which is then converted into a vector as a whole; or, a vector can be generated for each field independently, and then aggregated into a comprehensive vector representing the entire data structure.

[0077] In the embodiment, the semantic vector can be compared with all template vectors in the template knowledge base to calculate the semantic similarity. A template with a semantic similarity greater than a threshold value is selected as a candidate template, or multiple templates are selected as candidate templates according to the order of semantic similarity from large to small.

[0078] The structured information refers to a tree structure representing data hierarchical relationship parsed from the interface definition file. The structural similarity is used to measure the matching degree of the interface data structure and the UI component tree of the candidate template in the form topology. The specific calculation method can include a tree edit distance algorithm, which calculates the minimum number of editing operations (such as inserting, deleting, and replacing nodes) required to convert one tree into another. The fewer the operations, the more similar the structure.

[0079] In an embodiment provided in the application, based on the above-mentioned scheme, optionally, the target interface template matching the semantic features is determined from each candidate template based on the structural similarity between the structured information in the interface definition file and each candidate template, and the semantic similarity.

[0080] The tree structure similarity between the structured information in the interface definition file and each candidate template is calculated.

[0081] The comprehensive similarity score of each candidate template is calculated based on the tree structure similarity of each candidate template and the semantic similarity.

[0082] Based on the comprehensive similarity score, a target interface template that matches the semantic features is determined from each of the candidate templates.

[0083] In this embodiment, tree structure similarity is used to measure the degree of similarity between the structured information parsed from the interface definition and the UI component tree corresponding to the candidate template in terms of topological shape and hierarchical organization.

[0084] The overall similarity score is generated by combining the tree structure similarity with the calculated semantic similarity through a preset fusion rule, resulting in a single score representing the overall matching degree.

[0085] Specifically, when calculating the similarity of the tree structures, both the structured information of the interfaces and the UI definitions of the candidate templates need to be represented as standardized tree structures. The interface data tree uses objects and arrays as nodes and containment relationships as edges; the template component tree uses interface elements (such as containers, forms, and buttons) as nodes and parent-child layout relationships as edges. The similarity between the two can be calculated using an algorithm based on tree edit distance. This algorithm calculates the minimum cost required to transform one tree into another through a series of node "insertion," "deletion," and "replacement" operations. This minimum cost is called the edit distance.

[0086] After obtaining the tree structure similarity of each candidate template, the system needs to fuse it with the corresponding semantic similarity to calculate the comprehensive similarity score.

[0087] In an optional embodiment, a weighted summation method can be used to calculate the overall similarity score of each candidate template, as shown in the formula:

[0088] Overall similarity score = α * semantic similarity + β * structural similarity

[0089] Where α and β are preset weighting coefficients.

[0090] In this embodiment, the candidate template with the highest overall similarity score is determined as the target interface template.

[0091] In another optional embodiment, when there are multiple templates with similar semantics, the one with higher structural similarity is selected first; or, when the structural similarity of the optimal semantic matching template is lower than the threshold, the confidence of this match is considered insufficient, and the template with the second best semantic similarity but higher structural matching degree is selected instead, thereby ensuring that the generated interface is not only semantically relevant, but also reasonably laid out.

[0092] In one embodiment provided in this application, based on the above-described solution, optionally, the step of mapping the data in the interface definition file to the corresponding node of the target interface template to generate the target graphical user interface includes:

[0093] Determine the data carrying state of the target interface template relative to the structured information in the interface definition file;

[0094] Based on the data carrying status, determine the node operation strategy for the nodes in the interface template;

[0095] According to the node operation strategy, the corresponding operation is performed on the node, and the data corresponding to the node in the structured information of the interface definition file is injected into the node.

[0096] In this embodiment, the data carrying status can be used as an indicator to quantitatively evaluate the capacity and form adaptation relationship between the preset structure of the target interface template and the structured information provided by the interface definition file. Specifically, it represents the extent to which the template, as a container, can accommodate and present the input data, and the structural correspondence between the two.

[0097] Specifically, the carrying capacity status can include: 1. A state of structural emptiness or capacity redundancy, where the node structure reserved in the template for a certain type of data has a designed capacity greater than the scale or subdivision of the corresponding data in the actual interface; 2. A state of data overflow or insufficient capacity, where certain structures or data items in the interface data do not have predefined, semantically matching nodes in the template to carry them; 3. A state of partial matching, where the two can form a good mapping in some subtrees or nodes, but each contains independent parts that the other does not have. The state can be determined based on intermediate results such as tree structure similarity and node alignment relationships.

[0098] When determining node operation strategies based on the carrying status, appropriate operation instructions are assigned to the affected nodes in the template tree. For example, for nodes in a capacity redundancy state, the operation strategy could be node pruning or attribute hiding, i.e., removing the node or some of its display attributes to avoid blank areas with no content on the interface. For data overflow states, the corresponding strategy could be node cyclic generation or dynamic node creation, i.e., copying or creating new nodes on the basis of the original template structure to carry the excess data. For nodes that can be directly matched in a partially matched state, the strategy is direct data binding. Optionally, a strategy can be quickly assigned to each node using a table lookup method.

[0099] In this embodiment, the template tree is traversed and corresponding operations are performed according to the determined node operation strategy. When pruning nodes, the node may be directly removed from the rendering tree, or a style attribute that is not displayed may be added to it. When generating nodes in a loop, the length of the array-type data in the interface needs to be read, and the style of each list item node defined in the template is copied and bound to the data items one by one. When creating dynamic nodes, a lightweight component generator may be called to generate a basic type of display component, such as a checkbox or text label, based on the type and semantic description of the missing fields. After all structural adjustment operations are completed, the data injection step fills the corresponding attributes of each leaf node with the specific field information from the interface definition, such as field names, example values, or simulated values ​​generated according to the type.

[0100] Additionally, it's important to note that different nodes within a template may be in different states. Therefore, the above process is recursive or iterative, first addressing the overall structural adaptation, then handling the specific data injection. It's easy to understand that this mapping approach—analyzing the state first, then determining the strategy, and finally executing the operation—systematically handles complex situations where various data and templates don't match. This allows the automatically generated interface to maximize the design advantages of high-quality templates while flexibly adapting to input data of different specifications.

[0101] In one embodiment provided in this application, based on the above-described solution, optionally, determining the node operation strategy for the nodes in the interface template based on the data carrying state includes:

[0102] The pre-trained inference model is invoked to analyze the structured information in the interface definition file and the interface template;

[0103] Obtain the operation table output by the inference model, which is used to indicate the node to be processed and the node operation strategy of the node to be processed.

[0104] In this embodiment, the pre-trained inference model refers to a machine learning model with optimized parameters specifically designed to understand the relationship between structured data and interface templates and to make operational decisions. Specifically, it can be a finely tuned large language model.

[0105] Optionally, the operation table is a structured result output by the inference model after it has worked. It can be a piece of JSON or a text in a specific format, which explicitly lists the node identifiers of the nodes to be processed that need attention, as well as the recommended node operation strategy for each node to be processed.

[0106] Specifically, when the inference model is invoked for analysis, the contextual information is organized into prompts that the model can understand. For example, structured information extracted from the interface definition file and an abstract representation of the target interface template can be concatenated and provided to the inference model as input text. Additionally, the input will include specific task instructions and output format requirements, such as requiring the model to "analyze how each template component node should be adjusted to adapt to the data based on the given data specifications and interface template, and output the node ID and suggested operation type in list form."

[0107] After receiving this information, the inference model performs internal reasoning. In this process, the model comprehensively considers the semantics of the data, the design intent of the template nodes, and the structural and semantic correspondence between the two, generating a decision for each node it deems necessary to process. Finally, the model outputs text, i.e., the operation table, in the required format.

[0108] It should be noted that this method of generating operation tables based on inference models can handle complex and non-standard mapping scenarios. This improves the system's adaptability to diverse inputs and the quality of the generated results.

[0109] This invention proposes a graphical user interface (GUI) generation system based on a retrieval-enhanced generation mechanism. It adopts a "Reference-Generated User Interface (RGUI)" paradigm, decoupling the generation process into two distinct stages: "reference matching" and "data embedding," thereby achieving interpretability and controllability. The system mainly includes a reference template knowledge base, a reference matching subsystem, and an interface generation subsystem. The knowledge base stores validated, high-quality interface templates described in a tree structure. The reference matching subsystem extracts semantic units by parsing the input structured information (such as API definitions) and, using a multi-representation index compression mechanism, comprehensively calculates the similarity between the template and the reference template in both structural and semantic dimensions, thereby retrieving the optimal matching template. The interface generation subsystem, based on the matching template, calls corresponding node operation strategies (such as replacement, expansion, and inheritance) according to the data carrying status of nodes (such as structurally empty or partially carrying), completing data binding and attribute injection. It then optimizes the layout and renders the interface using a fine-tuned inference model, ultimately outputting directly deployable front-end code.

[0110] In practical implementation, the system first extracts key semantic units such as interface functions, data structures, and field meanings from the structured input through a semantic parsing module, and maps them into high-dimensional vectors for matching with the template knowledge base. Then, an interface similarity algorithm is used to filter candidate templates and determine the optimal reference. Subsequently, in the data embedding stage, such as... Figure 2As shown, based on the template's node hierarchy and the identified data carrying status, node-level semantic mapping and style mapping can be dynamically executed, enabling flexible data binding and component generation. The system supports server-side services via RESTful interfaces and also runs as a design tool plugin on the client side, exhibiting good scalability and compatibility with various front-end frameworks.

[0111] This solution introduces the RAG mechanism into the field of interface generation, making the generation path transparent through explicit template matching; it proposes a two-dimensional template matching algorithm that combines tree structure and semantic nodes, and adopts a multi-representation index compression mechanism to reduce storage overhead and improve retrieval efficiency; it designs a node operation mechanism based on data carrying state, achieving a balance between high precision and high generation speed, so that the generated interface maintains the consistency of design specifications while having excellent traceability and controllability.

[0112] and Figure 1 Corresponding to the method described herein, embodiments of this application also provide a graphical user interface generation apparatus, applied to electronic devices, for use in generating graphical user interfaces. Figure 1 The specific implementation of the method is shown in the schematic diagram of the device. Figure 3 As shown, it includes:

[0113] The receiving unit 301 is used to receive the interface definition file input by the user;

[0114] The parsing unit 302 is used to parse the interface definition file to obtain the semantic units in the interface definition file, wherein the semantic units include interface functions, data structures and field meanings;

[0115] The matching unit 303 is used to match the semantic unit with a pre-built template knowledge base to obtain the target interface template.

[0116] The generation unit 304 is used to map the data in the interface definition file to the corresponding nodes of the target interface template to generate the target graphical user interface.

[0117] In one embodiment provided in this application, based on the above-described solution, optionally, the matching unit includes:

[0118] A transformation subunit is used to convert the semantic unit into a semantic vector;

[0119] The first execution subunit is used to filter candidate templates based on the semantic similarity between the semantic vector and the template vector in the template knowledge base;

[0120] A subunit is defined to determine a target interface template that matches the semantic features among the candidate templates based on the structured information in the interface definition file and the structural similarity between each candidate template and the semantic similarity.

[0121] In one embodiment provided in this application, based on the above-described solution, optionally, the determining subunit includes:

[0122] The first calculation module is used to calculate the tree structure similarity between the structured information in the interface definition file and each candidate template;

[0123] The second calculation module is used to calculate the comprehensive similarity score of each candidate template based on the tree structure similarity and the semantic similarity.

[0124] The determination module is used to determine the target interface template that matches the semantic features from each of the candidate templates based on the comprehensive similarity score.

[0125] The specific principles and execution processes of each unit and module in the graphical user interface generation apparatus disclosed in the above embodiments of this application are related to... Figure 1 The graphical user interface generation method disclosed in the embodiments is the same, and can be found in the corresponding part of the graphical user interface generation method provided in the embodiments of this application above, which will not be repeated here.

[0126] This application also provides a storage medium, which includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the above-described graphical user interface generation method or the above-described mobile device control method.

[0127] This application also provides an electronic device, the structural schematic diagram of which is shown below. Figure 4 As shown, it specifically includes a memory 401 and one or more instructions 402, wherein one or more instructions 402 are stored in the memory 401 and configured to be executed by one or more processors 403 to perform the above-described graphical user interface generation method.

[0128] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For apparatus embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0129] Finally, it should be noted that in this paper, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations.

[0130] For ease of description, the above devices are described separately by function as various units. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware.

[0131] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.

[0132] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method of generating a graphical user interface, characterized by, The method comprises the following steps: receiving an interface definition file input by a user; parsing the interface definition file to obtain semantic units in the interface definition file, wherein the semantic units comprise interface functions, data structures, and field meanings; matching the semantic units with a pre-constructed template knowledge base to obtain a target interface template; mapping data in the interface definition file to corresponding nodes of the target interface template to generate a target graphical user interface.

2. The method of claim 1, wherein, The matching the semantic units with the pre-constructed template knowledge base to obtain the target interface template comprises: converting the semantic units into semantic vectors; screening candidate templates based on semantic similarities between the semantic vectors and template vectors in the template knowledge base; determining a target interface template that matches the semantic features among the candidate templates based on structural similarities between structured information in the interface definition file and structures of the candidate templates, and the semantic similarities.

3. The method of claim 2, wherein, The determining the target interface template that matches the semantic features among the candidate templates based on the structural similarities between the structured information in the interface definition file and the structures of the candidate templates, and the semantic similarities comprises: calculating tree structure similarities between the structured information in the interface definition file and each candidate template; calculating a comprehensive similarity score of each candidate template based on the tree structure similarity of the candidate template and the semantic similarity; determining the target interface template that matches the semantic features among the candidate templates based on the comprehensive similarity score.

4. The method of claim 1, wherein, The mapping the data in the interface definition file to the corresponding nodes of the target interface template to generate the target graphical user interface comprises: determining a data bearing state of the target interface template relative to the structured information in the interface definition file; determining a node operation strategy for a node in the interface template based on the data bearing state; performing a corresponding operation on the node according to the node operation strategy, and injecting data corresponding to the node in the structured information in the interface definition file into the node.

5. The method of claim 4, wherein, The determining the node operation strategy for the node in the interface template based on the data bearing state comprises: calling a pre-trained inference model to analyze the structured information in the interface definition file and the interface template; obtaining an operation table output by the inference model, wherein the operation table is used to indicate a to-be-processed node and a node operation strategy of the to-be-processed node.

6. A graphical user interface generation apparatus characterized by comprising: The method comprises the following steps: receiving an interface definition file input by a user; parsing the interface definition file to obtain semantic units in the interface definition file, wherein the semantic units comprise interface functions, data structures, and field meanings; matching the semantic units with a pre-constructed template knowledge base to obtain a target interface template; mapping data in the interface definition file to corresponding nodes of the target interface template to generate a target graphical user interface.

7. The apparatus of claim 6, wherein, The matching unit comprises: a conversion subunit configured to convert the semantic units into semantic vectors; The first execution subunit is configured to filter candidate templates based on semantic similarity between the semantic vector and template vectors in the template knowledge base; The determining subunit is configured to determine a target interface template matching the semantic features from the candidate templates based on structural similarity between structured information in the interface definition file and each candidate template and the semantic similarity.

8. The apparatus of claim 7, wherein, The determining subunit comprises: A first calculation module configured to calculate tree structure similarity between the structured information in the interface definition file and each candidate template; A second calculation module configured to calculate a comprehensive similarity score of each candidate template based on the tree structure similarity of the candidate template and the semantic similarity; A determining module configured to determine a target interface template matching the semantic features from the candidate templates based on the comprehensive similarity score.

9. A storage medium, characterized by The storage medium comprises stored instructions, wherein the instructions, when executed, control a device in which the storage medium is located to perform the graphical user interface generation method of any one of claims 1-5.

10. An electronic device, comprising: A computer program product, comprising a memory, and one or more instructions stored in the memory and configured to be executed by one or more processors to perform the graphical user interface generation method of any one of claims 1-5.

Citation Information

Cited By

  • Semantic driving-based user interface generation method and device

    CN121979527A

  • A semantic-driven user interface generation method and device

    CN121979527B