Protection equipment universal man-machine interaction system and method based on XML

文档序号:1534644 发布日期:2020-02-14 浏览:4次 中文

阅读说明:本技术 一种基于xml的保护设备通用人机交互系统及方法 (Protection equipment universal man-machine interaction system and method based on XML ) 是由 姜建钊 谭燕 房同忠 蒋森维 王夷夷 于 2019-10-12 设计创作,主要内容包括:本申请公开了一种基于XML的保护设备通用人机交互系统和方法,系统包括:XML配置文件、模型解析器、逻辑解析器、事件驱动器、数据服务器和视图堆栈单元;通过该系统及方法,本发明支持通过修改XML配置文件灵活配置菜单结构、菜单名称和菜单项参数传递,而不需要修改程序。本发明基于XML技术对电力二次保护设备界面常用控件进行抽象描述,实现了菜单结构灵活配置,菜单结构与程序处理解耦,相互独立,多种型号设备可以使用同一版软件,修改一个问题,使用同一版软件设备只需要更新程序即可,不需要其他维护措施,从而降低了程序维护难度、减少维护数量。(The application discloses a protection equipment universal man-machine interaction system and a method based on XML, wherein the system comprises the following steps: XML configuration file, model analyzer, logic analyzer, event driver, data server and view stack unit; by the system and the method, the invention supports the flexible configuration of the menu structure, the menu name and the menu item parameter transmission by modifying the XML configuration file without modifying the program. The invention abstractly describes the common controls of the interface of the power secondary protection equipment based on the XML technology, realizes flexible configuration of a menu structure, decouples the menu structure from program processing, is mutually independent, can be used by various types of equipment with the same version of software, solves the problem of modifying, only needs to update the program when using the same version of software equipment, does not need other maintenance measures, thereby reducing the program maintenance difficulty and reducing the maintenance quantity.)

1. An XML-based protection device universal human-computer interaction system, comprising: XML configuration file, model analyzer, logic analyzer, event driver, data server and view stack unit; the method is characterized in that:

the XML configuration file is respectively connected with a model parser and a logic parser, and the logic parser is respectively connected with an event driver, a data server and a view stack unit;

the XML configuration file comprises: defining XML file nodes, XML file node instantiation parameters, XML file node hierarchical relation and view switching logical relation;

the model parser is used for traversing all XML file nodes of the XML configuration file, instantiating the XML file nodes as objects according to the XML file node instantiation parameters, and storing the model instances which are successfully instantiated into a list; generating a corresponding control hierarchical inclusion relation according to the hierarchical relation of the nodes of the XML file;

the event driver receives a key operation signal on the display screen, converts the key operation signal into a signal which can be identified by the logic parser, and sends the signal to the logic parser;

the logic parser loads the view switching logic relationship in the XML configuration file, receives the signal of the event driver and the current view state in the view stack unit, generates a data request signal from the instantiated model according to the hierarchical inclusion relationship of the corresponding control, and sends the request signal to the data server; the logic analyzer receives the data returned by the data server, finds a data display view according to the returned data, displays the data display view on a display screen, and simultaneously, logically analyzes and informs a view stacking unit;

the data server receives the request signal sent by the logic analyzer, acquires the execution result corresponding to the request signal or stores the data corresponding to the request signal, and returns the data to the logic analyzer;

and the view stacking unit obtains the view switching and calling relation according to the return data returned to the logic analyzer by the data server, completes the view stacking and popping operations according to the view switching and calling relation, and records the view level information.

2. The universal human-computer interaction system for XML-based protection devices of claim 1, wherein:

and the XML file node defines one interface control as one node, and each node comprises a plurality of attributes.

3. The universal human-computer interaction system for XML-based protection devices of claim 2, wherein:

the attributes comprise public attributes and private attributes;

the common attributes include: the system comprises attribute numbers and attribute names, wherein each attribute number is unique in a human-computer interaction system, and one node is marked by the attribute number;

the private attribute is defined according to actual data attributes of different protection devices.

