CN110096278B - Extensible embedded man-machine interface tool implementation method - Google Patents

Extensible embedded man-machine interface tool implementation method Download PDF

Info

Publication number
CN110096278B
CN110096278B CN201910334899.3A CN201910334899A CN110096278B CN 110096278 B CN110096278 B CN 110096278B CN 201910334899 A CN201910334899 A CN 201910334899A CN 110096278 B CN110096278 B CN 110096278B
Authority
CN
China
Prior art keywords
interface
data
control
human
terminal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910334899.3A
Other languages
Chinese (zh)
Other versions
CN110096278A (en
Inventor
庞吉耀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Dongyuan Panneng Energy Technology Co ltd
Original Assignee
Nanjing Dongyuan Panneng Energy Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing Dongyuan Panneng Energy Technology Co ltd filed Critical Nanjing Dongyuan Panneng Energy Technology Co ltd
Priority to CN201910334899.3A priority Critical patent/CN110096278B/en
Publication of CN110096278A publication Critical patent/CN110096278A/en
Application granted granted Critical
Publication of CN110096278B publication Critical patent/CN110096278B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Digital Computer Display Output (AREA)

Abstract

The invention discloses an extensible embedded human-computer interface tool realization method, which consists of a human-computer interface configuration file, a human-computer interface service program positioned at an embedded terminal and a human-computer interface display program positioned at a PC (personal computer) end, wherein the human-computer interface service program of the embedded terminal and the human-computer interface display program of the PC end are connected through a serial port or a network, and the PC end interface display program is used for reconstructing a user interface according to the human-computer interface configuration file convention, displaying application data provided by the embedded terminal and sending a PC end interface operation command to the embedded terminal. The man-machine interface tool implementation method based on the invention has the advantages that the interface and the data are both designated by the configuration file, the man-machine interface service program of the embedded terminal and the PC terminal display program can realize standardization, the man-machine interface configuration file only needs to be modified for different embedded terminal applications, the software development workload can be simplified, and the method has good application prospects.

Description

Extensible embedded man-machine interface tool implementation method
Technical Field
The invention relates to the technical field of embedded man-machine interface tools, in particular to an extensible embedded man-machine interface tool implementation method.
Background
With the development of information technology, more and more terminal devices are added into an intelligent line, and due to the limitation of multiple factors such as cost, installation space, information safety, power consumption and the like, many intelligent electronic devices cannot be provided with local human-computer interfaces, and parameter configuration and information reading of the devices must be realized by relying on additional configuration programs, so that the workload of customizing the human-computer interface software of the PC end for the terminal devices with different shapes is very huge. In addition, based on the visual configuration interface, the terminal configuration program is easier to accept and use by the user, a terminal configuration program suitable for different applications is developed, the software development workload can be simplified, the code reusability is improved, an application developer can concentrate on the terminal application, and the terminal configuration program has a good application prospect.
At present, the configuration software of the intelligent electronic device mainly has the following two methods:
(1) Based on a specific application scene of the terminal equipment, independently developing a matched PC terminal configuration program;
(2) A set of configuration programs is developed using a unified human-machine interface template, and then terminal equipment is required to provide data according to configuration.
The human-computer interface of the embedded terminal is realized to a certain extent by the two schemes, but the two schemes have different application places, narrow application range and different defects, and specifically the following steps are carried out:
(1) Different configuration programs need to be developed for different applications, the code reuse degree is low, and the workload is large;
(2) Although the configuration of different terminal devices can be realized by using one set of configuration program, the style of the PC side interface is rigid and cannot be changed greatly, and the PC side interface still needs to be redeveloped when different interface styles are expected to be adopted.
Disclosure of Invention
The invention provides an extensible embedded human-computer interface tool implementation method for overcoming the defects in the prior art, which is used for simultaneously completing the configuration of terminal equipment and a PC (personal computer) end display program by using a human-computer interface configuration file and realizing the flexible matching of a PC end human-computer interface and any terminal.
In order to solve the technical problem, the invention provides an extensible embedded human-computer interface tool implementation method, which is characterized by comprising the following steps:
step S1, determining a data set to be displayed on an embedded terminal, and compiling a data dictionary;
the data dictionary comprises a data name, a data description, a data storage position, a data access method, a data display format, a data display form style, a control attribute bound with the data and an operation event;
s2, determining the interface layout of the PC side interface display program,
the interface layout comprises the number of forms, the number of controls on each form and the attributes of each control;
s3, constructing a human-computer interface configuration file;
the human-computer interface configuration file comprises an interface layout of a PC end interface display program, a data source corresponding to each control and an operation event;
s4, analyzing the human-computer interface configuration file at the PC end, generating a PC end interface display program according to the interface layout in the configuration file, generating a human-computer interface service program at the embedded terminal, analyzing the human-computer interface configuration file by the human-computer interface service program, acquiring a data source and an operation event corresponding to each control in the configuration file, and carrying out one-to-one correspondence with each control in the embedded terminal;
s5, establishing communication between the man-machine interface service program of the embedded terminal and the PC side interface display program;
and S6, when a user needs to operate certain data on the embedded terminal, directly operating a control bound with the data in the PC terminal interface display program, generating a communication message containing the data and control information by the PC terminal interface display program, sending the communication message to the embedded terminal human-computer interface service program, searching an operation event corresponding to the control according to the control information by the embedded terminal human-computer interface service program, executing corresponding operation and returning an operation result.
Furthermore, the controls in the PC side interface display program and the controls in the embedded terminal human-computer interface service program are in one-to-one correspondence.
Furthermore, the communication between the embedded terminal human-computer interface service program and the PC end interface display program is realized through a serial port or a network.
Further, the human-machine interface configuration file can be stored in a storage system of the embedded terminal and also can be stored in the PC terminal.
Further, the PC side interface display program comprises a background scanning thread and an interface display program daemon thread, wherein the background scanning thread triggers the generation of a periodic background scanning control message and requests the embedded terminal for data bound by each control, the interface display program daemon thread monitors the control operation on the user interface, and when an interface operation event occurs, the daemon thread encapsulates the data and control information of the user operation and attaches the data and control information to the background scanning control message to send to the embedded terminal.
Further, the human-machine interface configuration file is described from top to bottom by adopting a hierarchical structure.
Furthermore, the human-computer interface configuration file is described by an xml or C language.
Compared with the prior art, the invention has the following beneficial effects: the invention relates to an extensible embedded human-computer interface tool implementation method, which simultaneously completes the configuration of terminal equipment and a PC terminal display program by a human-computer interface configuration file, and the interface style, the bound data and the possible control operation event processing program of the human-computer interface tool are all specified by the configuration file, so that the terminal service program and the PC terminal display program can realize standardization, only the configuration file needs to be modified for different terminal applications, the software development workload can be simplified, and the extensible embedded human-computer interface tool implementation method has good application prospect. Has the following characteristics:
1) The style of the PC terminal display program is specified by a configuration file;
2) The PC terminal display program can realize standardization, and only the configuration file needs to be modified for application;
3) The binding of the application data set on the embedded terminal and the control on the interface window is specified by a configuration file;
4) The control corresponding to the event responded by the terminal equipment is also specified by the configuration file;
5) An application data set acquisition program on the terminal equipment and an event response program of a control are bound to a user application program in a callback mode;
6) The terminal service program can realize standardization, and only the callback processing program of the attributes and the events corresponding to the configuration file and the control needs to be modified for the application.
7) The PC side human-computer interface tool can simultaneously carry out data interaction with a plurality of embedded terminals, and provides PC side human-computer interface interfaces of different styles for each embedded terminal.
Drawings
FIG. 1 is a data flow and functional diagram of the present invention;
FIG. 2 is a state diagram of the embedded terminal daemon of the present invention;
FIG. 3 is a simplified schematic of the configuration file hierarchy of the present invention;
FIG. 4 is a simplified schematic of the configuration file of the present invention;
FIG. 5 is a schematic diagram of the language C description of the terminal software architecture of the present invention;
FIG. 6 is a schematic diagram of the system resource array C language description of the present invention;
FIG. 7 is a schematic diagram of a language description C of an example form template of the present invention;
fig. 8 is a language description illustration of a form example C of the present invention.
Detailed Description
The invention is further described below with reference to the accompanying drawings. The following examples are only for illustrating the technical solutions of the present invention more clearly, and the protection scope of the present invention is not limited thereby.
The invention is composed of a human-machine interface configuration file, a human-machine interface service program positioned in an embedded terminal, an interface display program positioned in a PC terminal and an interface design program positioned in the PC terminal, wherein the human-machine interface configuration file defines a user interface style of the PC terminal interface display program and an application data set of the embedded terminal, the human-machine interface service program positioned in the embedded terminal is responsible for providing data for the human-machine interface of the PC terminal and responding to a human-machine interface operation event of the PC terminal, the human-machine interface service program of the embedded terminal is connected with the human-machine interface display program of the PC terminal through a serial port or a network, the PC terminal interface display program reconstructs a user interface according to the convention of the human-machine interface configuration file and is responsible for displaying application data provided by the embedded terminal and sending an interface operation command to the embedded terminal, and the interface design program positioned in the PC terminal is mainly used for assisting a user to complete interface display window design, display data design on the embedded terminal and data binding between the display data of the embedded terminal and the display program of the PC terminal. The man-machine interface tool implementation method based on the invention has the advantages that the interface and the data are both designated by the configuration file, the man-machine interface service program of the embedded terminal and the PC terminal display program can realize standardization, the man-machine interface configuration file only needs to be modified for different embedded terminal applications, the software development workload can be simplified, and the method has good application prospect.
The invention discloses an extensible embedded man-machine interface tool implementation method, which comprises the following steps,
step (1), designing display data on an embedded terminal, grouping data to be configured and displayed on a human-computer interface tool on the embedded terminal according to the industry client habits of application services of the embedded terminal, determining display modes of various data, further determining dynamic data and static data to be displayed, and compiling a user application data dictionary, a related lookup mapping table and an enumeration table;
step (2), designing a PC end interface, determining the number and the hierarchical structure of interface windows on a PC end human-computer interface tool, the number and the attributes of controls on each window and operation events corresponding to each control, and forming a PC end interface design text;
step (3), an interface design program is constructed in a PC (personal computer) end human-computer interface tool, and the interface design program can complete the functions of visual interface window design and control layout, control attribute configuration, user data dictionary and lookup table entry, application data binding on an embedded terminal and configuration file export;
step (4), according to the texts obtained in the step (1) and the step (2), completing the entry of an interface window and a user data dictionary corresponding to the embedded terminal application by using a PC (personal computer) end interface design program, and constructing a human-computer interface configuration file by using the interface design program, wherein the human-computer interface configuration file comprises window template descriptions of a plurality of display interfaces contained in the human-computer interface, window instance descriptions of the display interfaces, control interface layout positions contained in window instances of the display interfaces, application data indexes and formats on the embedded terminal bound by the controls, operation events corresponding to the controls, embedded terminal event response processing program indexes bound by the controls and the like;
the method for constructing the interface window corresponding to the application of the embedded terminal based on the PC side interface design program comprises the following steps: (1) Firstly, according to the PC end interface design text obtained in the step 2, a blank window template is created by utilizing a PC end interface design program, controls listed in the interface design text are dragged to the window template from a PC end interface design toolbox, and then the positions of the controls are adjusted according to an attractive principle; (2) Appointing a default event processing handle index for the window template; (3) Obtaining a display data design result on the embedded terminal and the window template to create window instances according to the step 1, and assigning an associated data source index, an associated data source access method index and an operation event handle index for a control on each window instance;
the method for associating the control data source on the form example is to directly fill in a data source index or an index of a function of reading and writing data on the embedded terminal defined in the data design result file in the step 1; the human-computer interface configuration file is generated by a PC end interface design program, wherein the hierarchy of an interface window, the layout position and the data property of a control on the interface window, the bound data source index and the bound operation event handle index related in the human-computer interface configuration file are also generated by the interface design program.
The application methods of the human-computer interface configuration file in the PC-side interface display program are different from the application methods of the embedded terminal human-computer interface service program, and the PC-side interface display program mainly extracts interface window layout and static display data from the human-computer interface configuration file so as to realize drawing of a PC-side interface view designed by a user.
The human-computer interface configuration file can be stored in a default folder designated by a PC interface display program, and can also be deployed in a designated storage medium of the embedded terminal.
The layout position of the controls on the PC side interface window is determined by a PC side interface design program according to the steps in the window template design (determined by dragging and rearranging the controls), and the application data type and the display format of the embedded terminal bound by the interface controls are from the embedded terminal data design result file in the step 1.
The controls in the PC terminal interface display program and the controls in the embedded terminal human-computer interface service program are in one-to-one correspondence, and the controls are associated by communication through an Application Protocol Data (APDU) definition method based on a form and a control attribute data set (AttributeDataset). Displaying the specific appearance style, the determined position and the user operation feedback of a control on a program on a PC end interface, wherein a dynamic data source of the control comes from an embedded terminal; the embedded terminal side interface control has no view and only comprises index information for acquiring dynamic data on the embedded terminal and index information for responding to operation event handles associated with the PC side control. When a user operates a control in the PC side interface display program, the PC side interface display program generates a communication message containing the control information and the attached window information and sends the communication message to the man-machine interface service program of the embedded terminal, and finally the man-machine interface program of the embedded terminal executes corresponding operation according to the bound event handle index and returns an operation result. The method has the practical effects that the PC terminal interface program is responsible for interface view and operation interaction, the embedded terminal human-computer interface program is responsible for data operation, and the data and operation association of the control is realized through the communication program.
And (5) realizing the communication between the embedded terminal and the PC terminal interface display program.
Furthermore, the communication content and the communication mode between the embedded terminal and the PC terminal interface display program are described by a customized communication protocol, an application protocol data part (APDU) of the communication protocol contains interface window information and control information which are interacted between a human-computer service interface program on the embedded terminal and the PC terminal interface program and data source information on the embedded terminal bound by the control of the interface window information and the control information, and the application protocol data part (APDU) used for interaction contains complete length and check codes so as to be embedded into link layers of different communication links;
step (6), a man-machine interface service program is established on the embedded terminal, the service program comprises a communication module, a man-machine interface configuration file interpretation module, an application data collection module and an interface control operation event response module, the communication module of the man-machine interface service program of the embedded terminal is responsible for providing local man-machine interface configuration files for a PC end interface display program, submitting application data bound by the PC end interface program and receiving operation commands issued by a PC end interface display tool, the man-machine interface configuration file interpretation module is responsible for instantiating interfaces defined in the man-machine interface configuration files and various interface controls into embedded terminal local control objects and completing dynamic data binding of the controls according to control data source description information in the man-machine interface configuration files, the application data collection module is responsible for collecting the application data bound by the interface controls and submitting the application data to the communication module, and the interface control operation event response module is responsible for interpreting and executing user operations on the interface controls on the operation interface;
the human-computer interface configuration file is generated by a PC end interface design program in the step 4 stage, and the human-computer interface configuration file interpretation module of the embedded terminal only constructs the hierarchical structure of the windows and the controls described in the configuration file, completes the dynamic data source index and the local operation event processing handle index binding, and does not relate to the contents of window and control layout, view display and the like.
Step (7), a PC end interface display program is constructed, the interface display program comprises a communication module, a man-machine interface configuration file interpretation module, an application data display module and an interface control operation event sending module, the communication module of the PC end interface display program is responsible for reading the man-machine interface configuration file from the embedded terminal, collecting the uplink application data of the embedded terminal and issuing the operation command of the user on the PC end interface display program, the man-machine interface configuration file interpretation module is responsible for instantiating the interface window defined in the man-machine interface configuration file and the controls on each interface window into a local control object and completing the display of the interface window and the control view, the extraction of static data and the binding of dynamic data, the application data display module is responsible for displaying the application data from the embedded terminal to a specific control on a specific interface according to the format of the configuration file, and the PC end interface operation event sending module is responsible for collecting the operation event of the user on the PC interface display program and submitting the operation event to the embedded terminal;
the human-computer interface configuration file contains static data which can be directly used by a PC terminal interface display program, the dynamic data comes from the embedded terminal and is updated in the running process, and the dynamic data is sent to the PC terminal interface display program from the embedded terminal through the communication module.
Step (8), starting a PC end interface display program, starting a communication thread after the PC end interface display program is started, negotiating and reading the man-machine interface configuration file by the communication thread and the embedded terminal, prompting to search a local folder to search the man-machine interface configuration file if the embedded terminal does not have an effective man-machine interface configuration file, and then starting a configuration interpretation module to complete instantiation construction of a PC end interface display window and creation of each related thread;
the human-computer interface configuration file is generated by the method in the step 4, a communication thread in the PC end interface display program firstly checks the human-computer interface configuration file of the embedded terminal in a consultation mode, and the method has the effects that different display interfaces can be customized for different terminals, and the management of the human-computer interface configuration file can be simplified. Furthermore, the PC side interface program can further reduce the storage overhead of the embedded terminal and improve the interface starting speed by reserving the local human-computer interface configuration file, but the file management pressure is increased compared with the former.
Step (9), starting a background scanning thread and an interface display program daemon thread in a PC (personal computer) end interface display program, wherein the background scanning thread in the PC end display program periodically sends a background scanning communication control message to an embedded terminal, the embedded terminal submits application data bound on each interface window to the PC end display program in turn under the control of the background scanning message, the daemon thread in the interface display program in the PC end interface display program monitors the operation of a control on a user interface, and when an interface operation event occurs, the daemon thread encapsulates an active control on an active interface window operated by the user and sends information such as an operation event code aiming at the active control to the embedded terminal;
and the PC side interface display program completes the transmission of the PC side interface operation event information to the embedded terminal by a method of incidentally transmitting a window containing the triggering event, a control index number, the event number and an event information structure body in the background scanning message.
Further, the PC interface display program determines whether to fill the event information structure according to the number of operation events occurring on the PC interface during the background scanning period, and sets the event number value to 0 if no operation event occurs during the background scanning period, without adding the event information structure.
The event information structure comprises a plurality of event group information, wherein each event group consists of an object number (ObjectID) for triggering an event, an event code (EventID), a parameter number (EventArgNum) and a plurality of event parameters, and each event parameter consists of a < parameter mark (EventArgTag), a parameter length (EventArgLen), a parameter value (EventArgValue) > triple.
And (10) starting a man-machine interface service program on the embedded terminal, wherein after the man-machine interface service program on the embedded terminal receives a background scanning control message of a PC (personal computer) end interface display program, the man-machine interface service program of the embedded terminal updates local data and finishes application data submission by executing a data acquisition callback program specified by a man-machine interface configuration file, after receiving an operation command of the PC end interface display program, the man-machine interface service program of the embedded terminal extracts a window body of an event in the message, a control of the event, a control event code and an event parameter, and finishes one user interaction operation by executing the event callback service program specified by the man-machine interface configuration file.
The embedded terminal man-machine interface service program utilizes a communication message of an attribute data set (AttributeDataset) containing a Form (Form) and a Control (Control) thereof to upload application data to a PC terminal interface display program.
The attribute data set (AttributeDataset) of the form and the control is composed of < object ID, attribute group number (AttributeGroupNum), attribute group set (AttributeGroupSet) > triples, wherein the object ID corresponds to the form ID or the control ID, the attribute group number refers to the number of attribute groups contained in the subsequent attribute group set, and the attribute group refers to the set of a group of attributes with the same data type and display format.
Further, the form or control object attribute group set (AttributeGroupSet) is formed by connecting a plurality of attribute groups (AttributeGroup), wherein each attribute group is formed by < number (Num), mark (Tag), length (Length), data (Data) > four-tuples, the number (Num) field indicates the number of the attribute groups containing the same type of attributes, the mark (Tag) field indicates the type and display format of the type of attribute Data, the Length (Length) indicates the sum of the lengths of all attribute Data in the attribute groups, and the Data field (Data) contains the contents of all attribute Data in the attribute groups.
The specific implementation scheme of the invention is further described in the aspects of embedded terminal application data design, PC end interface design, human-computer interface configuration files, configuration file interpretation, interface design programs, communication protocols, terminal data binding, interface control operation events, PC end interface display program implementation and embedded terminal service programs by combining with the implementation examples.
1. Application data and interface design
1.1. Embedded terminal data design
The invention groups the application data according to the client habits and function positioning of the industry to which the application service of the embedded terminal belongs, determines the parameters to be configured and various data to be displayed, determines the display modes of various data, further determines the dynamic data and static data to be displayed, and compiles a user data dictionary and a related lookup mapping table and an enumeration table. The same data setting (PropertySet) and obtaining (PropertyGet) method can be used as much as possible for the data with consistent data types in a certain category, and whether the formatted display of the application data is processed by an embedded terminal or a PC (personal computer) end interface display program is determined.
The static data refers to static data which is not changed in the operation process, such as static text or numbers, and the dynamic data refers to data which can be continuously updated along with the operation of the system, such as dynamically acquired external data or various operation state information on the embedded terminal; the data dictionary is built by depending on a data analysis result to be displayed on the embedded terminal, and specifically comprises a data name, a data description, a data storage position (or an index of data stored on the terminal), a data access method (or an index of a read-write interface function of the data stored on the terminal), a data display format, a data display form style, a control name bound with the data and a binding method. The data dictionary can be compiled into a corresponding data table by using Excel or a similar spreadsheet tool;
the lookup mapping table is mainly used for a man-machine interface service program of the embedded terminal to finish executing localization operation on dynamic data access and control events, and comprises a dynamic data mapping lookup table and a control event operation method lookup table, wherein the dynamic data lookup mapping table defines a data item identifier, a data name and description, a data type and display format, a data source acquisition method and a setting method index of a certain data item on the embedded terminal, when the man-machine interface service program on the embedded terminal receives a dynamic data service request, the man-machine interface service program obtains information such as access methods (PropertyGet and PropertySet) and the data type and display format of the corresponding data item through the lookup table by using an index value bound on the control, and submits the information to a PC terminal interface display program after finishing data item processing. And the control event method lookup table defines the index of the man-machine interface service program on the embedded terminal to the PC side interface control event operation method, and when the man-machine interface service program on the embedded terminal receives an event operation request, the actual operation method handle corresponding to the event is obtained through the lookup table by using the index value bound by the control and is executed.
Furthermore, the same type of data uses a data mapping lookup table, and the same type of control event uses a control event operation method lookup table. For example, the read-only analog quantity to be displayed on the Label control (Label) is arranged in the same data table, the read-only switching quantity to be displayed is arranged in another mapping table, for example, the response method of the control event of the command button (CommandButton) is compiled into one lookup table, and the response method of the control event of the option button (OptionButton) is compiled into another lookup table.
The enumeration table is mainly used in a PC (personal computer) end interface display program, mainly comprises descriptive character strings based on constant indexes and is used for reducing the overhead of a communication program, and the PC end interface display program displays the constants into predefined character strings through the enumeration table according to the constant indexes sent by the embedded terminal in the interface interaction process.
PC end interface design
The design process of the PC end interface is consistent with the general visual programming design process, the display interface of the PC end needs to be planned, the number and the display style of window templates on a human-computer interface tool of the PC end are determined according to the industry to which the embedded terminal business belongs and the operation habit and the aesthetic principle of a terminal user in the industry, and the window hierarchical structure, the number and the attribute of controls on each window and default operation events corresponding to each control are designed from top to bottom. Furthermore, the PC side interface design should fully consider the operation habit of the industry user, arrange a group of related operations on the same window as much as possible and take into account the principle of beauty.
Further, the number of the form examples corresponding to each form template is determined on the basis of the application data design of the embedded terminal, the application data of the embedded terminal, a local application data access method and a local control operation event response method on the embedded terminal are numbered and indexed, then the controls on the form examples and the data on the embedded terminal and the control event response method are bound, and specifically, the indexes of the application data, the indexes of the data access methods and the indexes of the control operation event response methods on the embedded terminal are configured to the data link field and the control event link field of the interface form controls.
Further, a form template is designed for the same type of display data, the form template comprises a group of associated data display controls and corresponding operation events, and then the number of form instances and data required to be associated with the form instances are determined according to the data design result in the step 1.
The control type and the corresponding control operation event on the PC side interface window are determined according to the actually associated embedded terminal data, such as a static data use Label box (Label) control, an editable data use edit box (edit box) control, a single selection data use option button (Optionbutton), and a control execution use command button (Commandbiton). The control event is also determined, for example, a corresponding command button (Commandbutton) needs to bind a mouse click event (OnEventClick), when a user clicks a mouse on an interface form, the control on the embedded terminal is triggered to transmit a related control command, the command button control on the terminal executes the user click event, for example, an edit box (Editbox) needs to bind a content modification event (OnEventChange), when the user modifies a text in the edit box of the interface form, the control on the embedded terminal is triggered to transmit the related command, and the edit box control on the terminal finally executes the user modification event and returns the execution result.
Furthermore, an implementer needs to determine the number and the hierarchical structure of interface forms on the human-computer interface tool, the number of controls on each form, the properties of the controls and operation events corresponding to each control, and determine whether data bound by the controls is static data or dynamic data, wherein the static data such as a form title, static characters on the controls, and data which is not changed in operation such as fixed row heads, column heads and the like in a table are directly obtained from a configuration file as far as possible so as to reduce communication overhead, and the dynamic data is dynamically provided when a terminal operates.
2. Human machine interface configuration file
FIG. 3 shows a schematic diagram of a hierarchical structure of a human-machine interface configuration file according to the present invention, where the contents include a form template set, a form instance set, a lookup mapping table set, and an enumeration table set. The form template set is mainly used for constructing a PC (personal computer) end interface view and comprises a plurality of form templates, each form template comprises a plurality of controls, and the control configuration in the form templates comprises visual attributes, default operation events, static data and the like. The form instance set is mainly used for binding dynamic data on the embedded terminal and comprises a plurality of form instances, each form instance comprises a plurality of control instances, the control configuration on the form instances comprises static data, operation events, dynamic data and the like, and the dynamic data configuration properties of the controls mainly comprise data source properties, a data acquisition method, a data setting method and the like.
The lookup mapping table set is mainly used for a man-machine interface service program of the embedded terminal to complete the local operation of dynamic data and control events, and comprises a plurality of mapping lookup tables such as a dynamic data mapping lookup table and a control event operation method lookup table, wherein each lookup table configuration also comprises a plurality of table entries, the dynamic data lookup mapping table defines data item identification, data name and description, data type and display format, and data source acquisition method and setting method index of a certain data item on the embedded terminal, and when the man-machine interface service program on the embedded terminal receives a dynamic data service request, the lookup tables are used for acquiring information such as access methods (PropertyGet and PropertySet) and data types and display formats of the corresponding data item, and further completing the data item processing and then submitting the data item upwards. And the control event method lookup table defines the index of the man-machine interface service program on the embedded terminal to the PC side interface control event operation method, and when the man-machine interface service program on the embedded terminal receives an event operation request, the actual operation method handle corresponding to the event is obtained through the lookup table and executed.
Further, the invention uses the same mapping table for the same type of data and the same type of control event, for example, arranging the read-only analog quantity to be displayed on the Label control (Label) in the same data table, and arranging the read-only switch quantity to be displayed in another mapping table, for example, programming a lookup table for the response method of the control event of the command button (CommandButton), and programming another lookup table for the response method of the control event of the option button (OptionButton).
The enumeration table set is mainly used in a PC (personal computer) end interface display program, a human-computer interface configuration file comprises a plurality of enumeration tables, each enumeration table comprises a plurality of table entries at the right side, each table entry comprises a constant index and a descriptive character string corresponding to the constant index, the descriptive character string is used for reducing the overhead of a communication program, and the PC end interface display program displays the constant into a predefined character string through the enumeration tables according to the constant index sent by an embedded terminal in the interface interaction process.
The configuration files are described in a hierarchical structure from top to bottom, fig. 4 shows an abbreviated Xml-way representation of the system level configuration description file, and fig. 5 shows an abbreviated C-language description of the system configuration structure definition.
The configuration file in fig. 4 describes SYSTEM parameters (SYSTEM marks), then sequentially describes a form template (formpackages marks) and control components and control attributes (Controls marks) in the template, and then sequentially describes an instantiated form (Forms marks), a lookup table (Tables marks) and a data source (data source marks) in the SYSTEM. The form example description part of the invention does not include control view information, the information is obtained from a form template, the control event description (marked EvHandler) in the template description describes whether a control event response code is at a PC (Operator = 'Host') or an embedded Terminal (Operator = 'Terminal'), and the data connection attribute (marked DLink) of the control specifies possible user data when the control event is executed.
In addition, the data bound to the control can be marked as Dynamic data through a Dynamic property, for example, in fig. 4, the Dynamic property of the Text of the control TextBox0 on the form template formmetadata 0 is marked as True by using DText, that is, the data is marked as dynamically acquired, and the Text property of the control Button0 is static data and is directly designated as "Button0" by the configuration file.
The C language structure example shown in fig. 5 is mainly used for constructing a man-machine interface program of an embedded terminal, and the structures contain pointers and runtime information for constructing a linked list, but do not contain an interface view part. Fig. 5 provides structure definitions including a form template (hmi _ formproject) based on C language, a form instance (hmi _ WinForm), a basic Control (hmi _ Control), a check box Control (hmi _ CheckBox), a Button Control (hmi _ Button), and the like, wherein the number of specific structure members can be defined and added according to the implementation requirements of a man-machine interface tool. Further, when the method is implemented, the PC-side interface design program derives the C-language source file ([ C ]) and the C-language header file ([ h ]) of each window template and window instance based on the structural body according to the PC-side interface design instance result.
Further, the xml mark field can be added or reduced to the human-machine interface configuration file according to the requirement when the invention is actually realized, so as to add the configuration element. The human-machine interface configuration file can be manually generated by a terminal implementer through a text editor, but in most cases (such as an implementation example of the invention), an independent designer is provided by a PC-side human-machine interface tool to visually display the interface design, data binding and final configuration file output.
Further, the interface form template configuration part in the human-computer interface configuration file defines a template ID used by a PC-side interface display program, a control and control attribute contained in the template, and a default operation event, where the control attribute includes a control type, a control index, a position of the control on the form template, data statically displayed by the control, data bound by the control, an operator of the control event, and a default operation event handle. Further, since different controls have different appearance styles and different data binding capabilities, an implementer can add new properties according to the idea.
Further, the configuration structure of the interface form instance comprises a form instance index, a form template name, a form instance title and a form instance name. The control instantiation configuration comprises the control category, the control name, the position of the control in the form, the data bound by the control, the operation event and other properties.
And further reading the configuration file by the PC end interface display program, generating all form instances according to the information of the form instance configuration part, searching the form template according to the form template name described by the form instances when the form instances are generated, then instantiating a new form according to the listed controls on the form template, and finally finishing final data binding and operation event binding of the dynamic data part of the controls of the new form corresponding to the form instances by using the form instance configuration part.
3. Configuration file interpretation
The configuration file of the invention can be stored in the PC terminal, and also can be stored in the embedded terminal, which depends on the resource and application flexibility of the embedded terminal, and is decided by the negotiation with the embedded terminal program when the PC terminal display program is started. The method comprises the steps that a PC terminal configuration interpreter firstly analyzes system parameters and various window templates, then reads window instance information, constructs a window instance and a control set thereof according to the window template to which the window instance is attached, and carries out control layout according to the control information described by the window template, thereby further completing static data extraction and dynamic data binding. The PC side configuration interpreter program should create a class consistent with the entity part in the description file, and construct each instance object according to the instance information of the form, and the actual construction method is determined by the language used by the programming.
The invention also discloses a method for displaying the instance control in the embedded terminal, which comprises the following steps that part of an interpreter program of the embedded terminal is an optional module, and because the visualization display of the human-computer interface is not carried out on the terminal, the interpreter program only needs to construct a simplified version of the instance control in the configuration file, namely the interpreter program comprises a form corresponding to the control, a bound application data set, an event corresponding to the control and other elements. For a terminal with rich resources and flexible pursuit, the configuration file can be interpreted on the spot, and the local form set and the control set can be dynamically generated, so that the configuration and the application code of the terminal are independent.
4. Interface design program
The interface design program mainly completes the functions of layout and attribute setting of a window and a control object of a human-computer interface, application data binding, user data dictionary entry, configuration file generation, interface data frame file generation on an embedded terminal and the like. As an implementation example of the present invention, an interface designer implemented in C # language is exemplified here under Microsoft vistudio.
The interface designer adopts a popular visual design style, provides a control tool box and a Form control layout device for a user, and provides a Form and common controls such as Button, label, textBox, radioButton, listBox, comboBox and DataGridView for the user.
All controls of the interface designer are derived from a Control class of Net Framework, the Control is conveniently redrawn when a user drags the Control into a window or moves the Control by an OnPaint method of a Paint event of a heavy load Control class, and the user interface design operation is adapted by a Mouse event processing method of the heavy load Control, a keyboard event processing method and a Control drag and drop event processing method. When designing an interface, a user firstly creates a window, then selects a control on a control toolbox through a mouse, then drags the control into the window through the mouse, completes the size setting and the layout of the control, and finally, a control property viewer modifies the properties of the control to complete data binding.
The interface designer realizes a user data Dictionary and an enumeration table by packaging Dictionary classes and matching with a DataGridView control, realizes control attribute output to an Xml configuration item by adding a ToXml () method to each control and a form, realizes control attribute output to a terminal data configuration C header file by adding a ToCHeader () method to the control and the form, realizes control attribute output to a terminal C interface frame structure source file by adding a ToCSource () method to the control and the form, and realizes control attribute viewing and modification through a PropertyGrid control.
The design flow in the interface designer is that firstly a form template is created through the interface designer, then a desired control is added on a template form, when an example form is designed, the designed form template is selected firstly, the interface designer creates the example form by taking the template as an original form, and a user finishes the binding of terminal application data and the control and the binding of a control event and an event processing handle on a terminal on the example form.
After the user finishes the interface design, the interface designer updates the data attributes bound by the user by traversing the window set and the control set on the window, and then sequentially calls the ToXml () method and the ToCHeader () and the ToCSource () method of each control to realize the output of the configuration file and the C data structure source file and the related C header file of the interface frame on the terminal.
The C source file generation in the PC end interface design program mainly comprises the following steps:
and (1) traversing the form template set and the form instance set in the interface design instance result, further generating an array comprising all form template references and an array comprising all form instance references, and storing the arrays as independent system resource files.
As shown in fig. 6, the form template array includes references of all form templates used by the human-computer interface service program of the embedded terminal, the form instance array includes references of all form instances used by the human-computer interface service program, and the human-computer interface service program on the embedded terminal accesses the form instances described in the configuration file from top to bottom through the two arrays and further accesses the controls on the form instances through the form instances.
And (2) traversing the form template set in the PC end interface design example result, firstly calling ToCSource () of the form template to generate a configuration structure body of the form template, then calling ToCSource () methods of controls in the form template one by one to generate a configuration structure body of the controls, and further storing each finally generated form template configuration as an independent C source file.
As shown in fig. 7, a source file of the form template C defines structure variables and control variables of the form template, and is assigned with an initial value when the variables are defined, where a form template variable initialization member includes a template ID, a pointer pointing to a control array on the form template, and a default event of the template form, and a control array on the form template includes references to all controls on the template, and further, a control variable initialization member on the template form includes a pointer of a linked list of controls, a control type, and a possible default event operation handle index.
And (3) traversing the form instance set in the PC end interface design instance result, firstly calling ToCSource () of the form instance to generate a configuration structure body of the form instance, then calling ToCSource () methods of the controls in the form instance one by one to generate a configuration structure body of the controls, and further storing each finally generated form instance configuration as an independent C source file.
As shown in fig. 8, the source file of the form instance C defines a structure variable and a control variable of the form instance, and assigns an initial value to the variable definition, where the form instance variable initialization member includes a doubly linked list pointer of the form instance, a form template reference, a form instance ID, a pointer to a control array of the form instance, and an operation event handle index bound to the form instance. The control variables on the form instances also correspond to a structure body of the C language, and the initialization members of the structure bodies comprise control types and pointers of control single linked lists, and also comprise dynamic data binding of the controls, operation event indexes of the controls and the like.
The method for generating the C-head file in the PC end interface design program is similar to the method for generating the source file, and mainly comprises the following steps:
step (1), traversing the window template set and the window instance set in the PC end interface design result instance and further generating a common header file (such as hmiCommon. H), wherein the header file comprises the window template array and external reference descriptions of the window instance array, the number of window templates, the number of window instances and other constants, the PC end design instance is applied to other header files, and further all source files comprise the common header file.
And (2) traversing the form template set in the PC end interface design result example, firstly calling a ToCHEEAder () method of the form template to generate a header file of the form template, generating an external reference (extra) variable statement and a static variable (static) statement and a related constant of the form template, further calling a ToCHEEAder () method of a control on the template form to generate a control external reference statement and the like, and storing the result as an independent header file.
And (3) traversing the form instance set in the PC end interface design result instance, firstly calling ToCHEEAder () of the form instance to generate an external reference (extra) variable statement and a static variable (static) statement of the form instance, further calling a ToCHEEAder () method of a control in the form instance to generate an external reference statement of control information on the form instance and the like, and storing the result as an independent header file.
The ToXml () method of the control is similar to the ToCSource () method and the ToCHEder () method, firstly, a form template set and a form instance set in a design instance are retrieved, a SYSTEM hierarchy is further generated, then, SYSTEM (SYSTEM) level information is generated, then, the ToXml () method of the form template is called, the ToXml () method of the control on the form template is called one by one, and the configuration of the form template is generated, and the method is similarly used for generating the configuration information of the form instance, and the configuration information such as a lookup mapping table, an enumeration table and the like. The ToXml () method finally generates the configuration file as shown in fig. 4 in a hierarchical manner.
5. Communication protocol
As an example implementation of the present invention, an Application Protocol Data Unit (APDU) is used as a separate information body, and is encapsulated in link data of a bottom layer, and can be transmitted by using different communication links, and a system designer can also add an appropriate field according to Application requirements.
APDU information body structure
The uplink and downlink APDU structures of this example are consistent, an implementer should select a suitable encapsulation method according to the actual link protocol requirement, and agree on the maximum fragment length (MaxFrameLen) to indicate whether fragmentation is needed, and the structure is as follows:
Figure BDA0002038848770000221
the Opcode field indicates the actual operation code:
hmiOpcodeLogIn (0 x 01) - - -System Log
hmiOpcodeLogOut (0 x 02) - - -System Exit
hmiOpcodeLoadDB (0 x 03) - - -load database
hmiOpcodeLoadUI (0 x 04) -load user interface
hmiOpcode Scan user interface (0 x 05) — a scanning user interface
hmiOpcodeResponseUI (0 x 80) -Return event execution results
SSAP: the source service access point is fixed to be 0 when the configuration tool is down, and the self service point is indicated when the equipment is up
DSAP: the target service access point is formulated as a specific target service when the configuration tool is downlink, the device is fixed to be 0 when the device is uplink, and the service access point is exemplified as follows:
0- -configuration tool
1-service Point 1, also used to refer to target device 1
2-service Point 2, also used to refer to target device 2
3- -service Point 3, and so on
FrameNo, from 0 to 255, the transmission sequence number is unchanged if message retransmission occurs
Fragment markup
< D7> -0 this frame is the last slice,
-1 this frame is not the last fragment, the application should receive the subsequent fragments and assemble them
< D6.. D0> -slice number, from 0-63
Using an environment variable MaxFrameLen to indicate whether data needs to be fragmented
And (4) checking the sum: 16-bit checksum of data from DSAP to PDU
Length: including data between DSAP-to-PDU and length itself
5.2. Terminal uplink PDU partial structure
The following shows the uplink PDU structure of the terminal in the implementation example of the communication protocol, including the current template form identifier, the active control identifier, the form attribute, the control attribute and the like
Figure BDA0002038848770000231
Figure BDA0002038848770000241
5.2.1. Control attribute field (Control _ Attrib) structure
The following shows a control attribute dataset structure of an embedded terminal uplink to a PC interface display program in the foregoing communication protocol implementation example, and the structure is composed of < object ID, attribute group number, attribute group set > triple, where the object ID corresponds to a control identifier, and the attribute group number refers to the attribute group number included in a subsequent attribute group set.
Figure BDA0002038848770000242
The control may include multiple attribute groups, each attribute group being composed of a < number (Num), a Tag (Tag), a Length (Length), and Data (Data) > quadruplet, where a number (Num) field indicates the number of attributes of the same class included in the attribute group, a Tag (Tag) field indicates the type and display format of the attribute Data of the class, a Length (Length) indicates the sum of the lengths of all attribute Data in the attribute group, and a Data field (Data) includes the contents of all attribute Data in the attribute group.
Further, each attribute group may also include multiple attributes, but the data types and display formats of the attributes in the same attribute group must be the same, and the meaning of the members of the attribute group 0 is as follows:
ControlAttributeGroupNum 0- -the number of attributes in the Attribute group 0
ControlAttributeGroupTag 0-value type flag of Attribute group 0
ControlAttributeGroupLen 0- -the length of Attribute group 0
controlAttributeGroupData 0- -the data content of attribute group 0, and if the attribute group contains multiple attributes, the field data length is the sum of all attribute data,
the rest of the attribute group information and so on.
5.2.2. Form attribute field (Form _ Attrib) structure
The following shows the structure of the window attribute dataset of the display program from the embedded terminal to the PC interface in the communication protocol implementation example, and the structure also consists of the triple of < object ID, attribute group number, attribute group set >.
Figure BDA0002038848770000251
The object ID corresponds to a form identifier, and the form may also include a plurality of property groups, and the structure of the property group is consistent with that of the control, but the information name is different.
5.3. Downlink control command frame
In the foregoing communication protocol implementation example, the PDU part information structure of the downlink control frame of the PC-side display program is mainly represented as background scanning control, and if an operation event of a user on an interface occurs during background scanning, an event information structure is formed and added to a background scanning packet for piggybacking transmission, otherwise, the event information structure is empty (EventNum set to 0), and the PDU structure is as follows:
Figure BDA0002038848770000261
5.3.1. event information structure
The event information structure (EventInfo) descending along with the background scan packet includes multiple event group information, where each event group is composed of an object number (ObjectID), an event code (EventID), a parameter number (EventArgNum), and several event parameters, where an event parameter is composed of a triple of < parameter tag (EventArgTag), parameter length (eventareglen), and parameter value (EventArgValue) > triple.
Figure BDA0002038848770000262
Figure BDA0002038848770000271
The event code (EventID) gives a specific control operation event type, such as MouseMove, mouseDown, keyPress, click and the like, and the corresponding relation and the event parameter between the specific event code and the event type are specified by a system designer.
6. Terminal data binding
In the present invention, the binding relationship between the application data and the interface control is completed through a human-computer interface configuration file, as an example of the present invention, in the xml configuration file shown in fig. 4, control Button0 may implement a data object reference (linktem, linkMode, linkTopic) through an element marked by DLink, and control TextBox0 implements setting of Text Property (PropertySet) and a PropertyGet obtaining method through an element marked by Property. When a user clicks a control Button0 on an interface program, a service program on the terminal triggers a processing method specified by local OnEventClick and transmits data object references to an event processing function as required, and when the user modifies the content of the TextBox0, the terminal service program realizes data updating through a PropertySet method bound by the control and provides application data locally bound by the TextBox0 to the interface program through a PropertyGet method.
Although different applications have different control sets, the late binding of data is accomplished by an embedded terminal software developer, and fig. 5 shows an example of the present invention, which describes a C language structure linktrib _ t for late binding of data on an embedded terminal, and defines members such as a data object (linktem), an operation mode, and a corresponding property acquisition method (PropertyGet) and a data setting method (PropertySet).
When the man-machine interface configuration data and man-machine interface service program separation mode is adopted, corresponding to the example shown in fig. 5, the data object (linktem) of the structural body linktrib _ t member is set as the data source index, and the data source acquisition method and setting method (PropertyGet and PropertySet) members are set as the access method index, and when the man-machine interface service program on the embedded terminal receives a dynamic data service request, the actual access method of the corresponding data item is obtained through the aforementioned lookup mapping table and executed. When the human-computer interface configuration data and human-computer interface service program co-compilation mode is adopted, the data object (LinkItem) can be directly set as the address reference of the data source, and the members of the data source acquisition method and the data source setting method (PropertyGet and PropertySet) are directly set as specific access handles, so that the operation overhead is further reduced.
7. Interface control operation event
The event trigger information transmission path between the PC terminal interface display program and the embedded terminal is shown in figure 1, the PC terminal interface display program monitors user operation, retrieves a window of an initiating event according to a control of the current initiating operation event, determines corresponding event parameters by combining event codes, packages an event message according to the event message format convention in the communication protocol and transmits the event message downwards.
For the event caused by the form, the event processing service program positioned in the embedded terminal firstly checks the corresponding event handle of the event form EventForm example, if the event handle exists, the corresponding event handle is executed, otherwise, the event handle of the form template is checked, if the event handle exists, the corresponding event handle is executed, otherwise, the event is abandoned. For the event triggered by the control, the event handler firstly retrieves the corresponding event handle of the event control EventControl on the current event form EventForm, if yes, the event handler is executed, if not, the event handle of the corresponding control of the template form is retrieved, if yes, the event handler is executed, otherwise, the event is abandoned. The mechanism ensures that a large number of default event operations are completed by the template window, and personalized operation events are completed by the instance window, so that the embedded terminal service program is simplified under the condition of no failure and activity.
PC end interface display program implementation
One implementation example of the PC side interface display program is based on an object-oriented multithread application program, and the program comprises a communication module, a configuration file interpretation module, an application data display module and an interface control operation event sending module. The PC terminal interface display program comprises a configuration file interpretation module, a communication module, an application data display module and an interface event sending module, wherein the configuration file interpretation module of the PC terminal interface display program is responsible for instantiating an interface window defined in a configuration file and controls on each interface window into a local control object and completing data binding;
the PC end interface display program starts a communication thread after being started, the communication thread and the embedded terminal negotiate whether the human-computer interface configuration file is read in from the embedded terminal, if the configuration file does not exist on the embedded terminal, the PC end display program searches a local path to find a proper configuration file, and then a configuration interpretation module is started to complete the instantiation construction of a PC end interface display window and the establishment of each related thread.
And after the PC terminal interface display program is started, a background scanning thread is operated, the thread periodically sends a background scanning communication message to the terminal, the terminal submits application data bound on the current interface to the display program under the control of the background scanning message, and the display program formats the data and retrieves a window or a control corresponding to the data according to serialized data uploaded by the terminal and in combination with a configuration file to complete the update of the dynamic data of the PC terminal interface.
The PC terminal interface display program adopts an event triggering mechanism to monitor control operation on a user interface, when an interface operation event occurs, whether the user operation event is local operation or remote operation mapped to the embedded terminal is confirmed according to configuration, if the operation event is linked to the embedded terminal, the interface program packages information such as an active control on an active interface operated by a user, an operation event code aiming at the active control and the like to a background scanning message and sends the background scanning message to the embedded terminal;
after receiving application data from the embedded terminal, the PC terminal interface display program firstly retrieves a specific output window according to window information and control information contained in the data message, then formats the data in the predefined format and outputs the data to the output window according to the convention of a human-computer interface configuration file, and updates the non-predefined data items to the output window by adopting an embedded terminal self-description format string.
The PC end interface display program is designed into a multi-document window (MDI) mode, a plurality of human-computer interface configuration files are allowed to be opened at the same time, a new PC end display interface program example is created when a user opens a configuration file PC end human-computer interface tool, and each display program example generates a PC end display interface with different appearances and operation functions according to the own human-computer interface configuration file. Furthermore, different service access points (SSAP and DSAP) are allocated to different PC terminal display program examples, so that all the display programs can perform data interaction simultaneously with different embedded terminals through the same communication thread based on Application Protocol Data Units (APDUs) with the same format, and one-to-many data display and control functions of a PC terminal tool are realized.
9. Embedded terminal service program implementation
FIG. 2 is a state transition diagram of a human-computer interface service program running on an embedded terminal, which is classified according to operation codes after a downlink command of a PC end interface display program is received, and if a PC end requests a human-computer interface configuration file and the local human-computer interface configuration file is available, the local human-computer interface configuration file is uploaded; if the command is a background scanning command, the embedded terminal service program acquires the application data bound by the related control on the specific interface by executing a data acquisition program specified by the human-computer interface configuration file, and the application data is uploaded after being packaged by a communication layer; if the embedded terminal service program receives the operation command of the PC terminal interface display program, extracting information such as a form (EventForm) of an initiating event, a control (EventControl) of the initiating event, a control event code (EventID), an event parameter and the like in the message, calling back the service program by executing the event operation specified by the human-computer interface configuration file, and simultaneously submitting the event execution report to complete one user interaction operation.
The embedded terminal human-computer interface service program updates the dynamic data information of the currently prepared uploading window and the control thereon through the attribute data acquisition callback function of the control according to the convention of the human-computer interface configuration file, serializes the window and the control information according to the convention of the communication protocol, carries out local formatting on non-predefined data items, and then submits the data items to a PC end interface display program through a communication layer of the embedded terminal service program.
The terminal maintains a window queue with two priorities, wherein the current active window is at a high priority, the rest inactive windows are at a low priority, the terminal uploads the data of each window in turn under the control of a background scanning frame, but the uploading frequency of the active window is obviously more than that of the inactive window so as to improve the user experience, and the specific uploading strategy is determined locally by the terminal.
The embedded terminal man-machine interface service program resets the current active form according to the active form number (Activeform) carried in the background scanning message, and an active form is ensured to exist at any moment. When a window becomes an active window, the window is moved from the low priority scanning queue to the high priority scanning queue, and the active window becomes an inactive window and is moved into the low priority window scanning queue;
when the embedded terminal human-computer interface service program is transplanted in different applications, local data and a corresponding data acquisition and setting method are bound again according to needs, and meanwhile, an event response function is modified, and the core part of the event response function does not need to be changed.
The embedded terminal man-machine interface service program is slightly different due to different terminal performances, and is mainly embodied in the explanation and the use of a man-machine interface configuration file, the man-machine interface configuration file based on XML description can be locally stored for a terminal with larger storage space and higher CPU performance, the configuration file in an XML format is read after the service program on the terminal is started, each instance form and control instance are dynamically created according to the template form, and a search mapping table in the configuration file is read to finish the dynamic data binding and the binding of the operation event of the instance control. For the application occasions with limited storage space and low CPU performance, a configuration source file (. C) and a related header file (. H) described based on a C language structure (struct) are exported by utilizing a PC end interface design program, as shown in figure 6, figure 7 and figure 8, the file is compiled into a binary data file by using a compiling tool chain of an embedded terminal, and an embedded terminal man-machine interface service program reads the binary data file to complete the instantiation of a window and a control on the terminal, the dynamic data binding and the binding of a control operation event. In addition, the running performance can be further improved by binding the configuration file of the C language and the embedded terminal human-computer interface program.
The embedded terminal human-computer interface service program sends active form (Activeform) data at a higher frequency and sends other form data at a relatively lower frequency in turn under the control of a background scanning message of a PC (personal computer) interface display program, and the specific proportional relation is determined by an embedded terminal localization strategy according to the user experience effect.
The above description is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, it is possible to make various improvements and modifications without departing from the technical principle of the present invention, and those improvements and modifications should be also considered as the protection scope of the present invention.

