CN113221511A - Method, device and equipment for converting configuration file into XML file and storage medium - Google Patents

Method, device and equipment for converting configuration file into XML file and storage medium Download PDF

Info

Publication number
CN113221511A
CN113221511A CN202110394542.1A CN202110394542A CN113221511A CN 113221511 A CN113221511 A CN 113221511A CN 202110394542 A CN202110394542 A CN 202110394542A CN 113221511 A CN113221511 A CN 113221511A
Authority
CN
China
Prior art keywords
xml file
function
xml
converting
script
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.)
Pending
Application number
CN202110394542.1A
Other languages
Chinese (zh)
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.)
ZHEJIANG SUPCON RESEARCH CO LTD
Original Assignee
ZHEJIANG SUPCON RESEARCH 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 ZHEJIANG SUPCON RESEARCH CO LTD filed Critical ZHEJIANG SUPCON RESEARCH CO LTD
Priority to CN202110394542.1A priority Critical patent/CN113221511A/en
Publication of CN113221511A publication Critical patent/CN113221511A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/151Transformation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/14Tree-structured documents
    • G06F40/143Markup, e.g. Standard Generalized Markup Language [SGML] or Document Type Definition [DTD]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method, a device, equipment and a storage medium for converting a configuration file into an XML file, aiming at the problem that human-computer interface systems of different enterprises are closed and can not be interacted and shared with each other at present, the configuration file of the human-computer interface is divided into a picture set, a variable set, an IO driver set, a data type set, a function set and a script set, a separate conversion mode is adopted, the picture set, the variable set, the IO driver set, the data type set, the function set and the script set are mapped into the XML file one by one, and information is stored according to a standard XML format, so that configuration projects of human-computer interface software developed by different enterprises can export the interactive XML file, and cross-platform data interaction and sharing are realized.

Description