4. An XML-based protection device universal human-computer interaction system according to claim 1 or claim 2, wherein:

and the data server establishes a function mapping relation between the request signal and the corresponding execution result.

5. The universal human-computer interaction system for XML-based protection devices of claim 2, wherein:

the push and pop operation is specifically defined as: and when the logic parser receives the execution result as a view switching signal, the new view is pushed.

6. The universal human-computer interaction system for XML-based protection devices of claim 1, wherein:

the XML file node instantiation parameters comprise: node name, attribute number, node position, node size, current view, and attribute name.

7. The universal human-computer interaction system for XML-based protection devices of claim 1, wherein:

the hierarchical relationship of the nodes of the XML file comprises the following steps: a window node;

the window node includes: the system comprises a title child node, a view child node and a status child node, wherein each window node must define the view child node;

the window node and the child nodes thereof define a display interface of the whole view;

the view child node defines a main display area;

the title child node defines a title bar;

the status child node defines display status data.

8. The universal human-computer interaction system for XML-based protection devices of claim 2, wherein:

the instantiation process of the model resolver specifically comprises the following steps: the model parser defines a structural body corresponding to the instantiation parameters of the nodes of the XML file, and the instantiation process is to read the names and all attribute values of the nodes of the XML file and then assign the names and all attribute values to the structural body.

9. The universal human-computer interaction system for XML-based protection devices of claim 7, wherein:

the XML file node has a uniquely specified node name.

10. A protection equipment universal man-machine interaction method based on XML is characterized by comprising the following steps:

step 1: initializing a general man-machine interaction system of the protection equipment based on XML: in the model parser, traversing all XML file nodes of the XML configuration file, instantiating the XML file nodes as objects according to XML file node instantiation parameters, and storing successfully instantiated model instances into a list; generating a corresponding control hierarchical inclusion relation according to the hierarchical relation of the nodes of the XML file;

step 2: when the key is triggered, the event driver receives a key operation signal, converts the key operation signal into a signal which can be identified by the logic parser, and sends the signal to the logic parser;

and step 3: the logic analyzer is used for loading the logical relationship of view switching in the XML configuration file, receiving the signal of the event driver and the current view state in the view stack unit, generating a request signal from the instantiated model according to the hierarchical inclusion relationship of the corresponding control, and sending the request signal to the data server;

and 4, step 4: the data server receives the request signal sent by the logic analyzer, acquires the execution result of the function corresponding to the request signal or stores the data corresponding to the request signal, and returns the data result to the logic analyzer;

and 5: the logic analyzer receives the data returned by the data server, finds a data display view according to the returned data, displays the data display view on a display screen, and simultaneously, logically analyzes and informs a view stacking unit;

step 6: the view stacking unit is used for obtaining view switching and calling relations according to return data returned to the logic analyzer by the data server, completing view stacking and popping operations according to the view switching and calling relations and recording view level information;

and 7: if the key is a return key, the event driver notifies the view stacking unit, deletes the top view and displays the next top view.

Technical Field

The invention belongs to the field of design of electric power secondary equipment, and particularly relates to a universal human-computer interaction system and a universal human-computer interaction method for protection equipment based on XML.

Background

In the design and development of the power secondary equipment, a human-computer interaction process exists. In recent years, with the development of smart power grids, measurement and protection devices with different voltage levels are required to be gradually standardized, and meanwhile, the requirements on information displayed and set by measurement and protection devices are higher and higher. The stable and easy-to-maintain human-computer interaction system has great influence on improving the quality of secondary equipment and the stable operation of the whole power grid.

Human-machine interaction (HMI) processes typically take up around 50% of the code development in a device. The traditional man-machine interaction design is to customize functions according to specific requirements, a window data structure and a window calling relation are defined in a man-machine interaction system, the coupling degree of the man-machine interaction system function and an interface program is high, software does not have universality, and one set of interface program needs to be customized and developed for each designed product. Or a configuration file is adopted, but the system performance is lacked, and the readability and the expansibility are poor. With the increase of product types, the interface maintenance work is more difficult. Finally, the production cost is increased and the production efficiency is low. A universal and flexibly configurable human-computer interaction system is designed, and the design is more and more important in the development of electric power secondary equipment.

