CN106126196B - A kind of interface assignment method of the structuring multivariable information frame based on XML - Google Patents

A kind of interface assignment method of the structuring multivariable information frame based on XML Download PDF

Info

Publication number
CN106126196B
CN106126196B CN201511034371.2A CN201511034371A CN106126196B CN 106126196 B CN106126196 B CN 106126196B CN 201511034371 A CN201511034371 A CN 201511034371A CN 106126196 B CN106126196 B CN 106126196B
Authority
CN
China
Prior art keywords
data
node
type
control
value
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.)
Expired - Fee Related
Application number
CN201511034371.2A
Other languages
Chinese (zh)
Other versions
CN106126196A (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.)
63686 Troops Of Pla
Original Assignee
63686 Troops Of Pla
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 63686 Troops Of Pla filed Critical 63686 Troops Of Pla
Priority to CN201511034371.2A priority Critical patent/CN106126196B/en
Publication of CN106126196A publication Critical patent/CN106126196A/en
Application granted granted Critical
Publication of CN106126196B publication Critical patent/CN106126196B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The interface assignment method of the present invention relates to a kind of structuring multivariable information frame based on XML, the described method comprises the following steps: Step 1: carrying out framing to structured message data forms information frame;Step 2: forming the XML file of characterization information frame structure;Step 3: realizing interface assignment by the method for reading XML file.It does not need to be regrouped when information frame changes using method of the invention, and the data processing in later period is not needed to devote a tremendous amount of time to greatly improve work efficiency to modify, reduce working strength yet.

Description