Method, device and equipment for converting configuration file into XML file and storage medium
Technical Field
The invention belongs to the technical field of data file conversion, and particularly relates to a method, a device, equipment and a storage medium for converting a human-computer interface configuration file into an XML file.
Background
The monitoring configuration software is configurable software commonly used in the industrial control field, and the common method is to create a project, establish a picture in the project, add primitive controls, define variables, write scripts and other operations, run the project after configuring the project, View the monitoring picture in a monitoring View interface, monitor the production flow and other conditions of the industrial control industry.
For a long time, the human-computer interface industry lacks a uniform technical foundation, so that human-computer interface software systems of various enterprises are closed and cannot be interacted and shared with one another, and different human-computer interface platform software does not have a uniform object model. The human-computer interface configuration file lacks a uniform description mode and a uniform extension mode, the modes adopted by platform software for the extension of configuration software are different, some software adopts an attribute configuration mode, and some software adopts a script language mode. Furthermore, the use of script languages is also varied, and there are differences in syntax, semantic representation, execution modes, and the like. In addition, because there is no uniform configuration software model, when developers develop configuration software by using different scripting languages, the oriented programming model, information model and behavior model of the configuration software are not consistent, so that the human-computer interface configuration files of enterprises are incompatible.
Because the monitoring configuration software of each enterprise is independent, and the variable set, the picture set and the IO driver set are also independent, if the picture of the enterprise software A is imported into the enterprise software B, the method cannot be realized. And only the picture can be redrawn, the variable and the IO device driver can be redefined, and cross-platform data interaction and sharing cannot be realized.
Disclosure of Invention
The invention aims to provide a method, a device, equipment and a storage medium for converting a configuration file into an XML file, wherein the configuration file is divided into a picture set, a variable set, an IO driver set, a data type set, a function set and a script set, the form of separate conversion is adopted, the contained information of the picture set, the variable set, the IO driver set, the data type set, the function set and the script set is mapped into the XML file one by one, and the information is stored according to a standard XML format, so that the configuration engineering of human-computer interface software developed by different enterprises can derive an interactive XML file, and cross-platform data interaction and sharing are realized.
In order to solve the problems, the technical scheme of the invention is as follows:
a method for converting configuration files into XML files, which is used for human-computer interface software to export interactive XML files, and the method for converting configuration files into XML files comprises the following steps:
dividing the configuration file into a picture set, a variable set, an IO device driver set, a data type set, a function set and a script set;
according to the data characteristics of the picture set, the information description of the graphic elements is defined in a standard mode, and the picture set is converted into an XML file;
according to the data characteristics of the variable set, information description of variable names, variable sources, variable types and numerical ranges is defined in a standard mode, and the variable set is converted into an XML file;
according to the data characteristics of the IO device driver set, information description of heterogeneous devices and communication protocols in a network is defined in a standard mode, and the IO device driver set is converted into an XML file;
according to the data characteristics of the data type set, the conversion among different data types is defined in a standard way, and the data type set is converted into an XML file;
according to the data characteristics of the function set, defining a uniform function description mode in a standard mode, and converting the function set comprising a mathematical function, a character string function and a time function into an XML file;
according to the data characteristics of the script set, the object description of the trigger event is defined in a standard mode, and the script set comprising the picture script and the database script is converted into an XML file.
According to an embodiment of the present invention, the specifying an information description defining a graphic element according to a data characteristic of a scene set, and the converting the scene set into an XML file further includes:
abstracting and packaging the graphic elements in an object-oriented mode to obtain a graphic element assembly;
and configuring attributes and parameters of the primitive components, and constructing the primitive components according to the requirements of TC6_ XML _ V201.xsd which can describe the structure of the document to obtain an XML file which accords with the XML standard.
According to an embodiment of the present invention, the standardizing information description defining heterogeneous devices and communication protocols in a network according to data characteristics of an IO device driver set, and converting the IO device driver set into an XML file further includes:
defining attributes of elements of an IO device driver set, wherein the attributes comprise a device name, a device description, a communication protocol, a device address and a connection type;
and converting the IO device driver set into an XML file according to an XML Schema or a DTD standard.
According to an embodiment of the present invention, the specification defines a conversion between different data types according to data characteristics of the data type set, and the converting the data type set into an XML file further includes:
defining attributes of elements in the data type set, wherein the attributes comprise variable names, variable descriptions, data types, variable initial values, upper value limits and lower value limits;
and converting various data types into XML files in a unified format.
According to an embodiment of the present invention, the defining a unified function description manner according to the data characteristics of the function set in a specification, and converting the function set including the mathematical function, the character string function, and the time function into the XML file further includes:
defining attributes of elements in the function set, wherein the attributes comprise function names, function descriptions, function return types and function implementation codes;
defining attributes of sub-elements of the function element, wherein the attributes comprise form parameter names, form parameter descriptions, form parameter types, form parameter transmission modes and default values;
and converting the function set into an XML file according to an XML Schema or a DTD standard.
According to an embodiment of the present invention, the defining the object description of the trigger event according to the data characteristics of the script set, and the converting the script set including the screen script and the database script into the XML file further includes:
defining attributes of elements in the script set, wherein the attributes comprise a script name, a script description and a foot body;
and converting the script set into an XML file according to an XML Schema or a DTD standard.
According to an embodiment of the invention, the method for converting the configuration file into the XML file is used for cross-platform XML data interaction among multiple application systems;
any application system extracts a configuration file in a memory and generates a DOM tree, wherein the DOM tree is a document object with a standard interface; performing XML Schema analysis on the document object in the DOM tree by adopting JAXP to generate an XML file, and storing the XML file in a database;
any application system can transmit the XML file in the database to another application system through the network, and the other application system receives the XML file and analyzes the XML file into a configuration file.
An apparatus for converting a configuration file into an XML file, which is used by a human-computer interface software to export an interactive XML file, comprising:
the classification module is used for dividing the configuration file into a picture set, a variable set, an IO device driver set, a data type set, a function set and a script set;
the first conversion module is used for standardizing and defining the information description of the graphic elements according to the data characteristics of the picture set and converting the picture set into an XML file;
the second conversion module is used for standardizing and defining information description of variable names, variable sources, variable types and numerical value ranges according to the data characteristics of the variable sets and converting the variable sets into XML files;
the third conversion module is used for standardizing and defining information description of heterogeneous equipment and a communication protocol in the network according to the data characteristics of the IO equipment driver set and converting the IO equipment driver set into an XML file;
the fourth conversion module is used for defining the conversion among different data types according to the data characteristics of the data type set in a standard way and converting the data type set into an XML file;
the fifth conversion module is used for defining a uniform function description mode in a standard mode according to the data characteristics of the function set and converting the function set comprising a mathematical function, a character string function and a time function into an XML file;
and the sixth conversion module is used for defining the object description of the trigger event according to the data characteristics of the script set in a standard way and converting the script set comprising the picture script and the database script into an XML file.
The device for converting the configuration file into the XML file comprises a memory and a processor, wherein computer readable instructions are stored in the memory, and when the processor executes the computer readable instructions, the method for converting the configuration file into the XML file in one embodiment of the invention is realized.
A computer readable medium stores a computer program that, when executed by one or more processors, implements a method for converting a configuration file into an XML file according to an embodiment of the present invention.
Due to the adoption of the technical scheme, compared with the prior art, the invention has the following advantages and positive effects:
the method for converting the configuration file into the XML file in the embodiment of the invention is used for solving the problem that human-computer interface systems of different enterprises are closed and cannot be interacted and shared with each other at present, the human-computer interface configuration file is divided into a picture set, a variable set, an IO driver set, a data type set, a function set and a script set, a separate conversion mode is adopted, the picture set, the variable set, the IO driver set, the data type set, the function set and the script set are mapped into the XML file one by one, and information storage is carried out according to a standard XML format, so that the interactive XML file can be exported by configuration engineering of human-computer interface software developed by different enterprises, and cross-platform data interaction and sharing are realized.
Drawings
FIG. 1 is a flowchart illustrating a method for converting a configuration file into an XML file according to an embodiment of the present invention;
FIG. 2 is a diagram of configuration file classification according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating an XML file format for primitives in accordance with an embodiment of the present invention;
FIG. 4 is a diagram of a variable XML file format in an embodiment of the invention;
FIG. 5 is a format diagram of an IO device driver XML file according to an embodiment of the present invention;
FIG. 6 is a diagram of a data type XML file format in an embodiment of the invention;
FIG. 7 is a diagram of a function XML file format in an embodiment of the invention;
FIG. 8 is a diagram of a script XML file format in accordance with an embodiment of the present invention;
FIG. 9 is a block diagram of an apparatus for converting a configuration file into an XML file according to an embodiment of the present invention;
FIG. 10 is a diagram illustrating an apparatus for converting a configuration file into an XML file according to an embodiment of the present invention.
Detailed Description
The method, apparatus, device and storage medium for converting a configuration file into an XML file according to the present invention are described in detail with reference to the accompanying drawings and specific embodiments. Advantages and features of the present invention will become apparent from the following description and from the claims.
Example one
The embodiment provides a method for converting a configuration file into an XML file aiming at the problems that human-computer interface systems of different enterprises are closed and cannot interact and share with each other at present, and the method is used for exporting an interactive XML file by human-computer interface software and realizing cross-platform data interaction and sharing.
Specifically, referring to fig. 1, the method for converting the configuration file into the XML file includes:
s1: dividing the configuration file into a picture set, a variable set, an IO device driver set, a data type set, a function set and a script set;
s2: according to the data characteristics of the picture set, the information description of the graphic elements is defined in a standard mode, and the picture set is converted into an XML file;
s3: according to the data characteristics of the variable set, information description of variable names, variable sources, variable types and numerical ranges is defined in a standard mode, and the variable set is converted into an XML file;
s4: according to the data characteristics of the IO device driver set, information description of heterogeneous devices and communication protocols in a network is defined in a standard mode, and the IO device driver set is converted into an XML file;
s5: according to the data characteristics of the data type set, the conversion among different data types is defined in a standard way, and the data type set is converted into an XML file;
s6: according to the data characteristics of the function set, defining a uniform function description mode in a standard mode, and converting the function set comprising a mathematical function, a character string function and a time function into an XML file;
s7: according to the data characteristics of the script set, the object description of the trigger event is defined in a standard mode, and the script set comprising the picture script and the database script is converted into an XML file.
In step S1, because there is no uniform object model between the human-computer interface platform software of different enterprises, the human-computer interface configuration file lacks a uniform description manner and has no uniform extension manner, the platform software adopts different manners for extending the configuration software, some software adopts an attribute configuration manner, some software adopts a scripting language manner, and the scripting language is also used in various manners, and there are differences in syntax, semantic representation, execution manner, and the like. In order to cover all the expression ways of the configuration files as much as possible, the present embodiment classifies the configuration engineering files into a picture set, a variable set, an IO device driver set, a data type set, a function set, and a script set, please refer to fig. 2.
The picture set is a set storing one or more pictures, the picture nodes contain node information such as attributes, events, containers and menus, and the container nodes contain element set information.
The variable set is a set for describing configuration engineering variable statements, and the variable nodes comprise variable names, data types, variable descriptions and variable initial values.
The IO device driver set is a set describing the configuration of IO device drivers in the configuration engineering. The attributes of the IO device driver include a device name, an enterprise-specified model, a protocol name, an encoding format (GB2312, UTF8, etc.), a byte order (big-end mode, little-end mode), a data update period, and a communication timeout time.
The set of data types is a collection of data types describing the configuration engineering. The data types comprise integer data types, real data types, character string data types and Boolean data types.
The function set is a set for describing user-defined function statement and implementation in the configuration engineering, and a user can package some public and general operations or operations into a user-defined function and then call the user-defined function in a script. The attributes of the function element include a function name, a function description, a function return data type, and a function implementation code.
The script set is a set of global script definitions describing configuration in configuration engineering, the script is a programming language based on objects and events, and each segment of the script is closely related to a certain object or trigger event. The properties of a script element include a script name, a script description, and a script definition.
The emergence of the xml (extensible Markup language) standard can become a core technology for realizing various complex heterogeneous data exchanges at present. The information exchange platform based on the XML technology does not force all node enterprises participating in information exchange to use a uniform data format and a data processing standard, but realizes the uniformity among different system data formats through a customized interface. The XML technology is used in the enterprise information exchange platform, so that information interaction among enterprises can be realized, the operation of the enterprises is directly driven by utilizing enterprise operation information, and the operation information is timely fed back to an enterprise internal information management system.
In step S2, the specifying an information description defining a graphic element according to a data characteristic of the scene set, the converting the scene set into an XML file further comprises:
abstracting and packaging the graphic elements in an object-oriented mode to obtain a graphic element assembly;
and configuring attributes and parameters of the primitive components, and constructing the primitive components according to the requirements of TC6_ XML _ V201.xsd which can describe the structure of the document to obtain an XML file which accords with the XML standard.
The XML conversion of the picture set mainly comprises a picture set in a human-computer interaction visual range, and the key technology is to store information description of primitives and primitive combinations in a container, to standardly define graphic elements such as the primitives and a flow chart, to trigger and associate a menu and an event and the like.
The embodiment creates corresponding primitive components, such as an ellipse component, a rectangle component and the like, according to different primitives or graphics. And maintaining the primitive components according to requirements so as to update the state information of the primitive components such as selection, addition, deletion, attribute modification and the like in real time.
And obtaining an XML file conforming to the XML standard by storing the attributes and the logical relations of the primitive components and describing the primitives according to a TC6_ XML _ V201.xsd file capable of describing the document structure. Please refer to fig. 3, which is an example of a rectangular primitive, the attributes of which include a primitive name ", an upper left X coordinate" left ", an upper left Y coordinate" top ", a width", a height ", an associated layer number" layerID ", a rotation center point X coordinate" origion X ", a rotation center point Y coordinate" origion ", and a rotation angle" rotateGon "attribute; the color of the painting brush is "penColor", the line width is "penWidth", and the line type is "penType"; brush style "brushStyle", fill color ", and the like. After the picture elements are constructed in the configuration software, the information of the picture elements is mapped to the XML files one by one, and the formed XML files are shown in fig. 3.
In step S3, the specification defines information description of variable name, variable source, variable type, and value range according to the data characteristics of the variable set, and the variable set is converted into an XML file.
The XML conversion of the variable set mainly comprises the core data processing of the human-computer interaction software, and the key technology lies in the aspects of normative definition of range class, alarm class, historical records and the like. The attribute of the variable set element includes a variable name ", a data type" dataType ", a variable description", an initial value "initValue", a variable unit grouping number "unit", a range conversion "Scale", an alarm "Alarms", and a history "Historys", and the like, and the generated XML file content is shown in fig. 4.
In step S4, according to the data characteristics of the IO device driver set, the specification defines information description of heterogeneous devices and communication protocols in the network, and converting the IO device driver set into an XML file further includes:
defining attributes of elements of an IO device driver set, wherein the attributes comprise a device name, a device description, a communication protocol, a device address and a connection type;
and converting the IO device driver set into an XML file according to an XML Schema or a DTD standard.
The XML conversion of the IO device driver set mainly comprises a key implementation link of communication data interconnection and intercommunication, and the key technology lies in description definition of IO devices in a network, normative definition of communication protocols (such as Modbus and OPC) and the like. The attribute of the IO device driver set element includes a name of the device, "name" of the device, "desc" of the device, "protocol" of the communication protocol, "devAddress" of the device, and "linkType" of the connection type, and the converted XML file please refer to fig. 5.
The XML Schema or DTD standard is two standardized languages for XML. DTDs resemble the syntax of a written language that specifies the precedence of the principal and predicate objects. The DTD specifies XML syntax such as the order of elements, the number of elements, etc. The XML Schema is used for defining a legal construction module of the XML document and can replace the DTD. The XML Schema specifically defines elements and attributes that may appear in a document; defining which element is a child element; defining an order of the sub-elements; defining a number of sub-elements; defining whether an element is empty or whether it can contain text; defining data types of elements and attributes; default values for elements and attributes are defined, as well as fixed values. Therefore, the present embodiment mainly adopts XML Schema as the format of the XML file.
In step S5, the specification defines a conversion between different data types according to data characteristics of the set of data types, and converting the set of data types into an XML file further comprises:
defining attributes of elements in the data type set, wherein the attributes comprise variable names, variable descriptions, data types, variable initial values, upper value limits and lower value limits;
and converting various data types into XML files in a unified format.
The XML conversion of the data type set mainly comprises the uniform realization of various data types, and the key technology lies in the conversion of the data types. The data type element includes a variable name ", a variable description" desc ", a data type" dataType "(int, real, string, boolean), an initial value" initValue ", an upper limit" and a lower limit "lowLimit", and the XML file generated by the data type conversion is shown in fig. 6.
In step S6, defining a unified function description according to the data characteristics of the function set, and converting the function set including the mathematical function, the string function, and the time function into an XML file further includes:
defining attributes of elements in the function set, wherein the attributes comprise function names, function descriptions, function return types and function implementation codes;
defining attributes of sub-elements of the function element, wherein the attributes comprise form parameter names, form parameter descriptions, form parameter types, form parameter transmission modes and default values;
and converting the function set into an XML file according to an XML Schema or a DTD standard.
The XML conversion of the function set mainly comprises XML conversion of mathematical functions, character string functions and time functions, and the key technology lies in a description mode of function unification. The attribute of the Function "element contains the name" of the Function, "desc" of the Function, the return data type "return type" of the Function, and the implementation code "body" of the Function. The sub-elements of the "Function" element are the Function Parameters. The "Parameters" element contains the argument name "of the function, the description" desc "of the argument, the data type" of the argument, the argument "byRef" and the default value "initValue" attribute. The XML file generated by the function conversion please refer to fig. 7.
In step S7, the specification defines an object description of the trigger event according to the data characteristics of the script set, and converting the script set including the screen script and the database script into an XML file further includes:
defining attributes of elements in the script set, wherein the attributes comprise a script name, a script description and a foot body;
and converting the script set into an XML file according to an XML Schema or a DTD standard.
The XML conversion of the script set mainly comprises XML conversion of a picture script and a database script, and the key technology lies in object description of a trigger event. The attributes of the Script set "Script" element include the name "of the Script, the description" of the Script, and the definition "body" of the Script. The XML file generated by the script conversion please refer to fig. 8.
In this embodiment, through the research decomposition of the human-computer interface interactive description, a frame set definition XML file, a variable set definition XML file, an IO device driver set definition XML file, a data type set definition XML file, a function set definition XML file, and a script set definition XML file corresponding to the configuration file are prepared. In practical application, the configuration file can be converted into an XML file by adopting a data persistence technology. Data persistence is the general term for converting a data model in memory to a storage model and vice versa. The data model may be any data structure or object model and the storage model may be a relational model, an XML file, or the like.
The method for converting the configuration file into the XML file in the embodiment can be used for cross-platform XML data interaction among multiple application systems, and any application system can generate a DOM tree through extracting the configuration file in a memory, wherein the DOM tree is a document object with a standard interface; JAXP can be adopted to carry out XML Schema analysis on the document objects in the DOM tree, so as to generate XML files and store the XML files in a database; and then transmitting the XML file in the database to another application system through a network, and receiving the XML file and analyzing the XML file into a configuration file by the other application system, so that cross-platform XML data interaction and sharing are realized.
Example two
Referring to fig. 9, the apparatus for converting a configuration file into an XML file, for a human-machine interface software to export an interactive XML file, includes:
the classification module 1 is used for dividing the configuration file into a picture set, a variable set, an IO device driver set, a data type set, a function set and a script set;
the first conversion module 2 is used for standardizing and defining the information description of the graphic elements according to the data characteristics of the picture set and converting the picture set into an XML file;
the second conversion module 3 is used for standardizing and defining information description of variable names, variable sources, variable types and numerical value ranges according to the data characteristics of the variable sets and converting the variable sets into XML files;
the third conversion module 4 is configured to standardize and define information description of heterogeneous devices and communication protocols in the network according to data characteristics of the IO device driver set, and convert the IO device driver set into an XML file;
the fourth conversion module 5 is used for defining the conversion among different data types according to the data characteristics of the data type set in a standard way and converting the data type set into an XML file;
a fifth conversion module 6, configured to define a unified function description mode according to the data characteristics of the function set in a standardized manner, and convert the function set including a mathematical function, a character string function, and a time function into an XML file;
and a sixth conversion module 7, configured to define, according to the data characteristics of the script set, the object description of the trigger event in a standard manner, and convert the script set including the screen script and the database script into an XML file.
The functions and implementation methods of the classification module 1, the first conversion module 2, the second conversion module 3, the third conversion module 4, the fourth conversion module 5, the fifth conversion module 6, and the sixth conversion module 7 are as described in the above embodiment one, and are not described herein again.
EXAMPLE III
The second embodiment of the present invention describes the apparatus for converting the configuration file into the XML file in detail from the perspective of the modular functional entity, and the following describes the apparatus for converting the configuration file into the XML file in detail from the perspective of the hardware processing.
Referring to fig. 10, the apparatus 500 for converting the configuration file into the XML file may have a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 510 (e.g., one or more processors) and a memory 520, and one or more storage media 530 (e.g., one or more mass storage devices) for storing applications 533 or data 532. Memory 520 and storage media 530 may be, among other things, transient or persistent storage. The program stored on the storage medium 530 may include one or more modules (not shown), each of which may include a series of instruction operations in the apparatus 500 for converting a configuration file into an XML file.
Further, the processor 510 may be configured to communicate with the storage medium 530, and execute a series of instruction operations in the storage medium 530 on the apparatus 500 for converting the configuration file into the XML file.
The apparatus 500 for converting a configuration file into an XML file may further include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input/output interfaces 560, and/or one or more operating systems 531, such as Windows Server, Vista, and the like.
Those skilled in the art will appreciate that the device architecture of the configuration file converted into an XML file shown in fig. 10 does not constitute a limitation on the device for converting the configuration file into an XML file, and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components may be used.
The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium, and which may also be a volatile computer-readable storage medium. The computer-readable storage medium has stored therein instructions, which when executed on a computer, cause the computer to perform the steps of the method for converting a configuration file into an XML file according to the first embodiment.
The modules in the second embodiment, if implemented in the form of software functional modules and sold or used as independent products, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be substantially or partially implemented in software, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and devices may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The embodiments of the present invention have been described in detail with reference to the accompanying drawings, but the present invention is not limited to the above embodiments. Even if various changes are made to the present invention, it is still within the scope of the present invention if they fall within the scope of the claims of the present invention and their equivalents.