Although there is an interface research based on configuration in China, a text mode is mostly adopted, and a uniform format specification does not exist. XML can conveniently and effectively express structured data, is concise in syntax and easy to read, and has a hierarchical data structure which is very suitable for describing the structure and the containment relationship of each component in the HMI. The interface display based on XML configuration is developed on a PC, and the invention combines the characteristics of XML and abstracts a plurality of display control models by classifying the data of the protection and measurement and control device. Model structure, menu and display window logical relations are described by XML. HMI (human machine interface) platformization is realized, for different types of protection devices, device menus and display requirements can be met by modifying xml configuration, and code development and debugging workload is reduced to the great extent.

Disclosure of Invention

In order to overcome the defects in the prior art, the invention provides a protection equipment universal human-computer interaction system and a protection equipment universal human-computer interaction method based on XML, wherein the protection equipment universal human-computer interaction system based on XML comprises the following steps: XML configuration file, model analyzer, logic analyzer, event driver, data server and view stack unit;

the XML configuration file is respectively connected with a model parser and a logic parser, and the logic parser is respectively connected with an event driver, a data server and a view stack unit;

the XML configuration file comprises: defining XML file nodes, XML file node instantiation parameters, XML file node hierarchical relation and view switching logical relation;

the XML file node defines an interface control as a node, and each node comprises a plurality of attributes;

the attributes comprise public attributes and private attributes;

the common attributes include: the system comprises attribute numbers and attribute names, wherein each attribute number is unique in a human-computer interaction system, and one node is marked by the attribute number;

the private attribute is defined according to actual data attributes of different protection devices.

The model parser is used for traversing all XML file nodes of the XML configuration file, instantiating the XML file nodes as objects according to the XML file node instantiation parameters, and storing the model instances which are successfully instantiated into a list; generating a corresponding control hierarchical inclusion relation according to the hierarchical relation of the nodes of the XML file;

the logic parser loads the logical relationship of view switching in the XML configuration file, receives the signal of the event driver and the current view state in the view stack unit, generates a request signal from the instantiated model according to the hierarchical inclusion relationship of the corresponding control, and sends the generated request signal to the data server;

and the event driver receives a key operation signal on the display screen, converts the key operation signal into a signal which can be identified by the logic parser, and sends the signal to the logic parser.

The data server receives the request signal sent by the logic analyzer, acquires the function execution result corresponding to the request signal or stores the data corresponding to the request signal, and sends the data execution result to the logic analyzer;

and the data server establishes a function mapping relation between the request signal and the corresponding execution result.

And the view stacking unit obtains the view switching and calling relation according to the return data returned to the logic analyzer by the data server, completes the view stacking and popping operations according to the view switching and calling relation, and records the view level information.

The push and pop operation is specifically defined as: when the logic analyzer receives the execution result as a view switching signal, the new view is pushed;

the XML file node instantiation parameters comprise: node name, attribute number, node position, node size, current view and attribute name;

the hierarchical relationship of the nodes of the XML file comprises the following steps: a window node;

the window node includes: title child node, view child node and status child node;

the window node and the child nodes thereof define a display interface of the whole view;

the view child node defines a main display area;

the title child node defines a title bar;

the status child node defines display status data;

each window node must define a view child node, and other child nodes are optional;

the instantiation process of the model resolver specifically comprises the following steps: the model parser defines a structural body corresponding to the instantiation parameters of the nodes of the XML file, and the instantiation process is to read the names and all attribute values of the nodes of the XML file and then assign the names and all attribute values to the structural body.

The XML file node has a uniquely specified node name and cannot be renamed.

A general man-machine interaction method for protection equipment based on XML comprises the following steps:

