HMI interface generation method and HMI interface generation system
Through component selection, configuration model and mapping model on the large model server, the HMI interface is automatically generated, which solves the problems of high labor costs and low efficiency in traditional methods, and achieves efficient and flexible interface generation.
Patent Information
- Application Number
- CN202411244015.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-05
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2044-09-05
AI Technical Summary
The traditional HMI interface generation method relies on user manual drawing, resulting in high labor costs and low efficiency.
Automatically select and configure HMI components through component selection and configuration model on the large model server, and automatically find and bind the addresses of PLC program variables through mapping models to generate an HMI interface.
It improves the efficiency of HMI interface generation, reduces labor costs, reduces manual binding errors, and enhances the flexibility of interface generation.
Smart Images

Figure CN119201106B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of human-computer interaction technology, and in particular to an HMI interface generation method and an HMI interface generation system. Background Art
[0002] As a user-oriented interface, HMI (Human-Machine Interface, HMI for short) has always been an important part of industrial control. Through the HMI interface, users can monitor the equipment in real time and control the PLC accordingly.
[0003] Traditionally, HMI interfaces have always been drawn manually by users. Users create interfaces in configuration software according to their own needs, select appropriate components, adjust component configurations, place components in appropriate locations, and set data that components and PLC programs will interact with, and complete a series of tedious operations to draw the HMI interface. As can be seen from the above, when users draw HMI interfaces manually, the labor cost is high and the efficiency is low. Summary of the invention
[0004] In view of this, the present application provides an HMI interface generation method and an HMI interface generation system to improve the generation efficiency of the HMI interface and reduce labor costs.
[0005] Specifically, the present application is implemented through the following technical solutions:
[0006] A first aspect of the present application provides a method for generating an HMI interface, the method comprising:
[0007] The client sends the functional requirement to the large model server in response to the functional requirement input by the user;
[0008] The large model server inputs the functional requirement into a pre-trained component selection model, so that the component selection model selects a target component matching the functional requirement;
[0009] For each target component, the large model server selects a target configuration model corresponding to the target component from a plurality of pre-trained configuration models for different component types;
[0010] The large model server inputs the functional requirement and the target component into the target configuration model, and the target configuration model configures the target component according to the functional requirement and outputs the configuration information of the target component;
[0011] The large model server inputs the functional requirements, the target component and the variable table corresponding to the PLC program into a pre-trained mapping model, and the mapping model uses the functional requirements to search the address of the variable bound to the target component from the variable table;
[0012] The large model server sends the target component, the configuration information of the target component, and the address of the variable bound to the target component to the HMI server;
[0013] The HMI server generates an HMI interface according to the target component, the configuration information of the target component, and the address of the variable bound to the target component, and sends the HMI interface to the client;
[0014] The client displays the HMI interface to the user.
[0015] The second aspect of the present application provides an HMI interface generation system, the HMI interface generation system includes a client, a large model server and an HMI server; wherein,
[0016] The client is used to respond to the functional requirements input by the user and send the functional requirements to the large model server;
[0017] The large model server is used to input the functional requirements into a pre-trained component selection model, so that the component selection model selects a target component that matches the functional requirements;
[0018] The large model server is further used to select, for each target component, a target configuration model corresponding to the target component from a plurality of pre-trained configuration models for different component types;
[0019] The large model server is further used to input the functional requirements and the target component into the target configuration model, and the target configuration model configures the target component according to the functional requirements and outputs the configuration information of the target component;
[0020] The large model server is further used to input the functional requirements, the target component and the variable table corresponding to the PLC program into a pre-trained mapping model, and the mapping model uses the functional requirements to search the address of the variable bound to the target component from the variable table;
[0021] The large model server is further used to send the target component, the configuration information of the target component, and the address of the variable bound to the target component to the HMI server;
[0022] The HMI server is used to generate an HMI interface according to the target component, the configuration information of the target component, and the address of the variable bound to the target component, and send the HMI interface to the client;
[0023] The client is also used to display the HMI interface to the user.
[0024] The HMI interface generation method and HMI interface generation system provided by the present application, the method provided by the present embodiment, firstly, can automatically select and configure HMI components through the component selection model and configuration model on the large model server, which can reduce the time of manual selection and configuration and improve development efficiency; further, the address of the variable corresponding to the PLC program is automatically found and bound through the mapping model, which can ensure the accuracy of variable binding and reduce the errors caused by manual binding; in addition, components are dynamically selected and configured based on different functional requirements, so that the HMI interface generation has a high degree of flexibility and can adapt to different application scenarios; finally, through the above method, the HMI interface can be automatically generated, reducing the dependence on professional HMI developers, reducing human resource costs and improving generation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 A flowchart of the first embodiment of the HMI interface generation method provided by the present application;
[0026] Figure 2 A schematic diagram of an HMI interface generation system shown as an exemplary embodiment of the present application;
[0027] Figure 3 A schematic diagram of the generation of an HMI interface according to an exemplary embodiment of the present application;
[0028] Figure 4 A flowchart of Embodiment 2 of the HMI interface generation method provided by the present application;
[0029] Figure 5 This is a flowchart of Example 3 of the HMI interface generation method provided by this application;
[0030] Figure 6 A flowchart of a fourth embodiment of the HMI interface generation method provided by the present application;
[0031] Figure 7 This is a flowchart of Example 5 of the HMI interface generation method provided in this application. DETAILED DESCRIPTION
[0032] Here, exemplary embodiments are described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application.
[0033] The terms used in this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in this article refers to and includes any or all possible combinations of one or more associated listed items.
[0034] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0035] Specific embodiments are given below to introduce the technical solution of the present application in detail.
[0036] Figure 1 This is a flow chart of the first embodiment of the HMI interface generation method provided by this application. Please refer to Figure 1 , the method provided in this embodiment may include:
[0037] S101. The client sends the functional requirements to the large model server in response to the functional requirements input by the user.
[0038] The HMI (Human-Machine Interface, HMI for short) interface generation method provided in this embodiment is applied to an HMI interface generation system. Figure 2 This is a schematic diagram of an HMI interface generation system shown in an exemplary embodiment of the present application. Figure 2 ,The HMI interface generation system includes a client, a large model server and an HMI server.
[0039] Specifically, the client may be a computer, tablet, or mobile phone on the user side, and is not limited in this embodiment.
[0040] It should be noted that the functional requirements are used to indicate the functions that can be realized by the HMI interface to be generated, which is a natural language description text. The functions that can be realized by the HMI interface may include: inputting data to a PLC (Programmable Logic Controller, PLC for short) that interacts with the HMI interface, or displaying data from the PLC to the user.
[0041] For example, in one possible implementation, the functional requirement may be "Please help me design a screen. It needs to have an input about temperature. When I click a button, this input is uploaded and an output about shape is immediately returned." For another example, in another possible implementation, the functional requirement may be "Please help me design a monitoring interface. It needs to have an input about clock signal. When I click a button, this input is uploaded and an output about signal status is immediately returned."
[0042] In specific implementation, the client can format the functional requirements input by the user, and send the formatted functional requirements to the large model server through a network communication protocol (such as HTTP / HTTPS, WebSocket, etc.).
[0043] S102: The large model server inputs the functional requirement into a pre-trained component selection model, so that the component selection model selects a target component that matches the functional requirement.
[0044] Figure 3 This is a schematic diagram of the generation principle of the HMI interface shown in an exemplary embodiment of the present application. Figure 3 ,A component selection model is configured on the large model server. The ,component selection model is used to select the most suitable ,component according to specific functional requirements. Its input is the functional ,requirement and its output is the selected target component.
[0045] S103. For each target component, the large model server selects a target configuration model corresponding to the target component from a plurality of pre-trained configuration models for different component types.
[0046] Please continue to refer to Figure 3 ,It is understandable that a configuration model library is maintained on the ,large model server, and the configuration model library contains multiple ,pretrained configuration models, and each model is optimized and ,trained for a specific type of component.
[0047] Furthermore, each configuration model is used to optimize and output corresponding configuration parameters for a specific type of component to meet the above functional requirements. Its input is the functional requirements and the target component, and its output is the configuration information of the target component.
[0048] During specific implementation, in this step, the component type of the target component may be identified, and then a target configuration model corresponding to the component type may be selected from the configuration model library.
[0049] Referring to the previous description, different types of components correspond to different configuration models. It can be understood that in the HMI interface, there are multiple types of components. For example, in one possible implementation, the HMI interface may include a display component, an input component, a container component, a control component, a navigation component, a warning and notification component, etc.; further, in the display component, it may include a text display (for displaying static text or dynamic data), a numerical display (for displaying real-time data values), a graphic display (for displaying graphic data such as curves, bar charts, pie charts, etc.) and an image display (for displaying static images or dynamic video streams), etc.; in the input component, it may include a button (for triggering a specific operation or event), a switch (for switching the system state, such as start-stop control), a slider (for adjusting a numerical value, such as volume control, speed adjustment) and Input box (used to enter text or numerical data), etc.; in container components, it can include panels (used to separate and organize interface content), tabs (used to group content and switch between tabs to display different content) and split windows (used to adjust the size of the display area), etc.; in control components, it can include progress bars (used to display the progress of tasks or processes), knobs (used to fine-tune parameters), etc.; in navigation components, it can include menus (used to provide operation options or navigation links), toolbars (used to quickly access commonly used functions), tree views (used to display hierarchical data structures for easy navigation), etc.; in warning and notification components, it can include message boxes (used to display system messages or prompt information), warning lights (used to display system status warnings, such as red lights indicating errors), etc.
[0050] In this application, different configuration models are pre-trained for different types of components. For example, different configuration models are pre-trained for menus, buttons, input boxes, etc.
[0051] S104: The large model server inputs the functional requirements and the target component into the target configuration model, and the target configuration model configures the target component according to the functional requirements and outputs the configuration information of the target component.
[0052] As described above, the configuration model can output configuration information of the target component based on the functional requirements and the target component.
[0053] It should be noted that the configuration information of each type of component is different. Furthermore, the configuration information of different types of components can include four types: general configuration items, property configuration items, animation configuration items, and event configuration items; among them, general configuration items can include labels, positions, sizes, levels, and visibility, etc.; property configuration items can include data binding, input restrictions, default values, states, and styles, etc.; animation configuration items can include animation types, animation triggers, animation duration, animation paths, etc.; event configuration items can include event types, event handling, action binding, conditional events, logging, etc.
[0054] In this step, refer to Figure 3 ,Through the configuration model, the configuration information of each target ,component can be obtained.
[0055] It should be noted that each component type has different characteristics and requirements. Training a specific configuration model for a specific component type can more accurately optimize these characteristics and improve the prediction accuracy of the configuration model.
[0056] S105. The large model server inputs the functional requirements, the target component and the variable table corresponding to the PLC program into a pre-trained mapping model, and the mapping model uses the functional requirements to search the address of the variable bound to the target component from the variable table.
[0057] Specifically, the mapping model is pre-trained, and the specific training process of the mapping model will be described in detail in the following embodiments and will not be repeated here.
[0058] Furthermore, the mapping model is used to map the functional requirements with the variable addresses in the PLC program. In other words, it can identify and search for the addresses of the variables related to the target component from the variable table corresponding to the PLC program according to the given functional requirements. Its input is the functional requirements, the target component and the variable table corresponding to the PLC program, and its output is the address of the variable bound to the target component.
[0059] It should be noted that the PLC program refers to the PLC program that interacts with the HMI interface to be generated. Furthermore, the variable table includes information such as the name, type and address of the variable.
[0060] S106. The large model server sends the target component, the configuration information of the target component, and the address of the variable bound to the target component to the HMI server.
[0061] Please refer to Figure 3After the large model server obtains the target component corresponding to the functional requirements, the configuration information of the target component, and the address of the variable bound to the target component, the target component, the configuration information of the target component, and the address of the variable bound to the target component are sent to the HMI server, so that the HMI server generates an HMI interface based on this.
[0062] In specific implementation, the large model server may format the name of the target component, configuration information and the address of the variable obtained from the mapping model, and then send the formatted information to the HMI server through the network communication protocol.
[0063] S107: The HMI server generates an HMI interface according to the target component, the configuration information of the target component, and the address of the variable bound to the target component, and sends the HMI interface to the client.
[0064] In specific implementation, the HMI server generates various elements of the HMI interface based on the target component, the configuration information of the target component, and the address of the variable bound to the target component, composes the HMI interface with the generated elements, and sends the HMI interface to the client.
[0065] It should be noted that the specific generation process and generation principle of the HMI interface can be found in the description of the relevant technology, which will not be repeated here.
[0066] S108: The client displays the HMI interface to the user.
[0067] The method provided in this embodiment, firstly, can automatically select and configure HMI components through the component selection model and configuration model on the large model server, which can reduce the time of manual selection and configuration and improve development efficiency; further, the address of the variable corresponding to the PLC program is automatically found and bound through the mapping model, which can ensure the accuracy of variable binding and reduce the errors caused by manual binding; in addition, components are dynamically selected and configured based on different functional requirements, so that the HMI interface generation has a high degree of flexibility and can adapt to different application scenarios; finally, through the above method, the HMI interface can be automatically generated, reducing the dependence on professional HMI developers, reducing human resource costs and improving generation efficiency.
[0068] Figure 4 This is a flow chart of Embodiment 2 of the HMI interface generation method provided by the present application. The method provided by this embodiment, based on the above embodiment, after the client displays the HMI interface to the user, the method further includes:
[0069] S401. The client sends the completion instruction to the large model server in response to the completion instruction input by the user based on the HMI interface; wherein the completion instruction is used to instruct the large model server to complete the missing information missing in the HMI interface, wherein the missing information is the missing components and / or the configuration items of the missing specified components.
[0070] Specifically, after the client displays the HMI interface to the user, if the user finds that there is missing information on the HMI interface displayed by the client (for example, a component is missing or a component is missing a necessary configuration item), at this time, the user can enter a completion instruction through the user interface to instruct to complete the missing information.
[0071] It should be noted that the missing information is the missing component and / or the configuration item of the specified component being missing. For example, in one embodiment, the missing information may be the missing component; for another example, in another embodiment, the missing information may also be the configuration item of the specified component being missing; for another example, in one embodiment, the missing information is the missing component and the configuration item of the specified component being missing.
[0072] In specific implementation, the client can send the completion instruction to the large model server through a network communication protocol (such as HTTP / HTTPS, WebSocket, etc.).
[0073] S402: The large model server generates the missing information based on the completion instruction, and sends the missing information to the HMI server.
[0074] Specifically, after receiving the completion instruction, the large model server parses the instruction content to identify the type and details of information that need to be completed.
[0075] In specific implementation, the large model server can generate missing information based on the model configured thereon (generate missing information based on the component selection model, configuration model, and mapping model configured thereon). The specific implementation principles and implementation processes of each model can be found in the description of the previous embodiment, which will not be repeated here. For example, when a component is missing, the component selection model can be directly used to generate the component; for another example, when a configuration item of a component is missing, the configuration model can be directly used to generate the configuration item.
[0076] Furthermore, the generated missing information is sent to the HMI server via a network communication protocol, and the generated missing information may be a detailed description of the component, configuration parameters or other relevant data.
[0077] S403: The HMI server modifies the HMI interface based on the missing information to obtain an updated HMI interface.
[0078] Specifically, after the HMI server receives the missing information, the HMI interface is modified according to the specific content of the missing information to obtain a modified updated HMI interface. For example, in one embodiment, when the missing information is a missing component, the missing component is inserted into the HMI interface; for another example, in another embodiment, when the missing information is a configuration item of a specified component being missing, the configuration item of the specified component being missing is updated.
[0079] S404: The HMI server sends the updated HMI interface to the client to instruct the client to display the updated HMI interface to the user.
[0080] Specifically, after the HMI server modifies the HMI interface to obtain an updated HMI interface, the updated HMI interface is sent to the client and displayed to the user, so that the user can determine whether the current updated HMI interface meets the requirements.
[0081] It should be noted that when the user determines that the current updated HMI interface does not meet the requirements, the user can also initiate a completion instruction to the large model server again through the client until the finally generated HMI interface meets the requirements.
[0082] In addition, by continuously collecting users' completion requirements, the large model server can further optimize its algorithms and completion strategies, gradually improve the completion effect and the intelligence level of the HMI interface, and achieve continuous optimization and improvement.
[0083] The method provided in this embodiment displays the HMI interface to the user so that the user can intuitively check whether the HMI interface meets the requirements. When the HMI interface does not meet the requirements, the completion instruction is triggered to instruct the large model server to complete the missing information. Further, the HMI server can update the HMI interface according to the missing information completed by the large model server to obtain an updated HMI. In this way, through the automated completion function, the workload of developers to manually design and adjust the HMI interface is reduced, and the development cost of the HMI interface is reduced; in addition, users can quickly obtain the required interface functions or configurations through simple completion instructions without manually performing complex configurations, which can improve efficiency.
[0084] Figure 5 This is a flow chart of Example 3 of the HMI interface generation method provided by this application. The method provided by this embodiment, based on the above embodiment, the training process of the component selection model includes:
[0085] S501. Obtain a first training sample set; wherein each training sample in the first training sample set includes a correspondence between a functional requirement and an identifier of a component.
[0086] Specifically, each training sample in the first training sample set is constructed in advance by the user, and further, each training sample includes a correspondence between a functional requirement and a component identifier, wherein the functional requirement is a natural language text. For example, in one possible implementation, a training sample is: the functional requirement is: please help me design a screen, which requires an input about temperature, and when I click the button, the input is uploaded and an output about shape is immediately returned, and the component identifier is: 0x0001 (button); for another example, in another possible implementation, a training sample is: please help me design a screen, which requires an input about temperature, and when I click the button, the input is uploaded and an output about shape is immediately returned, and the component identifier is: 0x0003 (input box); for another example, in another possible implementation, a training sample is: please help me design a screen, which requires an input about temperature, and when I click the button, the input is uploaded and an output about shape is immediately returned, and the component identifier is: 0x0004 (output box).
[0087] It should be noted that users can systematically analyze different functional requirements, map the functional requirements to specific components, and then, by setting unique identifiers for specific components, obtain the correspondence between the functional requirements and the component identifiers and construct a training sample.
[0088] S502. For each training sample in the first training sample set, decompose the functional requirements in the training sample into fixed sentence patterns and variable slots; wherein the variable slots are operation information related to the operation in the functional requirements.
[0089] It should be noted that in practical applications, it is difficult to obtain a large number of high-quality training samples. In this application, through data enhancement, on the one hand, the number of training samples can be increased, and on the other hand, different sample variants can be introduced to make the data set richer and more diverse, which can make the trained model more robust in the face of uncertain factors and improve the prediction accuracy of the model.
[0090] In the specific implementation, in this step, each functional requirement is divided into fixed sentences and variable operations; the variable slots are the operation information related to the operation in the functional requirement. Combined with the above example, for example, when the functional requirement is: "Please help me design a screen, there needs to be an input about temperature, and when I click the text bar, this input is uploaded and an output about shape is immediately returned". At this time, "click the text bar" is the operation information related to the operation.
[0091] S503: On the premise of keeping the sentence structure unchanged, randomly replace the variable slots, and update the identifiers of the components in the training sample based on the replaced slots to obtain an enhanced sample corresponding to the training sample.
[0092] Specifically, under the premise of keeping the sentence structure unchanged, the variable slots can be randomly replaced. It should be noted that after the replacement, the components may change. At this time, it is necessary to update the identifier of the component in the training sample based on the replaced slot to obtain the enhanced sample corresponding to the training sample. For example, in one embodiment, the functional requirement is: "Please help me design a screen. There needs to be an input about temperature. When I click on the text bar, this input is uploaded and an output about the shape is immediately returned." After replacing "click on the text bar" with "click on the button", the identifier of the component in the training sample is replaced with the identifier of the "button".
[0093] S504: Train a first basic large model using the first training sample set and the enhanced samples corresponding to each training sample in the first training sample set to obtain the pre-trained component selection model.
[0094] Specifically, after obtaining the enhanced sample corresponding to each training sample in the first sample training set, the first training sample set and the enhanced sample corresponding to each training sample in the first training sample set can be used to train the first basic large model to obtain a pre-trained component selection model.
[0095] The method provided in this embodiment can increase the number of training samples and introduce different sample variants by enhancing the training samples when the training component selects the model, thereby making the data set richer and more diverse, making the trained model more robust in the face of uncertain factors, and improving the prediction accuracy and generalization ability of the model.
[0096] Figure 6 This is a flowchart of the fourth embodiment of the HMI interface generation method provided by the present application. The method provided in this embodiment, based on the above embodiment, includes the following steps for training the configuration model of each component type:
[0097] S601. Obtain a second training sample set corresponding to the component type; wherein each training sample in the second training sample set includes a functional requirement, an identifier of a component corresponding to the functional requirement, and configuration information of the component.
[0098] Specifically, each training sample in the second training sample set is constructed in advance by the user. Furthermore, each training sample includes a functional requirement, an identifier of a component corresponding to the functional requirement, and a corresponding relationship between the configuration information of the component, wherein the functional requirement is a natural language text. For example, in one possible implementation, a training sample is: The functional requirement is: Please help me design a screen. An input about temperature is required. When I click the button, this input is uploaded and an output about shape is immediately returned. The identifier of the component is: 0x0001, and the configuration information of the component is: The feature is 0F0001 (name), the value is temperature, and the category is 1; For another example, in another possible implementation, a training sample is: Please help me design a screen. An input about temperature is required. When I click the button, this input is uploaded and an output about shape is immediately returned. For the output of the shape, the component identifier is: 0x0001, and the configuration information of the component is: the feature is 0F0015 (event), the value is 0H0001 (click event), and the category is 3; for another example, in another possible implementation method, the training sample is: please help me design a picture, which requires an input about temperature. When I click the button, this input is uploaded and an output about the shape is immediately returned. The component identifier is: 0x0004, and the configuration information of the component is: the feature is: 0F0014 (event), the value is 0O0002 (output event), and the category is 3.
[0099] Specifically, users can analyze various functional requirements, find the corresponding components, and mark the corresponding components, set corresponding identifiers for the components, and set corresponding configuration information for the components, and combine the functional requirements, the identifiers of the components corresponding to the functional requirements, and the configuration information of the components into a training sample.
[0100] It should be noted that, referring to the previous description, each component has different available configuration information. Generally, all types of configuration information items can include four types: general, property, animation, and event. Furthermore, for most components, general and property belong to basic configuration information. In addition, when configuring the configuration information of a component, for the optional configuration information that gives optional items, you can configure it by number; for the configuration information that needs to be directly input, you can configure it by directly inputting data.
[0101] S602: For each training sample in the second training sample set, decompose the functional requirements in the training sample into fixed sentence patterns and variable slots; wherein the variable slots are configuration information related to configuration items in the functional requirements.
[0102] Specifically, for each functional requirement in the training sample, the functional requirement can be decomposed into fixed sentences and variable slots according to the basic structure and components of the functional requirement. It should be noted that, at this time, the variable slot is the configuration information related to the configuration item in the functional requirement, and the remaining part of the functional requirement is the fixed sentence.
[0103] Combined with the previous example, for example, when the functional requirement is "Please help me design a screen", there needs to be an input about temperature. When I click the button, this input is uploaded and an output about shape is immediately returned. At this time, the variable slots include: temperature, input, click and output.
[0104] S603: On the premise of keeping the sentence structure unchanged, randomly replace the variable slots, and update the configuration information in the training sample based on the replaced slots to obtain an enhanced sample corresponding to the training sample.
[0105] Specifically, by analyzing the sentence structure, the variable slots can be randomly replaced while keeping the original sentence structure unchanged. At the same time, the configuration information in the training sample is updated according to the replaced slots, and the enhanced sample corresponding to the training sample can be obtained. The enhanced sample is a diversified version of the original training sample. The enhanced sample obtained using this method can improve the training effect of the model.
[0106] S604: Train a second basic large model using the second training sample set and the enhanced samples corresponding to each training sample in the second training sample set to obtain a configuration model for the component type.
[0107] Specifically, after obtaining the second training sample set and the enhanced samples corresponding to each training sample in the second training sample set, the second basic large model is trained using the second training sample set and the enhanced samples corresponding to each training sample in the second training sample set to obtain the configuration model.
[0108] S605: Acquire a fourth training sample set; wherein the fourth training sample set includes binding relationships between events and variables of the events.
[0109] Specifically, each training sample in the fourth training sample set is constructed in advance by the user, and further, each training sample includes a binding relationship between an event and a variable of the event. In specific implementation, the user can parse each event and its related variables, and then map the event and the variable together to obtain a training sample.
[0110] S606: Train the configuration model using the fourth training sample set.
[0111] Specifically, after obtaining the fourth training sample set, the configuration model of the component type may be trained using the fourth training sample set, so that the configuration model can learn the relationship between events and variables.
[0112] The method provided in this embodiment can increase the number of training samples and introduce different sample variants by enhancing the training samples when the training component selects the model, thereby making the data set richer and more diverse, making the trained model more robust in the face of uncertain factors, and improving the prediction accuracy and generalization ability of the model.
[0113] Figure 7 This is a flowchart of Embodiment 5 of the HMI interface generation method provided by the present application. The method provided by this embodiment, based on the above embodiment, the training process of the mapping model includes:
[0114] S701. Obtain a third training sample set; wherein each training sample in the third training sample set includes a functional requirement, an identifier of a component corresponding to the functional requirement, configuration information of the component, and a variable bound to the component and an address of the variable; wherein the variable bound to the component is a variable in a variable table corresponding to a PLC program.
[0115] Specifically, each training sample in the third training sample set is constructed in advance by the user. In specific implementation, the user can collect the following data: Functional requirements: describe the specific functions that the HMI interface needs to implement; component identifier: uniquely identify the component that implements the function; configuration information: specific configuration parameters of the component, including property settings, initial state, etc.; bound variables and variable addresses: PLC program variables bound to the component and their addresses in the PLC program. Furthermore, the collected data can be preprocessed, for example, cleaned, formatted and standardized to ensure data quality and consistency. Finally, the collected data can be used to construct training samples.
[0116] S702: Use the third training sample set to train a third basic large model to obtain the mapping model.
[0117] Specifically, after obtaining the third training sample set, the third basic large model can be trained using multiple training samples in the third training sample set to obtain a trained mapping model.
[0118] Optionally, in a possible implementation, the first basic large model, the second basic large model and the third basic large model are the same. Further, the first basic large model, the second basic large model and the third basic large model are GPT-NeoX models.
[0119] The method provided in this embodiment combines the functional requirement, the identifier of the component corresponding to the functional requirement, the configuration information of the component, the variable bound to the component and the address of the variable into a training sample, and combines multiple training samples into a third training sample set, and then uses the third training sample set to train the third basic large model to obtain a trained mapping model. In this way, the training sample contains the variables bound to the component and the variable address, and the mapping model obtained by training can process the functional requirement more accurately, and the address of the variable bound to the target component can be accurately found through the mapping model.
[0120] Corresponding to the aforementioned embodiment of an HMI interface generating method, the present application also provides an embodiment of an HMI interface generating system.
[0121] Please continue to refer to Figure 2 The device provided in this embodiment includes a client, a large model server and an HMI server; wherein,
[0122] The client is used to respond to the functional requirements input by the user and send the functional requirements to the large model server;
[0123] The large model server is used to input the functional requirements into a pre-trained component selection model, so that the component selection model selects a target component that matches the functional requirements;
[0124] The large model server is further used to select, for each target component, a target configuration model corresponding to the target component from a plurality of pre-trained configuration models for different component types;
[0125] The large model server is further used to input the functional requirements and the target component into the target configuration model, and the target configuration model configures the target component according to the functional requirements and outputs the configuration information of the target component;
[0126] The large model server is further used to input the functional requirements, the target component and the variable table corresponding to the PLC program into a pre-trained mapping model, and the mapping model uses the functional requirements to search the address of the variable bound to the target component from the variable table;
[0127] The large model server is further used to send the target component, the configuration information of the target component, and the address of the variable bound to the target component to the HMI server;
[0128] The HMI server is used to generate an HMI interface according to the target component, the configuration information of the target component, and the address of the variable bound to the target component, and send the HMI interface to the client;
[0129] The client is also used to display the HMI interface to the user.
[0130] The device of this embodiment can be used to perform Figure 1 The steps, specific implementation principles and implementation processes of the method embodiment shown are similar and will not be repeated here.
[0131] Optionally, the client is further configured to, after displaying the HMI interface to the user, send the completion instruction to the large model server in response to a completion instruction input by the user based on the HMI interface; wherein the completion instruction is used to instruct the large model server to complete missing information missing in the HMI interface, wherein the missing information is a missing component and / or a configuration item of a specified component that is missing;
[0132] The large model server is further configured to generate the missing information based on the completion instruction, and send the missing information to the HMI server;
[0133] The HMI server is further configured to modify the HMI interface based on the missing information to obtain an updated HMI interface;
[0134] The HMI server is further configured to send the updated HMI interface to the client to instruct the client to display the updated HMI interface to the user.
[0135] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for generating an HMI interface, characterized in that: The HMI interface generation method is applied to an HMI interface generation system, wherein the HMI interface generation system includes a client, a large model server and an HMI server; the method includes: The client sends the functional requirement to the large model server in response to the functional requirement input by the user; The large model server inputs the functional requirement into a pre-trained component selection model, so that the component selection model selects a target component matching the functional requirement; For each target component, the large model server selects a target configuration model corresponding to the target component from a plurality of pre-trained configuration models for different component types; The large model server inputs the functional requirement and the target component into the target configuration model, and the target configuration model configures the target component according to the functional requirement and outputs the configuration information of the target component; The large model server inputs the functional requirements, the target component and the variable table corresponding to the PLC program into a pre-trained mapping model, and the mapping model uses the functional requirements to search the address of the variable bound to the target component from the variable table; The large model server sends the target component, the configuration information of the target component, and the address of the variable bound to the target component to the HMI server; The HMI server generates an HMI interface according to the target component, the configuration information of the target component, and the address of the variable bound to the target component, and sends the HMI interface to the client; The client displays the HMI interface to the user.
2. The method according to claim 1, characterized in that After the client displays the HMI interface to the user, the method further includes: The client sends the completion instruction to the large model server in response to the completion instruction input by the user based on the HMI interface; wherein the completion instruction is used to instruct the large model server to complete the missing information missing in the HMI interface, wherein the missing information is the missing component and / or the configuration item of the missing component; The large model server generates the missing information based on the completion instruction, and sends the missing information to the HMI server; The HMI server modifies the HMI interface based on the missing information to obtain an updated HMI interface; The HMI server sends the updated HMI interface to the client to instruct the client to display the updated HMI interface to the user.
3. The method according to claim 1, characterized in that The training process of the component selection model includes: Acquire a first training sample set; wherein each training sample in the first training sample set includes a correspondence between a functional requirement and an identifier of a component; For each training sample in the first training sample set, decomposing the functional requirements in the training sample into fixed sentence patterns and variable slots; wherein the variable slots are operation information related to the operation in the functional requirements; Under the premise of keeping the sentence structure unchanged, the variable slots are randomly replaced, and the identifiers of the components in the training sample are updated based on the replaced slots to obtain an enhanced sample corresponding to the training sample; The first training sample set and the enhanced samples corresponding to each training sample in the first training sample set are used to train the first basic large model to obtain the pre-trained component selection model.
4. The method according to claim 3, characterized in that The training process of the configuration model for each component type includes: Acquire a second training sample set corresponding to the component type; wherein each training sample in the second training sample set includes a functional requirement, an identifier of a component corresponding to the functional requirement, and configuration information of the component; For each training sample in the second training sample set, decomposing the functional requirements in the training sample into fixed sentence patterns and variable slots; wherein the variable slots are configuration information related to the configuration items in the functional requirements; Under the premise of keeping the sentence structure unchanged, the variable slots are randomly replaced, and the configuration information in the training sample is updated based on the replaced slots to obtain an enhanced sample corresponding to the training sample; The second training sample set and the enhanced sample corresponding to each training sample in the second training sample set are used to train the second basic large model to obtain a configuration model for the component type.
5. The method according to claim 4, characterized in that After training the second basic large model using the second training sample set and the enhanced sample corresponding to each training sample in the second training sample set, the method further includes: Acquire a fourth training sample set; wherein the fourth training sample set includes binding relationships between events and variables of the events; The configuration model is trained using the fourth training sample set.
6. The method according to claim 4, characterized in that The training process of the mapping model includes: Acquire a third training sample set; wherein each training sample in the third training sample set includes a functional requirement, an identifier of a component corresponding to the functional requirement, configuration information of the component, and a variable bound to the component and an address of the variable; wherein the variable bound to the component is a variable in a variable table corresponding to a PLC program; The third basic large model is trained using the third training sample set to obtain the mapping model.
7. The method according to claim 6, characterized in that The first basic large model, the second basic large model and the third basic large model are the same.
8. The method according to claim 6, characterized in that The first basic large model, the second basic large model and the third basic large model are GPT-NeoX models.
9. An HMI interface generation system, characterized in that: The HMI interface generation system includes a client, a large model server and an HMI server; wherein, The client is used to respond to the functional requirements input by the user and send the functional requirements to the large model server; The large model server is used to input the functional requirements into a pre-trained component selection model, so that the component selection model selects a target component that matches the functional requirements; The large model server is further used to select, for each target component, a target configuration model corresponding to the target component from a plurality of pre-trained configuration models for different component types; The large model server is further used to input the functional requirements and the target component into the target configuration model, and the target configuration model configures the target component according to the functional requirements and outputs the configuration information of the target component; The large model server is further used to input the functional requirements, the target component and the variable table corresponding to the PLC program into a pre-trained mapping model, and the mapping model uses the functional requirements to search the address of the variable bound to the target component from the variable table; The large model server is further used to send the target component, the configuration information of the target component, and the address of the variable bound to the target component to the HMI server; The HMI server is used to generate an HMI interface according to the target component, the configuration information of the target component, and the address of the variable bound to the target component, and send the HMI interface to the client; The client is also used to display the HMI interface to the user.
10. The HMI interface generation system according to claim 9, characterized in that: The client is further configured to send a completion instruction to the large model server in response to a completion instruction input by the user based on the HMI interface after displaying the HMI interface to the user; wherein the completion instruction is used to instruct the large model server to complete missing information missing in the HMI interface, wherein the missing information is a missing component and / or a configuration item missing from a specified component; The large model server is further configured to generate the missing information based on the completion instruction and send the missing information to the HMI server; The HMI server is further configured to modify the HMI interface based on the missing information to obtain an updated HMI interface; The HMI server is further configured to send the updated HMI interface to the client to instruct the client to display the updated HMI interface to the user.
Citation Information
Patent Citations
Model generation method and device, storage medium and computer equipment
CN116992241A
Workpiece three-dimensional model generation method and device based on fine-tuning large model and medium
CN118153129A