Claims (10)

1. A method for converting a configuration file into an XML file, which is used for exporting an interactive XML file by human-computer interface software, is characterized in that the method for converting the configuration file into the XML file comprises the following steps:
dividing the configuration file into a picture set, a variable set, an IO device driver set, a data type set, a function set and a script set;
according to the data characteristics of the picture set, the information description of the graphic elements is defined in a standard mode, and the picture set is converted into an XML file;
according to the data characteristics of the variable set, information description of variable names, variable sources, variable types and numerical ranges is defined in a standard mode, and the variable set is converted into an XML file;
according to the data characteristics of the IO device driver set, information description of heterogeneous devices and communication protocols in a network is defined in a standard mode, and the IO device driver set is converted into an XML file;
according to the data characteristics of the data type set, the conversion among different data types is defined in a standard way, and the data type set is converted into an XML file;
according to the data characteristics of the function set, defining a uniform function description mode in a standard mode, and converting the function set comprising a mathematical function, a character string function and a time function into an XML file;
according to the data characteristics of the script set, the object description of the trigger event is defined in a standard mode, and the script set comprising the picture script and the database script is converted into an XML file.
2. The method of claim 1, wherein the information description defining the graphic elements is specified according to the data characteristics of the frame set, and the converting the frame set into the XML file further comprises:
abstracting and packaging the graphic elements in an object-oriented mode to obtain a graphic element assembly;
and configuring attributes and parameters of the primitive components, and constructing the primitive components according to the requirements of TC6_ XML _ V201.xsd which can describe the structure of the document to obtain an XML file which accords with the XML standard.
3. The method of claim 1, wherein the specification defines information description of heterogeneous devices and communication protocols in a network according to data characteristics of the IO device driver set, and the converting the IO device driver set into the XML file further comprises:
defining attributes of elements of an IO device driver set, wherein the attributes comprise a device name, a device description, a communication protocol, a device address and a connection type;
and converting the IO device driver set into an XML file according to an XML Schema or a DTD standard.
4. The method of claim 1, wherein the specification defines a transformation between different data types according to data characteristics of the data type set, and the transforming the data type set into the XML file further comprises:
defining attributes of elements in the data type set, wherein the attributes comprise variable names, variable descriptions, data types, variable initial values, upper value limits and lower value limits;
and converting various data types into XML files in a unified format.
5. The method of claim 1, wherein the specification defines a uniform function description according to the data characteristics of the function set, and the converting the function set including the mathematical function, the string function and the time function into the XML file further comprises:
defining attributes of elements in the function set, wherein the attributes comprise function names, function descriptions, function return types and function implementation codes;
defining attributes of sub-elements of the function element, wherein the attributes comprise form parameter names, form parameter descriptions, form parameter types, form parameter transmission modes and default values;
and converting the function set into an XML file according to an XML Schema or a DTD standard.
6. The method of claim 1, wherein the specification defines an object description of the trigger event according to the data characteristics of the script set, and the converting the script set including the screen script and the database script into the XML file further comprises:
defining attributes of elements in the script set, wherein the attributes comprise a script name, a script description and a foot body;
and converting the script set into an XML file according to an XML Schema or a DTD standard.
7. The method according to any of claims 1 to 6, wherein the method is used for cross-platform XML data interaction between multiple application systems;
any application system extracts a configuration file in a memory and generates a DOM tree, wherein the DOM tree is a document object with a standard interface; performing XML Schema analysis on the document object in the DOM tree by adopting JAXP to generate an XML file, and storing the XML file in a database;
any application system can transmit the XML file in the database to another application system through the network, and the other application system receives the XML file and analyzes the XML file into a configuration file.
8. An apparatus for converting a configuration file into an XML file for a human interface software to export an interactive XML file, comprising:
the classification module is used for dividing the configuration file into a picture set, a variable set, an IO device driver set, a data type set, a function set and a script set;
the first conversion module is used for standardizing and defining the information description of the graphic elements according to the data characteristics of the picture set and converting the picture set into an XML file;
the second conversion module is used for standardizing and defining information description of variable names, variable sources, variable types and numerical value ranges according to the data characteristics of the variable sets and converting the variable sets into XML files;
the third conversion module is used for standardizing and defining information description of heterogeneous equipment and a communication protocol in the network according to the data characteristics of the IO equipment driver set and converting the IO equipment driver set into an XML file;
the fourth conversion module is used for defining the conversion among different data types according to the data characteristics of the data type set in a standard way and converting the data type set into an XML file;
the fifth conversion module is used for defining a uniform function description mode in a standard mode according to the data characteristics of the function set and converting the function set comprising a mathematical function, a character string function and a time function into an XML file;
and the sixth conversion module is used for defining the object description of the trigger event according to the data characteristics of the script set in a standard way and converting the script set comprising the picture script and the database script into an XML file.
9. An apparatus for converting configuration files into XML files, comprising a memory and a processor, wherein the memory stores computer readable instructions, and the processor executes the computer readable instructions to implement the method for converting configuration files into XML files according to any one of claims 1 to 7.
10. A computer-readable medium storing a computer program, wherein the computer program, when executed by one or more processors, implements the method for converting a configuration file into an XML file according to any one of claims 1 to 7.
CN202110394542.1A 2021-04-13 2021-04-13 Method, device and equipment for converting configuration file into XML file and storage medium Pending CN113221511A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110394542.1A CN113221511A (en) 2021-04-13 2021-04-13 Method, device and equipment for converting configuration file into XML file and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110394542.1A CN113221511A (en) 2021-04-13 2021-04-13 Method, device and equipment for converting configuration file into XML file and storage medium

