User interface generation method and device, storage medium and electronic device
Through structured processing and the utilization of code big models, the problem of single user interface generation method is solved, personalized and flexible display of user interface is realized, and the diverse needs of different users are met, and the flexibility and response efficiency of interface generation are improved. .
Patent Information
- Application Number
- CN202410870301.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-11-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, the user interface generation method is single, and cannot be flexibly determined based on data changes, making it difficult to realize adaptive display of dynamic data and diversified data.
By structuring the requirements data, input it and user interface environment data into the code model, use the trained code model to generate target code, and engineer and render it to achieve personalized and flexible display of the user interface.
It realizes the real-time generation of user interfaces that meet personalized characteristics based on user needs, which can quickly respond to demand changes, meet diverse interface needs, and improves the flexibility and response efficiency of user interface generation.
Smart Images

Figure CN118916029A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and more specifically, to a method and device for generating a user interface, a storage medium, and an electronic device. Background Art
[0002] With the rapid development of generative artificial intelligence (AI GC, also known as AI) technology, agent applications based on conversational interaction are gradually replacing applications that interact through traditional graphical user interfaces (GUI). This new interaction method provides users with a more natural and intuitive interactive experience through natural language interaction. However, despite the significant convenience brought by the conversational interaction method, many non-text information such as pictures, lists, and media audio still need to be displayed through the user interface (UI) style, and some scenes that require interaction still cannot do without UI. However, the current related technologies usually rely on predefined codes and fixed display methods, lack the ability to adapt to dynamic and diversified data, and are difficult to achieve flexible real-time generation and on-demand display of UI.
[0003] With regard to related technologies, no effective solution has been proposed so far for the problem that the user interface generation method is single and cannot be flexibly determined according to data changes.
[0004] Therefore, it is necessary to improve the related technology to overcome the above-mentioned defects in the related technology. Summary of the invention
[0005] Embodiments of the present application provide a method and device for generating a user interface, a storage medium, and an electronic device.
[0006] According to one aspect of an embodiment of the present application, a method for generating a user interface is provided, comprising: when it is determined that a target user needs to generate a target user interface, structured processing is performed on the demand data corresponding to the target user to obtain first data, wherein the structured processing is used to align the fields in the demand data with the standard field format of the target user interface to be generated; when second data corresponding to the environment in which the target user interface is to be displayed is obtained, the first data and the second data are input into a large code model to obtain a target code for the target user interface; wherein the large code model is trained by using historical customized data of the target user, the historical customized data comprising: multiple groups of historical codes and corresponding historical demand data and corresponding historical environment data, the historical codes generating a user interface corresponding to the historical demand data when the historical environment data is running; engineering the target code according to the system framework type of the device to display the target user interface, and performing code rendering based on the engineering result to generate the target interface to be displayed.
[0007] In an exemplary embodiment, when the second data corresponding to the environment to be displayed of the target user interface is obtained, the first data and the second data are input into the code big model to obtain the target code of the target user interface, and the above method also includes: obtaining the historical customization data corresponding to the target user, wherein the historical customization data is unstructured data; identifying the customized features corresponding to the historical customization data, wherein the customized features at least include: the parameters of the user interface components of the target user, the style of the user interface components of the target user, and the attributes of the user interface components of the target user; the customized features are structured data; mapping the customized features to a preset standard data structure to obtain a target standard data structure; performing code conversion on the target standard data structure to obtain the standardized code corresponding to the historical customization data; associating the standardized code with the target data of the presentation environment corresponding to the historical customization data to generate a training set of the initial big model for training the code big model.
[0008] In an exemplary embodiment, when it is determined that the target user needs to generate a target user interface, the demand data corresponding to the target user is structured and processed before obtaining the first data. The method also includes: receiving question information input by the target user; counting the information set of the question information sent by the target user in a preset identification period, and parsing the information set; and determining whether the target user needs to generate a target user interface based on the parsing result.
[0009] In an exemplary embodiment, determining whether the target user needs to generate a target user interface based on the analysis result includes: when it is determined according to the analysis result that the target user needs to generate a target user interface, activating a processing flow for historical customization data corresponding to the target user, wherein the processing flow is used to generate a training set corresponding to the historical customization data; and / or, when it is determined according to the analysis result that the target user does not need to generate a target user interface, sending a prompt message to the target user, wherein the prompt message is used to prompt the target user to re-provide the generation requirement of the user interface.
[0010] In an exemplary embodiment, the above method also includes: determining the interface style type set by the target user in the operation interface; arranging the results of code rendering in a plurality of different orders according to the interface style type to generate a plurality of target style interfaces; visually displaying the plurality of target style interfaces to the target user respectively, and determining the target style interface of the final application according to the selection instruction input by the target user.
[0011] In an exemplary embodiment, after the multiple target style interfaces are respectively visually displayed to the target user and the target style interface of the final application is determined according to the selection instruction input by the target user, the above method also includes: selecting at least one component element of the target style interface according to a preset reverse self-check strategy; determining the target first data corresponding to the at least one component element, wherein the first data includes requirement data for indicating the generation of the corresponding component element; inputting the target first data into the code big model to obtain the sub-code to be reverse-checked; determining the difference between the sub-code and the target sub-code corresponding to the at least one component element in the target code; and determining the recognition accuracy of the code big model according to the difference.
[0012] In an exemplary embodiment, the target code is engineered according to the system framework type of the device to display the target user interface, including: obtaining the device type of the device and the system framework type of the device type; converting the target code based on a code filling strategy corresponding to the system framework type to obtain a framework native code that is allowed to run through the system framework type; and determining that the engineering of the target code is completed when it is determined that the framework native code corresponding to the target code is generated.
[0013] According to another aspect of an embodiment of the present application, a user interface generation device is also provided, including: a processing module, which is used to perform structured processing on the demand data corresponding to the target user when it is determined that the target user needs to generate a target user interface, so as to obtain first data, wherein the structured processing is used to align the fields in the demand data with the standard field format of the target user interface to be generated; an input module, which is used to input the first data and the second data into a code model when second data corresponding to the environment to be displayed of the target user interface is obtained, so as to obtain the target code of the target user interface; wherein the code model is trained by using the historical customized data of the target user, and the historical customized data includes: multiple groups of historical codes and corresponding historical demand data and corresponding historical environment data, and the historical code generates the user interface corresponding to the historical demand data when the historical environment data is run; a rendering module, which is used to engineer the target code according to the system framework type of the device to display the target user interface, and perform code rendering based on the engineering result to generate the target interface to be displayed.
[0014] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned method for generating a user interface when running.
[0015] According to another aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the method for generating a user interface through the computer program.
[0016] Through this application, the target user's demand data is standardized, and the first data after the standardization and the second data corresponding to the environment to be displayed by the user interface are input into the code model, and the interface setting features of the current target user are aligned with the trained code model, so as to generate the target code that conforms to the current target user's habits. After that, the target code is engineered, rendered, and other operations are performed to obtain data content that can be performed on the operation interface associated with the target user, so as to achieve the purpose of generating the relevant user interface in real time according to the personalized characteristics of the target user and quickly displaying it to the target user. The above technical solution solves the problem that the generation method of the user interface in the related technology is single and cannot be flexibly determined according to the data changes. Then, when the target user's demand data fluctuates greatly, the corresponding code can be directly output according to the demand data and the code model corresponding to the target user, and the output code can be flexibly rendered into data that can be displayed in different styles as needed, so as to achieve accurate and effective response to the user interface display needs of the target user, and meet the diversified interface needs of different target users. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The exemplary embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0018] Figure 1 It is a hardware structure block diagram of an interface generation device of a method for generating a user interface according to an embodiment of the present application;
[0019] Figure 2 is a flowchart of a method for generating a user interface according to an embodiment of the present application;
[0020] Figure 3 This is a schematic diagram of a process for generating a human-computer interaction interface in real time according to an optional embodiment of the present application;
[0021] Figure 4 is a structural block diagram of a device for generating a user interface according to an embodiment of the present application;
[0022] Figure 5 This is another structural block diagram of a device for generating a user interface according to an embodiment of the present application. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0024] It should be noted that the terms and "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0025] The method embodiments provided in the embodiments of the present application can be executed in an interface generation device, a computer terminal or a similar computing device. Taking running on an interface generation device as an example, Figure 1 FIG. 1 is a hardware structure block diagram of an interface generation device of a method for generating a user interface according to an embodiment of the present application. Figure 1 As shown, the interface generation device may include one or more ( Figure 1 Only one is shown in the figure) processor 102 (processor 102 may include but is not limited to a microprocessor (Microprocessor Unit, referred to as MPU) or a programmable logic device (Programmable logic device, referred to as PLD)) and a memory 104 for storing data. In an exemplary embodiment, the interface generation device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned interface generation device. Figure 1 More or fewer components as shown, or with Figure 1 Equivalent functions or comparisons shown Figure 1 A different configuration with more features is shown.
[0026] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for generating a user interface in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, which is equivalent to implementing the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the interface generation device via a network. Examples of the above network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0027] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the interface generation device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0028] In this embodiment, a method for generating a user interface is provided. Figure 2 : is a flowchart of a method for generating a user interface according to an embodiment of the present application, the process comprising the following steps:
[0029] Step S202, when it is determined that the target user needs to generate a target user interface, structural processing is performed on the demand data corresponding to the target user to obtain first data, wherein the structural processing is used to align the fields in the demand data with the standard field format of the target user interface to be generated;
[0030] As an optional implementation, the above method can be applied in an interface generation application. For example, when the target user operates on the interface generation application, it is determined that the current target user needs to generate a new user interface based on the target user's operation intention. At the same time, the target user can also flexibly output demand data for personalized settings for the user interface in the interface generation application, such as the button size, button color, and button background color on the user interface, so that the target user can control the style of the final generated user interface, thereby improving the target user's experience in controlling the generation of the user interface. In addition, since the target user inputs the demand data into the interface generation application based on his or her own habits, there are format differences between the fields in the demand data and the standard fields of the target user interface. Then, data alignment at the field level is performed through structured processing to ensure that the subsequent interface generation application can accurately respond to the target user's corresponding demand data, thereby improving the fit between the final generated user interface and the demand data.
[0031] Step S204, when the second data corresponding to the environment to be displayed of the target user interface is obtained, the first data and the second data are input into the code big model to obtain the target code of the target user interface; wherein the code big model is trained by using the historical customization data of the target user, the historical customization data includes: multiple groups of historical codes and corresponding historical demand data and corresponding historical environment data, and the historical code generates the user interface corresponding to the historical demand data when the historical environment data is run;
[0032] It can be understood that in order to ensure that the target code that meets the target user can be quickly generated, the historical customization data of the user interface generated by the target user can also be determined, wherein the historical customization data not only includes the historical code of the historical interface corresponding to the target user, but also includes the historical environment data of using the historical code, and the historical environment data, historical code, and historical demand data are interconnected. By using the above-mentioned historical customization data as training data to train the code model, the trained code model can quickly and accurately locate the corresponding code according to the environment data and demand data, thereby realizing the rapid determination of the code of the target user corresponding to the user interface to be generated, and improving the efficiency of responding to the user interface to the target user.
[0033] Step S206 , engineering the target code according to the system framework type of the device on which the target user interface is to be displayed, and performing code rendering based on the engineering result to generate the target interface to be displayed.
[0034] Simply put, in order to ensure that the generated target code can be effectively displayed on different devices, it is also necessary to engineer the target code according to the system framework type of the device that needs to display the user interface. For example, the target code can be engineered into Objective-C type code or Swift type code that can be used by the IOS system framework. After engineering, the target code can be effectively run on different system frameworks, ensuring the continuity and versatility of user interface generation.
[0035] Optionally, code rendering is performed under different system frameworks based on the engineering results; and the generated rendering results are transmitted to the corresponding operation interface of the device to complete the display of the generated user interface, wherein the operation interface is used to show the target user a visual image of the final generated user interface.
[0036] Through the above steps, the target user's demand data is standardized, and the first data after the standardization and the second data corresponding to the environment to be displayed by the user interface are input into the code model, and the interface setting features of the current target user are aligned with the trained code model, so as to generate the target code that conforms to the current target user's habits. After that, the target code is engineered, rendered, and other operations are performed to obtain data content that can be performed on the operation interface associated with the target user, so as to achieve the purpose of generating the relevant user interface in real time according to the personalized characteristics of the target user and quickly displaying it to the target user. The above technical solution solves the problem that the generation method of the user interface in the related technology is single and cannot be flexibly determined according to the data changes. Then, when the target user's demand data fluctuates greatly, the corresponding code can be directly output quickly according to the demand data and the code model corresponding to the target user, and the output code can be flexibly rendered into data that can be displayed in different styles as needed, so as to accurately respond to the user interface display needs of the target user and meet the diversified interface needs of different target users.
[0037] In an optional embodiment, when the second data corresponding to the environment to be displayed of the target user interface is obtained, the first data and the second data are input into the code big model to obtain the target code of the target user interface, and the above method also includes: obtaining historical customized data corresponding to the target user, wherein the historical customized data is unstructured data; identifying customized features corresponding to the historical customized data, wherein the customized features at least include: parameters of the user interface components of the target user, styles of the user interface components of the target user, and properties of the user interface components of the target user; the customized features are structured data; mapping the customized features to a preset standard data structure to obtain a target standard data structure; performing code conversion on the target standard data structure to obtain a standardized code corresponding to the historical customized data; associating the standardized code with the target data of the presentation environment corresponding to the historical customized data to generate a training set of an initial big model for training the code big model.
[0038] That is to say, before outputting the target code of the current target user through the code big model, it is necessary to align the code big model with the aesthetic taste of the current target user by determining the big model training set and using the big model training set to train the big model.
[0039] Optionally, in actual applications, the historical customization data of the target user is obtained, and some repeated and redundant parts of the native front-end code are encapsulated and converted into pseudo code, so that the native code corresponding to the historical customization data can be changed to be easy for the large model to quickly output and understand. For example: button.color is the button color, and behind it is the color setting of a button UI component.
[0040] In other words, by converting historical customization data into framework code data for training large models, and organizing them into data sets for large model training, the trained large model can have accurate logic and be aligned with the aesthetic tastes of the current target users.
[0041] Optionally, mapping the customized features to a preset standard data structure to obtain the target standard data structure can be performed in the following manner: determining the user design system features imported by different users, and mapping the user design system features and the standard design system, so that the large model can be quickly aligned with the aesthetics of different customers.
[0042] Optionally, the above-mentioned user design system features can be parameters, attributes, styles, etc. of elements that can be displayed on some user interfaces, such as: the parameters of the user interface commonly used by the current user are buttons, the color attribute is white, the size attribute is 10 pixels, and the style is pie-shaped.
[0043] In summary, through the above implementation method, the current large model is optimized and trained using the historical customization data of the target user, so that the large model can subsequently generate corresponding target codes according to the needs of the current target user, and the target code is highly adaptable to the target user, which greatly improves the alignment efficiency of the user interface and the current target user.
[0044] Optionally, when it is determined that the target user needs to generate a target user interface, the demand data corresponding to the target user is structured and processed before obtaining the first data. The method also includes: receiving question information input by the target user; counting an information set of the question information sent by the target user in a preset identification period, and parsing the information set; and determining whether the target user needs to generate a target user interface based on the parsing result.
[0045] That is to say, in order to avoid the problem that the question information input by the user is irrelevant to the user interface generation, it is necessary to parse and analyze the question information sent by the target user within a certain period of time, so as to improve the overall efficiency and accuracy of generating the user interface.
[0046] In order to better understand the above-mentioned technical solution of determining whether the target user needs to generate the target user interface according to the analysis results, optionally, when it is determined according to the analysis results that the target user needs to generate the target user interface, the processing flow of the historical customized data corresponding to the target user is activated, wherein the processing flow is used to generate a training set corresponding to the historical customized data; and / or, when it is determined according to the analysis results that the target user does not need to generate the target user interface, a prompt message is sent to the target user, wherein the prompt message is used to prompt the target user to re-provide the user interface generation requirement.
[0047] It should be noted that, through this judgment operation, the impact of non-interface generation tasks on the interface generation application can be effectively avoided, thereby improving the smoothness of the user interface generation process.
[0048] In an exemplary embodiment, the above method also includes: determining the interface style type set by the target user in the operation interface; arranging the results of code rendering in a plurality of different orders according to the interface style type to generate a plurality of target style interfaces; visually displaying the plurality of target style interfaces to the target user respectively, and determining the target style interface of the final application according to the selection instruction input by the target user.
[0049] Optionally, in order to ensure that the generated target style interface is a style that meets user needs, it is also necessary to obtain the user's demand instructions, generate data corresponding to the instructions, and trigger the tool. Further, determine the UI template for the data corresponding to the above-mentioned relevant information. The template is consistent / coordinated with the current environment / visual information, and the data is placed in it. The visual elements (spacing, color, etc.) are designed according to the container key and sent to the front end. Then, by sending the determination result to the user side, the user can determine the style of the card generated according to the data to be rendered in real time through interaction, and let the user independently choose the final style.
[0050] In an exemplary embodiment, after the multiple target style interfaces are respectively visually displayed to the target user and the target style interface of the final application is determined according to the selection instruction input by the target user, the above method also includes: selecting at least one component element of the target style interface according to a preset reverse self-check strategy; determining the target first data corresponding to the at least one component element, wherein the first data includes requirement data for indicating the generation of the corresponding component element; inputting the target first data into the code big model to obtain the sub-code to be reverse-checked; determining the difference between the sub-code and the target sub-code corresponding to the at least one component element in the target code; and determining the recognition accuracy of the code big model according to the difference.
[0051] It is understandable that, based on the user confirmation style, the accuracy of code model recognition can be further optimized by setting a reverse self-check strategy, such as: based on one of the descriptions of the UI elements, asking the model which element should be clicked, and then reverse checking to determine whether the judgment is consistent with the original judgment, so as to perform a reverse self-check.
[0052] In an exemplary embodiment, in order to better understand how to engineer the target code according to the system framework type of the device to display the target user interface in the above step S204, the following steps are now specifically described:
[0053] Step 1: Obtain the device type of the device and the system framework type of the device type.
[0054] Step 2: converting the target code based on the code filling strategy corresponding to the system framework type to obtain a framework native code that is allowed to run through the system framework type.
[0055] Step 3: When determining to generate the framework native code corresponding to the target code, determine that the engineering of the target code is completed.
[0056] The target code output by the large code model is converted into corresponding code through engineering methods according to the device that needs to present it (such as pseudocode), and rendered in real time to present an adaptive style on the device, thereby achieving the versatility of the target code and improving the effective application of the user interface under different frameworks.
[0057] Obviously, the embodiments described above are only some embodiments of the present application, not all embodiments. In order to better understand the above method, the above process is described below in conjunction with the embodiments, but it is not intended to limit the technical solutions of the embodiments of the present application, specifically:
[0058] In traditional applications, the data format is fixed, and the page UI is also fixed accordingly. The UI only needs to be displayed according to the fixed data and rules. However, with the development of Agent applications, the predefined UI can no longer meet the needs of non-predefined and unstructured data display, and Agent applications need to present different styles in different large pages. All of these require a UI style that can be rendered in real time according to the environment and data and meet the aesthetic requirements.
[0059] In order to avoid the above technical defects, the optional embodiment of the present application provides a system that can generate a human-computer interaction interface in real time, by converting the unstructured and non-predefined data of different users into standard structured data, and simplifying the front-end code by using a set of encapsulated code protocols, and then based on data training, aligning the large model with human aesthetics and quickly outputting UI code, and binding data and actions to render into a visible style, so as to achieve fast and accurate generation of the user interface. In other words, the above method provides a way to extract structured data from unstructured data and render the UI in real time according to the data and container style, so that the Agent application can render data in real time and meet the consistency and aesthetics of the overall style.
[0060] It is understandable that the cards generated in the prior art are all pre-designed, and the background, color and other related information are all defined in advance, while the optional embodiment of the present application can adaptively modify the color, font and other related information of the card according to the style of the container.
[0061] Optionally, the above system can be used to design a suitable UI component layout for unstructured data, and dynamically design styles according to the location where the UI needs to be presented, including color, position, size, etc. In addition, by adding interactive buttons to dynamic cards, users can interact with the Agent (equivalent to the interface generation application in the above embodiment) in real time through the dynamic UI; and determine the final interface style, while converting data and styles into code and rendering them in real time.
[0062] Optional, Figure 3This is a flow chart of an optional embodiment of the present application that can generate a human-computer interaction interface in real time, including the following steps:
[0063] Step 1: Align the aesthetics of the current code model with the target user, that is, train the model with the data corresponding to the target user so that the code generated by the model tends to the habitual characteristics of the target user, and complete the initialization of the model. Specifically, it includes the following sub-steps:
[0064] Step S302: Determine the characteristics of the customized design system for the current target user.
[0065] Step S304: Map the features of the customized design system to design features of the standard design system that are easily identifiable by the large model.
[0066] Step S306: After completing the conversion between the unstructured and non-predefined data corresponding to the customized design system and the structured data of the standard design system, the mapped structured customized feature data is converted into code.
[0067] Step S308: After determining the operating environment of the customized design system for the current target user, component code data for training the large model is generated according to the code and the operating environment.
[0068] Step S310: Use component code data as a training set to train the current large model.
[0069] Step 2: Determine the question information sent by the current user.
[0070] Step 3: Analyze the problem information and generate corresponding data to determine whether UI is needed.
[0071] Step 4: When it is determined that a UI is needed, perform data structuring.
[0072] Step 5: If you are sure that no UI is needed, directly answer the user's questions.
[0073] Step 6: After the data is structured, obtain the information of the current display environment, such as container size, background color, main body style, etc.
[0074] Step 7: Input the information of the current environment that needs to be displayed and the results of data structured processing into the trained large model to generate related code.
[0075] Step 8: Convert native code according to device IOS / Adnro id / web.
[0076] Step 9: Render the native code.
[0077] It should be noted that the method of rendering UI styles in real time according to different types of data includes the following: when the data to be rendered is passed in, the Agent can structure and normalize the data from various unstructured data; it should be noted that in order to ensure the rapidity and effectiveness of the above-mentioned Agent in structuring and normalizing the data, it is necessary to train the relevant models of the Agent through a large amount of data such as theme styles. According to the needs and presentation environment of the processed data generation, the model generates pseudocode of the style and binds the data; the pseudocode is converted into corresponding code through engineering methods according to the device to be presented, and rendered in real time, presenting an adaptive style on the device.
[0078] Furthermore, the answer to the user in step 5 is executed by rendering the result.
[0079] As an optional implementation, the above method for real-time rendering of UI styles according to different types of data can be determined by the following process:
[0080] Step 1: Determine whether the rendered data corresponds to the UI element data to be generated. Specifically, obtain the structured information pre-stored in the current system, perform structured processing on the UI element data to be generated, and determine the relevant information of the generated card based on the structured data (the relevant information includes: the relationship between the hierarchical structure of UI elements and their functional roles). After generating code for the relevant information, generate a style that can adapt to the device.
[0081] Step 2: In order to ensure that the style that meets the user's needs can be generated when executing "generated style that is adaptive on the device" in the above step 1, it is also necessary to obtain the user's demand instructions, generate data corresponding to the instructions, and trigger the tool. Further, determine the UI template for the data corresponding to the above relevant information. The UI template is consistent with the current environment / visual information. The data is placed in it, and the visual elements (spacing, color, etc.) are designed according to the container key and sent to the front end. Then, by sending the determination result to the user side, the user can determine the style of the card generated according to the data to be rendered in real time through interaction, and let the user choose the final style independently.
[0082] In addition, based on the user confirmation style, the accuracy of model recognition can be further optimized by setting a reverse self-check strategy. For example, based on one of the descriptions of the UI elements, the model is asked which element should be clicked, and reverse checking is performed to determine whether the judgment is consistent with the original judgment, so as to perform a reverse self-check.
[0083] For example, when a user wants to check the Douban rating of a TV series in a certain year while chatting with the Agent, the Agent application searches for the data and renders it into a rating card for display in real time.
[0084] Or, when a user is chatting, he wants to see the latest songs on the first music app and the second music app. The Agent app will collect the latest music playlists of the two apps and render a playlist list in real time for display.
[0085] In summary, through the above implementation plan, data with different data structures can be converted into standard data structures to flexibly generate and display UI styles. At the same time, when the same set of data is generated, the style will not be adjusted, which ensures the real-time generation of UI styles and achieves flexible UI real-time generation and on-demand display.
[0086] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0087] In this embodiment, a user interface generation device is also provided, which is used to implement the above embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0088] Figure 4 is a structural block diagram of a device for generating a user interface according to an embodiment of the present application, the device comprising:
[0089] The processing module 42 is used for, when it is determined that the target user needs to generate a target user interface, performing structured processing on the demand data corresponding to the target user to obtain first data, wherein the structured processing is used to align the fields in the demand data with the standard field format of the target user interface to be generated;
[0090] As an optional implementation, the above method can be applied in an interface generation application. For example, when the target user operates on the interface generation application, it is determined that the current target user needs to generate a new user interface based on the target user's operation intention. At the same time, the target user can also flexibly output demand data for personalized settings for the user interface in the interface generation application, such as the button size, button color, and button background color on the user interface, so that the target user can control the style of the final generated user interface, thereby improving the target user's experience in controlling the generation of the user interface. In addition, since the target user inputs the demand data into the interface generation application based on his or her own habits, there are format differences between the fields in the demand data and the standard fields of the target user interface. Then, data alignment at the field level is performed through structured processing to ensure that the subsequent interface generation application can accurately respond to the target user's corresponding demand data, thereby improving the fit between the final generated user interface and the demand data.
[0091] The input module 44 is used to input the first data and the second data into the code model to obtain the target code of the target user interface when the second data corresponding to the environment to be displayed by the target user interface is obtained; wherein the code model is trained by using the historical customization data of the target user, and the historical customization data includes: multiple groups of historical codes and corresponding historical demand data and corresponding historical environment data, and the historical code generates the user interface corresponding to the historical demand data when the historical environment data is run;
[0092] It can be understood that in order to ensure that the target code that meets the target user can be quickly generated, the historical customization data of the user interface generated by the target user can also be determined, wherein the historical customization data not only includes the historical code of the historical interface corresponding to the target user, but also includes the historical environment data of using the historical code, and the historical environment data, historical code, and historical demand data are interconnected. By using the above-mentioned historical customization data as training data to train the code model, the trained code model can quickly and accurately locate the corresponding code according to the environment data and demand data, thereby realizing the rapid determination of the code of the target user corresponding to the user interface to be generated, and improving the efficiency of responding to the user interface to the target user.
[0093] The rendering module 46 is used to engineer the target code according to the system framework type of the device on which the target user interface is to be displayed, and perform code rendering based on the engineering result to generate the target interface to be displayed.
[0094] Simply put, in order to ensure that the generated target code can be effectively displayed on different devices, it is also necessary to engineer the target code according to the system framework type of the device that needs to display the user interface. For example, the target code can be engineered into Objective-C type code or Swift type code that can be used by the IOS system framework. After engineering, the target code can be effectively run on different system frameworks, ensuring the continuity and versatility of user interface generation.
[0095] Optionally, code rendering is performed under different system frameworks based on the engineering results; and the generated rendering results are transmitted to the corresponding operation interface of the device to complete the display of the generated user interface, wherein the operation interface is used to show the target user a visual image of the final generated user interface.
[0096] Through this application, the target user's demand data is standardized, and the first data after the standardization and the second data corresponding to the environment to be displayed by the user interface are input into the code model, and the interface setting features of the current target user are aligned with the trained code model, so as to generate the target code that conforms to the current target user's habits. After that, the target code is engineered, rendered, and other operations are performed to obtain data content that can be performed on the operation interface associated with the target user, so as to achieve the purpose of generating the relevant user interface in real time according to the personalized characteristics of the target user and quickly displaying it to the target user. The above technical solution solves the problem that the generation method of the user interface in the related technology is single and cannot be flexibly determined according to the data changes. Then, when the target user's demand data fluctuates greatly, the corresponding code can be directly output according to the demand data and the code model corresponding to the target user, and the output code can be flexibly rendered into data that can be displayed in different styles as needed, so as to achieve accurate and effective response to the user interface display needs of the target user, and meet the diversified interface needs of different target users.
[0097] Furthermore, Figure 5 is another structural block diagram of a device for generating a user interface according to an embodiment of the present application, such as Figure 5 As shown, the user interface generating device also includes:
[0098] In an exemplary embodiment, the above-mentioned device also includes: a training module 54, which is used to input the first data and the second data into the code big model when the second data corresponding to the environment to be displayed of the target user interface is obtained, and before obtaining the target code of the target user interface, obtain the historical customization data corresponding to the target user, wherein the historical customization data is unstructured data; identify the customized features corresponding to the historical customization data, wherein the customized features at least include: the parameters of the user interface components of the target user, the style of the user interface components of the target user, and the attributes of the user interface components of the target user; the customized features are structured data; map the customized features to a preset standard data structure to obtain a target standard data structure; perform code conversion on the target standard data structure to obtain the standardized code corresponding to the historical customization data; associate the standardized code with the target data of the presentation environment corresponding to the historical customization data to generate a training set of the initial big model for training the code big model.
[0099] In an exemplary embodiment, the above-mentioned device also includes: a determination module 52, which is used to, when it is determined that the target user needs to generate a target user interface, perform structured processing on the demand data corresponding to the target user, and receive question information input by the target user before obtaining the first data; count the information set of the question information sent by the target user in a preset identification period, and parse the information set; determine whether the target user needs to generate a target user interface based on the analysis result.
[0100] In an exemplary embodiment, the above-mentioned determination module 52 is also used to activate the processing flow of historical customization data corresponding to the target user when it is determined according to the analysis result that the target user needs to generate a target user interface, wherein the processing flow is used to generate a training set corresponding to the historical customization data; and / or, when it is determined according to the analysis result that the target user does not need to generate a target user interface, send a prompt message to the target user, wherein the prompt message is used to prompt the target user to re-provide the generation demand of the user interface.
[0101] In an exemplary embodiment, the above-mentioned device also includes: a selection module 56, which is used to determine the interface style type set by the target user in the operation interface; arrange the results of code rendering in a plurality of different orders according to the interface style type to generate a plurality of target style interfaces; respectively visualize the plurality of target style interfaces to the target user, and determine the target style interface of the final application according to the selection instruction input by the target user.
[0102] In an exemplary embodiment, the above-mentioned device also includes: a difference module 58, which is used to visually display the multiple target style interfaces to the target user respectively, and after determining the target style interface of the final application according to the selection instruction input by the target user, select at least one component element of the target style interface according to a preset reverse self-check strategy; determine the target first data corresponding to the at least one component element, wherein the first data includes requirement data for indicating the generation of the corresponding component element; input the target first data into the code big model to obtain the sub-code to be reversed; determine the difference between the sub-code and the target sub-code corresponding to the at least one component element in the target code; determine the recognition accuracy of the code big model according to the difference.
[0103] In an exemplary embodiment, the rendering module 46 is also used to obtain the device type of the device and the system framework type of the device type; convert the target code based on the code filling strategy corresponding to the system framework type to obtain the framework native code allowed to run through the system framework type; and determine that the engineering of the target code is completed when it is determined that the framework native code corresponding to the target code is generated.
[0104] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0105] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0106] S1, when it is determined that a target user needs to generate a target user interface, perform structured processing on the demand data corresponding to the target user to obtain first data, wherein the structured processing is used to align fields in the demand data with a standard field format of the target user interface to be generated;
[0107] S2, when obtaining the second data corresponding to the environment to be displayed of the target user interface, inputting the first data and the second data into the code big model to obtain the target code of the target user interface; wherein the code big model is trained by using the historical customization data of the target user, the historical customization data includes: multiple groups of historical codes and corresponding historical demand data and corresponding historical environment data, the historical code generates the user interface corresponding to the historical demand data when the historical environment data is run;
[0108] S3, engineering the target code according to the system framework type of the target user interface to be displayed to the target user, and performing code rendering based on the engineering result.
[0109] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0110] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0111] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0112] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0113] S1, when it is determined that a target user needs to generate a target user interface, perform structured processing on the demand data corresponding to the target user to obtain first data, wherein the structured processing is used to align fields in the demand data with a standard field format of the target user interface to be generated;
[0114] S2, when obtaining the second data corresponding to the environment to be displayed of the target user interface, inputting the first data and the second data into the code big model to obtain the target code of the target user interface; wherein the code big model is trained by using the historical customization data of the target user, the historical customization data includes: multiple groups of historical codes and corresponding historical demand data and corresponding historical environment data, the historical code generates the user interface corresponding to the historical demand data when the historical environment data is run;
[0115] S3, engineering the target code according to the system framework type of the target user interface to be displayed to the target user, and performing code rendering based on the engineering result.
[0116] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0117] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0118] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0119] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for generating a user interface, It is characterized in that include: In the case where it is determined that the target user needs to generate a target user interface, structural processing is performed on the demand data corresponding to the target user to obtain first data, wherein the structural processing is used to align the fields in the demand data with the standard field format of the target user interface to be generated; When the second data corresponding to the environment to be displayed of the target user interface is obtained, the first data and the second data are input into the code big model to obtain the target code of the target user interface; wherein the code big model is trained by using the historical customization data of the target user, the historical customization data includes: multiple groups of historical codes and corresponding historical demand data and corresponding historical environment data, and the historical code generates the user interface corresponding to the historical demand data when the historical environment data is run; The target code is engineered according to the system framework type of the device on which the target user interface is to be displayed, and code rendering is performed based on the engineering result to generate the target interface to be displayed.
2. The method for generating a user interface according to claim 1, It is characterized in that When the second data corresponding to the environment to be displayed of the target user interface is obtained, before the first data and the second data are input into the code model to obtain the target code of the target user interface, the method further includes: Acquire the historical customization data corresponding to the target user, wherein the historical customization data is unstructured data; identify the customization features corresponding to the historical customization data, wherein the customization features at least include: parameters of the user interface component of the target user, styles of the user interface component of the target user, and attributes of the user interface component of the target user; The customized feature is structured data; Mapping the customized features to a preset standard data structure to obtain a target standard data structure; Performing code conversion on the target standard data structure to obtain a standardized code corresponding to the historical customized data; The standardized code is associated with target data of a presentation environment corresponding to the historical customized data to generate a training set of an initial large model for training the code large model.
3. The method for generating a user interface according to claim 1, It is characterized in that When it is determined that the target user needs to generate a target user interface, before performing structured processing on the demand data corresponding to the target user to obtain the first data, the method further includes: Receiving question information input by the target user; Counting an information set of question information sent by the target user in a preset identification period, and analyzing the information set; It is determined whether the target user needs to generate a target user interface according to the analysis result.
4. The method for generating a user interface according to claim 3, It is characterized in that Determining whether the target user needs to generate a target user interface according to the analysis result includes: When it is determined according to the analysis result that the target user needs to generate a target user interface, activate the processing flow of the historical customization data corresponding to the target user, wherein the processing flow is used to generate a training set corresponding to the historical customization data; and / or, when it is determined according to the analysis result that the target user does not need to generate a target user interface, send a prompt message to the target user, wherein the prompt message is used to prompt the target user to re-provide the user interface generation requirement.
5. The method for generating a user interface according to claim 1, It is characterized in that The method further comprises: Determine the interface style type set by the target user in the operation interface; Arranging the results of code rendering in a variety of different orders according to the interface style type to generate a variety of target style interfaces; The multiple target style interfaces are visually displayed to the target user respectively, and the target style interface to be finally applied is determined according to the selection instruction input by the target user.
6. The method for generating a user interface according to claim 5, It is characterized in that After visually displaying the multiple target style interfaces to the target user respectively and determining the target style interface to be finally applied according to the selection instruction input by the target user, the method further includes: Selecting at least one component element of the target style interface according to a preset reverse self-checking strategy; Determine target first data corresponding to the at least one component element, wherein the first data includes requirement data for indicating generation of the corresponding component element; Input the target first data into the code big model to obtain the sub-code to be reversed; Determining a difference between the subcode and a target subcode corresponding to the at least one component element in the target code; The recognition accuracy of the code macromodel is determined based on the difference.
7. The method for generating a user interface according to claim 1, It is characterized in that The target code is engineered according to the system framework type of the device to display the target user interface, including: Obtaining the device type of the device and the system framework type of the device type; Convert the target code based on the code filling strategy corresponding to the system framework type to obtain a framework native code that is allowed to run through the system framework type; When it is determined that the framework native code corresponding to the target code is generated, it is determined that the engineering of the target code is completed.
8. A device for generating a user interface, It is characterized in that include: A processing module, configured to, when it is determined that a target user needs to generate a target user interface, perform structured processing on the demand data corresponding to the target user to obtain first data, wherein the structured processing is used to align fields in the demand data with a standard field format of the target user interface to be generated; An input module is used to input the first data and the second data into a code model to obtain a target code of the target user interface when the second data corresponding to the environment to be displayed of the target user interface is obtained; wherein the code model is trained by using the historical customization data of the target user, and the historical customization data includes: multiple groups of historical codes and corresponding historical demand data and corresponding historical environment data, and the historical code generates a user interface corresponding to the historical demand data when the historical environment data is run; A rendering module is used to engineer the target code according to the system framework type of the device on which the target user interface is to be displayed, and to perform code rendering based on the engineering result to generate the target interface to be displayed.
9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 7 when executed.
10. An electronic device comprising a memory and a processor, It is characterized in that A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.
11. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