A kind of interface assignment method of the structuring multivariable information frame based on XML
Technical field
The interface assignment method of the present invention relates to a kind of structuring multivariable information frame based on XML.Belong to soft project Technical field.
Background technique
In software engineering technology, information frame is a kind of common data transmission format, and the information frame of multivariable is compiled Method processed is generally defined using structural body, and the assignment of interface control also needs corresponding field defined in acquisition structural body.? Software upgrading, especially information frame variables number or total need to regroup structural body when changing, and related Data processing method, assignment related content of interface control etc. also need to modify, and the workloads such as write, test and debug It is very big.
Certain type shipborne system control and monitor console, monitored object are measuring and controlling equipment, and facility information amount is big, data type is complicated, software Design uses structural body form.After some measuring and controlling equipment function increase, simple change occurs for the information content, in software again Structural body is defined, the functions such as related resolution, interface assignment are also modified, and take about one month ability completion system Joint-trial.
The present invention devises a kind of interface assignment method based on structuring multivariable information frame using XML technology, for solution Certainly this problem provides a kind of practical, easy method.
Summary of the invention
It is changeable the technical problem to be solved by the present invention is to provide a kind of structuring based on XML for the above-mentioned prior art The interface assignment method for measuring information frame, does not need to be regrouped when information frame changes, and for the number in later period It does not need to devote a tremendous amount of time according to processing to greatly improve work efficiency to modify, reduce working strength yet.
The present invention solves the above problems used technical solution are as follows: a kind of structuring multivariable information frame based on XML Interface assignment method, the described method comprises the following steps:
Step 1: carrying out framing to structured message data forms information frame
Information frame is made of control domain and data field, field when control domain includes frame head, data variable number and variable product, number It is arranged by multiple variables according to agreement sequence according to domain, according to data type, 1bit or a few bit will can be expressed as in data Data be combined, the child node as XML file some node is indicated;There to be clear byte to define in data, and The more data of byte are occupied, are indicated as some node;By some user-defined dada types with obvious characteristic, make It is indicated for some node;
Step 2: forming the XML file of characterization information frame structure
(1) with the node of child node
Father node with child node has 4 attribute, respectively description, identification code, data type and data value, description For increasing readability, identification code is for showing that data and node relationships, data type are defined according to digit needed for child node The type of the node, data value are the value after child node data conversion;
Its child node defines 8 attribute, and respectively description, container name, Container Type, control name, control type, data rise Beginning position, data length, data value, the data type of each child node is bit, is determined according to data start bit and data length The position that its fixed positional relationship after father node data switch to binary data types, i.e. data length determine the child node Number;
(2) without the node definition of child node
10 attribute of node definition, respectively description, container name, Container Type, control name, control type, identification code, Data type, data value, maximum value, minimum value, description is for increasing readability, and identification code is for showing that data and node are closed System, data type are defined according to required type (also can customize type), maximum value, minimum value (can be sky) characterization number The upper and lower bound of type data value;
Step 3: realizing interface assignment by the method for reading XML file
By the XML file of traversal step three, the control name attribute of each node or child node is read, according to data type Attribute is completed type to data value attribute and is converted, data value needed for obtaining interface display control, then the interface as defined in XML It is searched in container according to control type, if control name is identical with control type, carries out assignment according to control type, then Preparation is searched next time, until running through the last one node of XML file.
Preferably, the information frame control domain in the step 1 includes code field, and the data field in step 2 is according to big It is small, one or more data fields can be divided into, distinguished by the code field of control domain.
Compared with the prior art, the advantages of the present invention are as follows:
(1) data frame design of the present invention suitable for the transmission of network software data, is convenient for data interaction and later maintenance.
(2) present invention data frame design suitable for the transmission of industrial-controlled general line data simultaneously, it is simple with design, it is real Now convenient advantage.
(3) present invention can be designed suitable for the data frame of self-defining data structure simultaneously, be had the advantages that flexible, concise.
(4) present invention takes into account the design problem for considering data frame check.
Detailed description of the invention
Fig. 1 is a kind of flow chart of the interface assignment method of the structuring multivariable information frame based on XML of the present invention.
Fig. 2 is that XML file is write in a kind of interface assignment method of the structuring multivariable information frame based on XML of the present invention Format chart.
Fig. 3 is information frame structure in a kind of interface assignment method of the structuring multivariable information frame based on XML of the present invention Figure.
Fig. 4 is XML file structure in a kind of interface assignment method of the structuring multivariable information frame based on XML of the present invention Change definition figure.
Fig. 5 is XML text defined in a kind of interface assignment method of the structuring multivariable information frame based on XML of the present invention Part.
Fig. 6 is a kind of interface assignment method median surface control wheel of the structuring multivariable information frame based on XML of the present invention Ask the flow chart of assignment.
Fig. 7 is to read XML file in a kind of interface assignment method of the structuring multivariable information frame based on XML of the present invention Interface assignment graph.
Specific embodiment
The present invention will be described in further detail below with reference to the embodiments of the drawings.
The interface assignment method of the present invention relates to a kind of structuring multivariable information frame based on XML, as shown in Figure 1, tool Body process are as follows:
The first step carries out framing formation information frame to structured message data
Information frame is made of control domain and data field, and control domain includes frame head (1byte), data variable number (4byte), becomes (00 divides 00 second number of seconds, 4byte when the opposite same day 00) when amount product, (corresponding more data fields, mark each data field to coding Know, be equivalent to the name of each structural body in high-level language, 2byte).
Data field is arranged (nbyte) according to agreement sequence by multiple variables, as shown in Figure 2.It, will according to data type The data that 1bit or a few bit can be expressed as in data are combined, the child node progress table as some node of XML file Show;There is clear byte to define int in data (uint), double, float, char etc., and occupy the more data of byte, It is indicated as some node;By some user-defined dada types with obvious characteristic, the Chinese of 60 bytes is such as defined Description, is indicated as some node.According to data field size, data field can be divided into one or more data fields (also Correspond to one or more XML files), it is distinguished by " coding " field of control domain, that is, " coding " and XML file It is associated with.
Second step, the XML file for forming characterization information frame structure
The present invention is retouched dependent on the systematicness of XML (eXtensible Markup Language, expansible markup language) Predicate speech, examples of language such as Fig. 2.Wherein, A is XML prelude, and version indicates version number, encoding presentation code type;B It include element and attribute for XML tag, attrs is root element, and devType, edition are attribute;C is XML annotation, is used for Explain the attribute of definition;D is daughter element (becoming node here), also includes element and attribute;E is the daughter element in daughter element (becoming child node here) also includes element and attribute.Either root element or daughter element, closed loop necessary for XML definition, Such as definition<attrs>root element, it is necessary to define</attrs>terminate.
The inside definition of single structure body includes two parts: field and type (or nested structure body), structural body (superstructure Body) can nested multiple single structure bodies, the overall structure of XML file holds in superstructure body and corresponds to according to structural body formal definition The node of XML file, nested structure body is interior to hold corresponding child node.To realize interface assignment, node and child node attribute must be wrapped Containing type and value.
Interface control corresponding for structured message generally comprises text box, choice box, instruction class control and horn of plenty Various container class control used in interface must include container control type and title, various displays control in XML file attribute The type and title of system.
XML file structure
XML file structure is as shown in Figure 4.
(1) father node with child node defines
Father node with child node has 4 attribute, respectively description, identification code, data type and data value, description For increasing readability, identification code is for showing that data and node relationships, data type are defined according to digit needed for child node The type of the node, data value are the value after child node data conversion;
Its child node defines 8 attribute, and respectively description, container name, Container Type, control name, control type, data rise Beginning position, data length, data value, the data type of each child node is bit, is determined according to data start bit and data length The position that its fixed positional relationship after father node data switch to binary data types, i.e. data length determine the child node Number.
(2) without the node definition of child node
10 attribute of node definition, respectively description, container name, Container Type, control name, control type, identification code, Data type, data value, maximum value, minimum value, description is for increasing readability, and identification code is for showing that data and node are closed System, data type are defined according to required type (also can customize type), maximum value, minimum value (can be sky) characterization number The upper and lower bound of type data value.
Third step realizes interface assignment by the method for reading XML file
Interface assignment is a kind of low-frequency method for refreshing, by traversing XML file, reads each node or child node Control name attribute completes type conversion, number needed for obtaining interface display control to data value attribute according to data type attribute According to value, such as the selectitemindex value of the character of text box, combobox;It (can also in the interface chamber as defined in XML Nothing), it is searched according to control type, if control name is identical with control type, carries out assignment according to control type, then quasi- It is standby to search next time, until running through the last one node of XML file.
Example:
Example is designed as with a certain C# programmed environment lower network information frame structure below, shows the present invention answering in practice Use process.According to the principle of inventive step one, successively realize: second step, the XML file for writing characterization information frame structure,;Third Step realizes interface assignment using control polling method.
Second step, the XML file for writing characterize data frame structure.
According to data frame compilation principles, XML file is write, as shown in Figure 5.First frame head node, is defined as follows attribute: Id, desc, dataType, Value, Value are about set to 40;Second variable number node, defined attribute head node at same frame, Value Corresponding data variable number;Third product when node, defined attribute head node at same frame, Value corresponding data sending instant relative to Product seconds value when the same day 0;4th coding nodes, defined attribute head node at same frame, Value correspond to encoded radio;It is number after 5th According to node, being divided into has child node and without sub-node type, s.m.p node definition attribute are as follows: desc, ConName, ConType, Id, IdType, code, dataType, Value, Max, Min, have child node defined attribute be respectively as follows: desc, code, dataType, Datavalue (top mode) and desc, ConName, ConType, Id, IdType, Startpos, length, Value are (interior Portion's node).
Third step realizes interface assignment using control polling method.
The class libraries supported XML technology is provided in C#, can facilitate the read-write realized to XML file, by reading XML File corresponding node attribute value can realize that the automatic assignment of interface control, software flow are as shown in Figure 6.Program passes through XmlDocument, XmlElement attribute of System.Xml class libraries, timing read specified XML file from the 4th back end Data afterwards: extracting the information such as id attribute value, the Value attribute value of corresponding node, after data check is qualified, traverses interface chamber Lookup names are the control of id attribute value, and assignment is corresponded to if finding;Circulation reads next node data, and carries out processing tax Value, until the reading of all back end finishes, program runnable interface is as shown in Figure 7.
In addition to the implementation, all to use equivalent transformation or equivalent replacement the invention also includes there is an other embodiments The technical solution that mode is formed should all be fallen within the scope of the hereto appended claims.

Claims (1)

1. a kind of interface assignment method of the structuring multivariable information frame based on XML, it is characterised in that: the method includes with Lower step:
Step 1: carrying out framing to structured message data forms information frame
Information frame is made of control domain and data field, field when control domain includes frame head, data variable number and variable product, data field It is arranged by multiple variables according to agreement sequence, according to data type, the number of 1bit or a few bit will can be expressed as in data According to being combined, the child node as XML file some node is indicated;There to be clear byte to define in data, and occupies The more data of byte, are indicated as some node;By some user-defined dada types with obvious characteristic, as certain A node is indicated;
Step 2: forming the XML file of characterization information frame structure
(1) with the node of child node
4 attribute of node definition with child node, respectively description, identification code, data type, data value are described for increasing Add readability, for identification code for showing that data and node relationships, data type are defined as Long, data value is son node number according to whole Value after conjunction;
Its child node defines 8 attribute, respectively description, the starting of container name, Container Type, control name, control type, data Position, data length, data value, the data type of each child node are bit, are determined according to data start bit and data length The digit that its positional relationship after father node data switch to binary data types, i.e. data length determine the child node;
(2) without the node definition of child node
10 attribute of node definition without child node, respectively description, container name, Container Type, control name, control type, Identification code, data type, data value, maximum value, minimum value, description for increasing readability, identification code for show data with Node relationships, data type are defined according to required type, maximum value, minimum value characterization digital data value the upper limit and under Limit;
Step 3: realizing interface assignment by the method for reading XML file
By the XML file of traversal step three, the control name attribute of each node or child node is read, according to data type attribute It completes type to data value attribute to convert, data value needed for obtaining interface display control, then the interface chamber as defined in XML In searched according to control type, if control name is identical with control type, carries out assignment according to control type, then prepare It searches next time, until running through the last one node of XML file.
CN201511034371.2A 2015-12-30 2015-12-30 A kind of interface assignment method of the structuring multivariable information frame based on XML Expired - Fee Related CN106126196B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201511034371.2A CN106126196B (en) 2015-12-30 2015-12-30 A kind of interface assignment method of the structuring multivariable information frame based on XML

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201511034371.2A CN106126196B (en) 2015-12-30 2015-12-30 A kind of interface assignment method of the structuring multivariable information frame based on XML

Publications (2)

Publication Number Publication Date
CN106126196A CN106126196A (en) 2016-11-16
CN106126196B true CN106126196B (en) 2019-02-12

Family

ID=57471607

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201511034371.2A Expired - Fee Related CN106126196B (en) 2015-12-30 2015-12-30 A kind of interface assignment method of the structuring multivariable information frame based on XML

Country Status (1)

Country Link
CN (1) CN106126196B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109460231B (en) * 2018-09-25 2022-02-22 北京通广龙电子科技有限公司 Upper computer software implementation method based on XML
CN111291242A (en) * 2018-12-07 2020-06-16 贵州航天风华精密设备有限公司 Universal display interpretation method and device for 16-system data file

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100077320A1 (en) * 2008-09-19 2010-03-25 United States Government As Represented By The Secretary Of The Navy SGML/XML to HTML conversion system and method for frame-based viewer
WO2010133024A1 (en) * 2009-05-19 2010-11-25 中山大学 Method for optimizing development of interactive channel of digital tv in a digital family
CN101938477A (en) * 2010-08-31 2011-01-05 中山大学 Method for implementing XML data information exchange
CN103428835A (en) * 2013-08-30 2013-12-04 西安电子科技大学 Method for dynamically opening and closing site relay function in wireless local area network
CN104239254A (en) * 2014-09-04 2014-12-24 西南技术物理研究所 Serial asynchronous communication data transmission method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100077320A1 (en) * 2008-09-19 2010-03-25 United States Government As Represented By The Secretary Of The Navy SGML/XML to HTML conversion system and method for frame-based viewer
WO2010133024A1 (en) * 2009-05-19 2010-11-25 中山大学 Method for optimizing development of interactive channel of digital tv in a digital family
CN101938477A (en) * 2010-08-31 2011-01-05 中山大学 Method for implementing XML data information exchange
CN103428835A (en) * 2013-08-30 2013-12-04 西安电子科技大学 Method for dynamically opening and closing site relay function in wireless local area network
CN104239254A (en) * 2014-09-04 2014-12-24 西南技术物理研究所 Serial asynchronous communication data transmission method

Also Published As

Publication number Publication date
CN106126196A (en) 2016-11-16

Similar Documents

Publication Publication Date Title
CN106528165B (en) Code generating method and code generating system
CN105335412B (en) For data conversion, the method and apparatus of Data Migration
CN108399130A (en) Automatically generate the method, apparatus, equipment and readable storage medium storing program for executing of test cases
CN102663103B (en) Configurable method for automatically generating database and accessing data
CN110825364B (en) Application template configuration method based on tree structure
CN102542002A (en) Satellite telemetry data treatment system and realization method thereof
CN102521120A (en) Software automation test system and method
CN103955371B (en) Method is designed and developed to the general clas s library that serial ports instrument carries out data acquisition
CN110442595B (en) Method and device for constructing universal SQL report data set
CN107391153A (en) A kind of code generating method and device based on Spring Yu MyBatis framework integrations
CN108664546B (en) XML data structure conversion method and device
CN106126196B (en) A kind of interface assignment method of the structuring multivariable information frame based on XML
CN108804300A (en) Automated testing method and system
CN103823793A (en) Realizing method for dynamic report based on Excel template
CN109032577A (en) A kind of data simulation method
CN105320513A (en) I/O (input/output) method suitable for any SEG-Y seismic data
CN103309849B (en) A kind of docx document creation based on OpenXML and amending method
CN106502680B (en) A method of pel extension is carried out by visualization interface
CN103905233B (en) Realize method, system and the access network device of analog sensor plug and play
CN111597801A (en) Text automatic structuring method and system based on natural language processing
CN108536660A (en) A kind of generation method and terminal of self-defined report
CN112199626A (en) Dynamic form generation method based on DSL layout engine
CN115826492A (en) Universal PLC data processing method and device
CN104992379A (en) Dynamic text exchange format management method of big data of power industry
CN100579032C (en) Performance data automated management system and method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20190212

Termination date: 20191230

CF01 Termination of patent right due to non-payment of annual fee