Claims (8)

1. An extensible embedded man-machine interface tool implementation method is characterized by comprising the following steps:
step S1, determining a data set to be displayed on an embedded terminal, and compiling a data dictionary;
the data dictionary comprises a data name, a data description, a data storage position, a data access method, a data display format, a data display form style, a control attribute bound with the data and an operation event;
s2, determining the interface layout of the PC side interface display program,
the interface layout comprises the number of forms, the number of controls on each form and the attributes of each control;
s3, constructing a human-computer interface configuration file;
the human-computer interface configuration file comprises an interface layout of a PC end interface display program, a data source corresponding to each control and an operation event;
s4, analyzing the human-computer interface configuration file at the PC end, generating a PC end interface display program according to the interface layout in the configuration file, generating a human-computer interface service program at the embedded terminal, analyzing the human-computer interface configuration file by the human-computer interface service program, acquiring a data source and an operation event corresponding to each control in the configuration file, and carrying out one-to-one correspondence with each control in the embedded terminal;
s5, establishing communication between the man-machine interface service program of the embedded terminal and the PC side interface display program;
and S6, when a user needs to operate certain data on the embedded terminal, directly operating a control bound with the data in the PC terminal interface display program, generating a communication message containing the data and control information by the PC terminal interface display program, sending the communication message to the embedded terminal human-computer interface service program, searching an operation event corresponding to the control according to the control information by the embedded terminal human-computer interface service program, executing corresponding operation and returning an operation result.
2. The method as claimed in claim 1, wherein the controls in the PC interface presentation program and the controls in the embedded terminal human machine interface service program are in one-to-one correspondence, and the association is achieved by communication using an application protocol data definition method based on a form and a control attribute data set.
3. The method as claimed in claim 1, wherein the embedded terminal human-machine interface service program sends the data of the active window at a higher frequency and sends the data of other windows alternately at a relatively lower frequency under the control of the background scan message of the PC interface display program.
4. The method of claim 1, wherein the embedded terminal human-machine interface service program uses a communication packet containing a property data set of a window and its control to upload application data to the PC interface display program;
the attribute data sets of the window and the control thereof are composed of triple of < object ID, attribute group number and attribute group set >, wherein the object ID corresponds to the window ID or the control ID, the attribute group number refers to the number of attribute groups contained in the subsequent attribute group set, and the attribute groups refer to a set of attributes with the same data type and display format;
the window or control object attribute group set is formed by connecting a plurality of attribute groups, each attribute group is formed by < number, mark, length and data > four-tuples, wherein, the number field indicates the number of the attribute group containing the same type of attributes, the mark field indicates the type and the display format of the type of attribute data, the length indicates the sum of the lengths of all the attribute data in the attribute group, and the data field contains the contents of all the attribute data in the attribute group.
5. The method for implementing the extensible embedded human-computer interface tool as claimed in claim 3, wherein the PC side interface display program completes the transmission of the PC side interface operation event information to the embedded terminal by incidentally transmitting a window containing an event triggering, a control index number, an event number and an event information structure in the background scanning message;
the event information structure comprises a plurality of event group information, wherein each event group consists of an object number, an event code, a parameter number and a plurality of event parameters, which cause an event, and each event parameter consists of a triple of < parameter mark, parameter length and parameter value >.
6. The method as claimed in claim 1, wherein the embedded terminal and the PC-side hmi tool use the same configuration file, and the configuration file can be located in the terminal storage system or in the PC-side, and the PC-side hmi tool determines the loading location of the configuration file by negotiation with the embedded terminal whenever it is started;
the embedded terminal human-computer interface service program and the PC terminal human-computer interface tool have different usages for the same configuration file, the PC terminal interface display program mainly extracts interface window layout and static display data from the human-computer interface configuration file to realize drawing of a PC terminal interface view designed by a user, and the embedded terminal human-computer interface service program mainly extracts dynamic data source index information and operation event handle index information contained in a control in an interface window from the human-computer interface configuration file.
7. The method for implementing the extensible embedded human-computer interface tool as claimed in claim 1, wherein the PC interface presentation program includes a background scanning thread and an interface presentation program daemon thread, the background scanning thread triggers generation of a periodic background scanning control message to request data bound to each control from the embedded terminal, the interface presentation program daemon thread monitors control operation on the user interface, and the daemon thread encapsulates the data operated by the user and control information when an interface operation event occurs, and attaches the data and the control information to the background scanning control message to the embedded terminal.
8. The method as claimed in claim 1, wherein the human-machine interface configuration file includes Xml format description file and C interface source file and C header file, and is described in top-down method.
CN201910334899.3A 2019-04-24 2019-04-24 Extensible embedded man-machine interface tool implementation method Active CN110096278B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910334899.3A CN110096278B (en) 2019-04-24 2019-04-24 Extensible embedded man-machine interface tool implementation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910334899.3A CN110096278B (en) 2019-04-24 2019-04-24 Extensible embedded man-machine interface tool implementation method