Publications (1)

Publication Number Publication Date
CN113221511A true CN113221511A (en) 2021-08-06

Family

ID=77087228

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110394542.1A Pending CN113221511A (en) 2021-04-13 2021-04-13 Method, device and equipment for converting configuration file into XML file and storage medium

Country Status (1)

Country Link
CN (1) CN113221511A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114509986A (en) * 2022-01-20 2022-05-17 武汉朗宇智能科技有限公司 Cross-platform HMI configuration system and method based on xml file

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101510151A (en) * 2009-03-23 2009-08-19 国电南瑞科技股份有限公司 Synthesis monitoring cross-platform configuration human-machine interface system
CN103064661A (en) * 2011-10-21 2013-04-24 上海宝信软件股份有限公司 Computer monitoring configuration screen extensible makeup language (XML) descriptor system and method
CN103092609A (en) * 2012-12-28 2013-05-08 三一重工股份有限公司 Method and man-machine interaction device for displaying interaction of configuration software and collector data
CN103353898A (en) * 2013-07-24 2013-10-16 成都瑞科电气有限公司 Processing system with system data transformed to XML format of CIM module
CN108089857A (en) * 2017-12-05 2018-05-29 广东雅达电子股份有限公司 A kind of industry web monitors the generation method of the page in real time
CN108681444A (en) * 2018-04-12 2018-10-19 华中科技大学 A kind of Soft- PLC configuration development approach based on XML technology
CN111459501A (en) * 2019-01-22 2020-07-28 上海宝信软件股份有限公司 SVG-based Web configuration picture storage and display system, method and medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101510151A (en) * 2009-03-23 2009-08-19 国电南瑞科技股份有限公司 Synthesis monitoring cross-platform configuration human-machine interface system
CN103064661A (en) * 2011-10-21 2013-04-24 上海宝信软件股份有限公司 Computer monitoring configuration screen extensible makeup language (XML) descriptor system and method
CN103092609A (en) * 2012-12-28 2013-05-08 三一重工股份有限公司 Method and man-machine interaction device for displaying interaction of configuration software and collector data
CN103353898A (en) * 2013-07-24 2013-10-16 成都瑞科电气有限公司 Processing system with system data transformed to XML format of CIM module
CN108089857A (en) * 2017-12-05 2018-05-29 广东雅达电子股份有限公司 A kind of industry web monitors the generation method of the page in real time
CN108681444A (en) * 2018-04-12 2018-10-19 华中科技大学 A kind of Soft- PLC configuration development approach based on XML technology
CN111459501A (en) * 2019-01-22 2020-07-28 上海宝信软件股份有限公司 SVG-based Web configuration picture storage and display system, method and medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114509986A (en) * 2022-01-20 2022-05-17 武汉朗宇智能科技有限公司 Cross-platform HMI configuration system and method based on xml file
CN114509986B (en) * 2022-01-20 2024-04-05 武汉朗宇智能科技有限公司 Cross-platform HMI configuration system and method based on xml file