step 1: initializing a general man-machine interaction system of the protection equipment based on XML: in the model parser, traversing all XML file nodes of the XML configuration file, instantiating the XML file nodes as objects according to XML file node instantiation parameters, and storing successfully instantiated model instances into a list; generating a corresponding control hierarchical inclusion relation according to the hierarchical relation of the nodes of the XML file;

step 2: when the key is triggered, the event driver receives a key operation signal, converts the key operation signal into a signal which can be identified by the logic parser, and sends the signal to the logic parser;

and step 3: the logic analyzer is used for loading the logical relationship of view switching in the XML configuration file, receiving the signal of the event driver and the current view state in the view stack unit, generating a request signal from the instantiated model according to the hierarchical inclusion relationship of the corresponding control, and sending the request signal to the data server;

and 4, step 4: the data server receives the request signal sent by the logic analyzer, acquires the execution result of the function corresponding to the request signal or stores the data corresponding to the request signal, and returns the data result to the logic analyzer;

and 5: the logic analyzer receives the data returned by the data server, finds a data display view according to the returned data, displays the data display view on a display screen, and simultaneously, logically analyzes and informs a view stacking unit;

step 6: the view stacking unit is used for obtaining view switching and calling relations according to return data returned to the logic analyzer by the data server, completing view stacking and popping operations according to the view switching and calling relations and recording view level information;

and 7: if the key is a return key, the event driver notifies the view stacking unit, deletes the top view and displays the next top view.

The beneficial effect that this application reached:

the method is characterized in that common controls of the interface of the electric power secondary protection equipment are abstractly described based on XML, the hierarchical relationship and the view skip relationship of XML configuration file nodes are described by using the XML, and the node name definition is supported; the flexible configuration of the menu structure is realized, and the menu structure is decoupled from the program processing and is mutually independent. Multiple types of equipment can use the same version of program, so that the program maintenance difficulty is reduced, and the maintenance quantity is reduced. And one problem is modified, and only the program needs to be updated by using the same software device, and other maintenance measures are not needed.

Drawings

FIG. 1 is a block diagram of a general man-machine interaction system for an XML-based protection device according to an embodiment of the present invention;

FIG. 2 is a schematic diagram illustrating the definition of a button file node according to an embodiment of the present invention;

FIG. 3 is a window hierarchy according to an embodiment of the present invention;

FIG. 4 is an example of a dialog box according to an embodiment of the present invention;

FIG. 5 is a view switching logic according to an embodiment of the present invention;

FIG. 6 is a tree menu according to an embodiment of the present invention;

FIG. 7 is a display partition according to an embodiment of the present invention.

Detailed Description

The present application 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 application is not limited thereby.

The invention provides a universal man-machine interaction system and a universal man-machine interaction method for protection equipment based on XML, wherein the universal man-machine interaction system for the protection equipment based on XML is shown in figure 1 and comprises the following components: XML configuration file, model analyzer, logic analyzer, event driver, data server and view stack unit;

the XML configuration file is respectively connected with a model parser and a logic parser, and the logic parser is respectively connected with an event driver, a data server and a view stack unit;

the XML configuration file comprises: defining XML file nodes, XML file node instantiation parameters, XML file node hierarchical relation and view switching logical relation;

the XML file node defines an interface control as a node, and each node comprises a plurality of attributes;

the attributes comprise public attributes and private attributes;

the common attributes include: the system comprises attribute numbers and attribute names, wherein each attribute number is globally unique in a human-computer interaction system, and one node is marked by the attribute number;

as shown in FIG. 2, taking the button file node as an example, how to abstract the display element is one of the key technologies of the method. The invention defines a man-machine interactive control as a node, and each node comprises a plurality of attributes; attributes are classified into public attributes and private attributes according to their properties. The following description will be given taking a common button as an example. As shown in FIG. 2, a status display view is shown, and the view primary element is a button. The button coordinates are (x, y) with the top left corner as the origin. Width with, height light. To distinguish different instances after model instantiation, a unique logo ID is added, along with a name attribute for editing button display names.