Publications (2)

Publication Number Publication Date
CN110096278A CN110096278A (en) 2019-08-06
CN110096278B true CN110096278B (en) 2022-12-20

Family

ID=67445608

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910334899.3A Active CN110096278B (en) 2019-04-24 2019-04-24 Extensible embedded man-machine interface tool implementation method

Country Status (1)

Country Link
CN (1) CN110096278B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110457107B (en) * 2019-08-09 2021-01-15 珠海格力电器股份有限公司 Configuration software operation instruction management method, device and system
CN113050930A (en) * 2019-12-27 2021-06-29 北京华为数字技术有限公司 User graphical interface modification method and related equipment
CN111596607B (en) * 2020-04-14 2021-07-13 宝鸡石油机械有限责任公司 Upper computer general HMI interface design method capable of configuring text and operation command
CN112131504B (en) * 2020-08-28 2024-03-26 长沙市到家悠享网络科技有限公司 Webpage editing and displaying method, device, equipment and storage medium
CN114398086B (en) * 2020-08-29 2022-11-25 华为技术有限公司 Drive configuration management method, device, medium, equipment and system
CN115469871A (en) * 2022-09-09 2022-12-13 北京万讯博通科技发展有限公司 Customizable equipment management and control interface design method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001061508A1 (en) * 2000-02-17 2001-08-23 Digimarc Corporation Watermark encoder and decoder enabled software and devices
CN101788910A (en) * 2010-02-10 2010-07-28 中捷机床有限公司 Manufacturer advanced service system for NC (numerical control) processing center
CN102866890A (en) * 2012-09-11 2013-01-09 哈尔滨商业大学 System and method for generating Android embedded interface and program framework based on object correlation

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001061508A1 (en) * 2000-02-17 2001-08-23 Digimarc Corporation Watermark encoder and decoder enabled software and devices
CN101788910A (en) * 2010-02-10 2010-07-28 中捷机床有限公司 Manufacturer advanced service system for NC (numerical control) processing center
CN102866890A (en) * 2012-09-11 2013-01-09 哈尔滨商业大学 System and method for generating Android embedded interface and program framework based on object correlation