Similar Documents

Publication Publication Date Title
US7174533B2 (en) Method, system, and program for translating a class schema in a source language to a target language
US8392877B1 (en) System and method of application development using replaceable self-contained components (RSCCS)
AU732374B2 (en) A management interworking unit and a method for producing such a unit
US10949381B2 (en) Reusable transformation mechanism to allow mappings between incompatible data types
Yang et al. Design knowledge modeling and software implementation for building code compliance checking
US8275775B2 (en) Providing web services from business intelligence queries
US6889360B1 (en) Representing IMS transaction definitions as XML documents
US20040261008A1 (en) Modular object serialization architecture
US20020194263A1 (en) Hierarchical constraint resolution for application properties, configuration, and behavior
Kim An XML-based modeling language for the open interchange of decision models
CN112597129A (en) Automatic construction method of OPC UA information model based on structured database
US20030009433A1 (en) Automatic identification of computer program attributes
US7571390B2 (en) System and method for projecting transformations of object trees
CN114117645B (en) Ship overall performance forecasting integrated application system
CN113221511A (en) Method, device and equipment for converting configuration file into XML file and storage medium
US8036857B2 (en) Design modelling
EP2395468A1 (en) Semantic user interface data assembling
Liu et al. Engineering information service infrastructure for ubiquitous computing
Clarke et al. A declarative approach for specifying user-centric communication
CN116610294A (en) Autosar model library construction method based on Modelica language
CN115357229A (en) Digital twin data binding method and system
CN113626016A (en) Front-end and back-end separated reusable component based on Vue + Element UI + Koa2
CN113407652A (en) Space-time data model based on 3DPS
WO2000057300A1 (en) Automatic interface generation for an enterprise resource
Luna Towards a computer aided simulation model engineering (CASME) environment

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
CB03 Change of inventor or designer information

Inventor after: Zhu Liguo

Inventor after: Jiang Jianping

Inventor after: Chen Gen

Inventor after: Qian Yuping

Inventor after: Wang Shengjie

Inventor after: Zhang Changjiang

Inventor after: Qin Fen

Inventor after: Liang Shiwu

Inventor before: Zhu Liguo

Inventor before: Jiang Jianmin

Inventor before: Chen Gen

Inventor before: Qian Yuping

Inventor before: Wang Shengjie

Inventor before: Zhang Changjiang

Inventor before: Qin Fen

Inventor before: Liang Shiwu

CB03 Change of inventor or designer information