The summary is shown in table 1:

table 1: button component Properties

Due to different functions of each control, each control needs to define specific attributes, such as row and column attributes defined by the button control, and row and column information of the logo button in the view.

The complete xml file description for the button model is as follows:

the process of "button _ show _ anag" row "0" column "name" analog "x" 20 "y" 20 "width" 100 "height" 20 >

<request receiver="view_anag"request="SHOW_ANAG"/>

</button>

Node name and attribute naming rules

1) The node names, such as button, are model names. The system judges the model type through the node name and generates a model example. Different models are not renameable.

2) Attribute names, such as: id. name, etc. are node attributes. The system generates instance data by attributes. The same node cannot have the same name attribute.

3) The attribute value and the id attribute are globally unique and cannot be repeated. The system tags the unique model instance with an id.

The model parser generates an instance by parsing the XML configuration file, and the instance structure is as follows:

Figure BDA0002231095880000061

the Widget structure defines the general attribute members of the components, and for other special components, the attributes are only required to be added on the basis when needing to be extended.

The private attribute is defined according to actual data attributes of different protection devices.

The model parser is used for traversing all XML file nodes of the XML configuration file, instantiating the XML file nodes as objects according to the XML file node instantiation parameters, and storing the model instances which are successfully instantiated into a list; generating a corresponding control hierarchical inclusion relation according to the hierarchical relation of the nodes of the XML file;

the logic parser loads the view switching logic relation in the XML configuration file, receives the signal of the event driver and the current view state in the view stack unit, extracts the action instruction from the current view handle, and sends the action instruction to the data server;

and the event driver receives a key operation signal on the display screen, converts the key operation signal into a signal which can be identified by the logic parser, and sends the signal to the logic parser, and the logic parser generates a data request signal according to the current view state, wherein the request signal is defined by the data server.

The data server receives the request signal sent by the logic analyzer, acquires the execution result corresponding to the request signal or stores the data corresponding to the request signal, and returns the execution result to the logic analyzer;

and the data server establishes a function mapping relation between the request signal and the corresponding execution result.

And the view stacking unit obtains view switching and calling relations according to the execution result returned to the logic parser by the data server, completes view stacking and popping operations according to the view switching and calling relations, and records view level information. For example: a receiver attribute is defined in the request node, and the receiver value is the ID number of the display view. After the data is returned, the program will call receiver to specify the view display data.

The push and pop operation is specifically defined as: when the logic analyzer receives the execution result as a view switching signal, the new view is pushed;

the XML file node instantiation parameters comprise: node name, attribute number, node position, node size, current view and attribute name;

the hierarchical relationship of the nodes of the XML file, as shown in fig. 3, includes: a window node;

the window node includes: title child node, view child node and status child node;

the window node and the child nodes thereof define a display interface of the whole view;

the view child node defines a main display area;

the title child node defines a title bar;

the status child node defines display status data;

each window node must define a view child node, and other child nodes are optional;

it can be seen from fig. 3 that the XML file format can well express the containing relationship of the individual controls, and is intuitive and easy to understand. The model analyzer analyzes the node structure, and generates the structural relationship of the components after generating the component instances.

The instantiation process of the model resolver specifically comprises the following steps: the model parser defines a structural body corresponding to the instantiation parameters of the nodes of the XML file, and the instantiation process is to read the names and all attribute values of the nodes of the XML file and then assign the names and all attribute values to the structural body.

The XML file node has a uniquely specified name and cannot be renamed.

And the control parameter name definition and the parameter self-resolution are supported, as shown in FIG. 4.

Self-analysis of parameters:

Figure BDA0002231095880000071

Figure BDA0002231095880000081

this example defines a dialog box from which the implementation retrieves a parameter named set _ cpu, defined by the igname ═ set _ cpu ". The parameter input is in the form of a combobox combo box with two selectable items, CPU1 and CPU2, and the logical parser records the index value of the currently selected item by selecting the "up" and "down" keys of the panel. After the value is selected, press "OK". The logic resolver resolves the dialog box, searches the character attribute in the combobox, if found, continues to judge the current option index, and takes out the corresponding id data. And then transmitting the data to a data server for processing.

Taking the view analog menu as an example, when a plurality of CPUs are present, a CPU selection dialog box is added.

Figure BDA0002231095880000082

Description of the drawings:

getargsbyid is the logical parser method and dialog _ select _ cpu is the id attribute value of dialog. And the logic parser parses the request node, searches for a req _ args attribute, and if the request node succeeds, calls a getargsbyid method, obtains a value of set _ cpu, and the parameter is dialog _ select _ cpu.

The description will be given by taking the view of the analog quantity as an example. As shown in the view switching logic of fig. 5, the whole interactive process is completed in 7 steps by triggering through interface keys, viewing data and returning to a key menu.

The process of "button _ show _ anag" row "0" column "name" analog "x" 20 "y" 20 "width" 100 "height" 20 >

<request receiver="view_anag"request="SHOW_ANAG"/>

</button>

This example only configures one menu entry and the XML-based protection device universal human-computer interaction system can be displayed as a tree-like menu, as shown in fig. 6.

A general man-machine interaction method for protection equipment based on XML comprises the following steps:

step 1: initializing a general man-machine interaction system of the protection equipment based on XML: in the model parser, traversing all XML file nodes of the XML configuration file, instantiating the XML file nodes as objects according to XML file node instantiation parameters, and storing successfully instantiated model instances into a list; generating a corresponding control hierarchical inclusion relation according to the hierarchical relation of the nodes of the XML file;

step 2: when the key is triggered, the event driver receives a key operation signal, converts the key operation signal into a signal which can be identified by the logic parser, and sends the signal to the logic parser;

and step 3: the logic parser loads the logical relationship of view switching in the XML configuration file, receives the signal of the event driver and the current view state in the view stack unit, generates a request signal from the instantiated model according to the hierarchical inclusion relationship of the corresponding control, and sends the generated request signal to the data server; the method specifically comprises the following steps: the event driver analyzes a request attribute from a request-to-node according to the widget member node of the structure body, and sends a data request to a data server, wherein the request type is a request attribute value, and the request type is as follows: SHOW _ ANAG.

And 4, step 4: the data server receives the request signal sent by the logic analyzer, acquires the execution result corresponding to the request signal or stores the data corresponding to the request signal, and returns the data to the logic analyzer; the method specifically comprises the following steps: and after receiving the request, the data server finds a corresponding processing function response request according to the SHOW _ ANAG and returns corresponding data.

And 5: the logic analyzer receives the data returned by the data server, finds a data display view according to the returned data, displays the data display view on a display screen, and simultaneously, logically analyzes and informs a view stacking unit; the method specifically comprises the following steps: (3)

after receiving the data returned by the data server, the logic parser finds a data display view, in an example, a request, according to the response SHOW _ ANAG, finds a view attribute value view _ ANAG in the node, and then displays the data on the LCD display screen according to the format, as shown in fig. 7.

Step 6: the view stacking unit is used for obtaining view switching and calling relations according to return data returned to the logic analyzer by the data server, completing view stacking and popping operations according to the view switching and calling relations and recording view level information;

and 7: if the key is a return key, the event driver notifies the view stacking unit, deletes the top view and displays the next top view.

By the above steps, various common interface controls are abstracted, as shown in table 2:

TABLE 2 common controls List

Figure BDA0002231095880000101

Figure BDA0002231095880000111

The present applicant has described and illustrated embodiments of the present invention in detail with reference to the accompanying drawings, but it should be understood by those skilled in the art that the above embodiments are merely preferred embodiments of the present invention, and the detailed description is only for the purpose of helping the reader to better understand the spirit of the present invention, and not for limiting the scope of the present invention, and on the contrary, any improvement or modification made based on the spirit of the present invention should fall within the scope of the present invention.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:存储器管理方法以及存储控制器

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类