Also Published As

Publication number Publication date
CN110096278A (en) 2019-08-06

Similar Documents

Publication Publication Date Title
CN110096278B (en) Extensible embedded man-machine interface tool implementation method
US9720715B2 (en) Extending legacy scripting languages with graphical references
US9696972B2 (en) Method and apparatus for updating a web-based user interface
JP4381709B2 (en) server
JP4381708B2 (en) Graphical user interface system
US8407610B2 (en) Executable and declarative specification for graphical user interfaces
US10949381B2 (en) Reusable transformation mechanism to allow mappings between incompatible data types
KR101099272B1 (en) Web page rendering mechanism using external programmatic themes
US5583983A (en) Multi-platform object-oriented software development and deployment system
US20040046789A1 (en) Extensible user interface (XUI) framework and development environment
JP2010009623A (en) Transformation of platform specific graphical user interface widgets migrated between heterogeneous device platforms
AU2012271774A1 (en) Automated user interface object transformation and code generation
WO2012174021A2 (en) Automated user interface object transformation and code generation
JPH08339355A (en) Method and apparatus for access to processing task executionin distributed system
JP2007534045A (en) Apparatus for processing documents using a markup language
US20040012630A1 (en) Process for automatically creating and controlling a set of graphical objects in a client-server environment
US11349902B2 (en) System and method to standardize and improve implementation efficiency of user interface content
JP2006202308A (en) Graphical user interface method, graphical user interface device, and recording medium
WO2006046667A1 (en) Document processing device and document processing method
CN102541647A (en) Method for calling external function of executable component in software integration process
WO2006051719A1 (en) Data processing device and data processing method
CN117435678B (en) System integration method and system based on intermediate data pool and visual customization
KR20020000569A (en) skin system for Window applications
US20030176997A1 (en) User interface for a human-computer interaction
CN118034682A (en) Program main interface development framework design method based on action registration

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant