CN106126196A - A kind of interface assignment method of structuring multivariate information frame based on XML - Google Patents
A kind of interface assignment method of structuring multivariate information frame based on XML Download PDFInfo
- Publication number
- CN106126196A CN106126196A CN201511034371.2A CN201511034371A CN106126196A CN 106126196 A CN106126196 A CN 106126196A CN 201511034371 A CN201511034371 A CN 201511034371A CN 106126196 A CN106126196 A CN 106126196A
- Authority
- CN
- China
- Prior art keywords
- data
- node
- type
- information frame
- xml
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/38—Creation or generation of source code for implementing user interfaces
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/31—Programming 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 present invention relates to the interface assignment method of a kind of structuring multivariate information frame based on XML, said method comprising the steps of: step one, structured message data are carried out framing formed information frame;Step 2, the XML file of formation characterization information frame structure;Step 3, by read XML file method realize interface assignment.The method using the present invention is made without when information frame changes regrouping, and the data process for the later stage is revised also without devoting a tremendous amount of time, and substantially increases work efficiency, reduces working strength.
Description
Technical field
The present invention relates to the interface assignment method of a kind of structuring multivariate information frame based on XML.Belong to soft project
Technical field.
Background technology
In software engineering technology, information frame is a kind of conventional data transmission format, compiles for multivariable information frame
Method processed typically uses structure to be defined, and the assignment of interface control also needs to gather the corresponding field defined in structure.?
Need structure is regrouped during software upgrading, particularly information frame variables number or total change, and relevant
Data processing method, the assignment related content etc. of interface control also need to modify, and it writes, test and the workload such as debugging
The biggest.
Certain type shipborne system control and monitor console, monitored object is measuring and controlling equipment, and facility information amount is big, data type is complicated, software
It is designed with structure bodily form formula.After certain measuring and controlling equipment function increases, information content generation simple change, in software again
Defining structure, the function such as related resolution, interface assignment has been also carried out amendment, takes about one month just completion system
Joint-trial.
The present invention utilizes XML technology to devise a kind of interface assignment method based on structuring multivariate information frame,
A kind of practicality, easy method is provided for solving this problem.
Summary of the invention
The technical problem to be solved is to provide a kind of structuring based on XML changeable for above-mentioned prior art
The interface assignment method of amount information frame, is made without when information frame changes regrouping, and for the number in later stage
Revise also without devoting a tremendous amount of time according to processing, substantially increase work efficiency, reduce working strength.
The present invention solves the technical scheme that the problems referred to above are used: a kind of structuring multivariate information frame based on XML
Interface assignment method, said method comprising the steps of:
Step one, structured message data are carried out framing formed information frame
Information frame, by controlling territory and data field forms, controls territory and includes field when frame head, data variable number and variable amass, number
Arranged according to about definite sequence by multiple variablees according to territory, according to data type, data will can be expressed as 1bit or a few bit
Data be combined, the child node as certain node of XML file is indicated;Data will there is clear and definite byte define, and
Take the data that byte is more, be indicated as certain node;Some are had the user-defined dada type of obvious characteristic, makees
It is indicated for certain node;
Step 2, the XML file of formation characterization information frame structure
(1) there is the node of child node
The father node with child node has 4 attribute, is respectively description, identification code, data type and data value, describes
For increasing readability, identification code is used for showing data and node relationships, and data type defines according to figure place needed for child node
The type of this node, data value is that son node number is according to the value after 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, comes certainly according to data start bit and data length
Fixed its position relationship after father node data transfer binary data types to, i.e. data length determine the position of this child node
Number;
(2) without the node definition of child node
This node definition 10 attribute, be respectively description, container name, Container Type, control name, control type, identification code,
Data type, data value, maximum, minima, describe and be used for increasing readability, and identification code is used for showing that data are closed with node
System, data type is defined according to desirable type (also can customize type), and maximum, minima (can be empty) characterize numeral
The upper and lower bound of type data value;
Step 3, by read XML file method realize interface assignment
By the XML file of traversal step three, read the control name attribute of each node or child node, according to data type
Attribute completes type conversion to data value attribute, obtains the data value needed for interface display control, the interface then specified at XML
Container makes a look up according to control type, if control name is identical with control type, then carries out assignment according to control type, then
Prepare to search, until running through last node of XML file next time.
Preferably, the information frame in described step one controls territory and includes code field, and the data field in step 2 is according to big
Little, one or more data field can be divided into, make a distinction by controlling the code field in territory.
Compared with prior art, it is an advantage of the current invention that:
(1) present invention Frame design be applicable to network software data are transmitted, it is simple to data interaction and later maintenance.
(2) the Frame design during the present invention is simultaneously suitable for the transmission of industrial-controlled general line data, has design simple, real
Now convenient advantage.
(3) present invention can be simultaneously suitable for the Frame design of self-defining data structure, has flexible, simple and clear advantage.
(4) present invention takes into account the design problem considering Frame verification.
Accompanying drawing explanation
Fig. 1 is the flow chart of the interface assignment method of a kind of structuring multivariate information frame based on XML of the present invention.
Fig. 2 be a kind of structuring multivariate information frame based on XML of the present invention interface assignment method in XML file write
Format chart.
Fig. 3 be a kind of structuring multivariate information frame based on XML of the present invention interface assignment method in information frame structure
Figure.
Fig. 4 be a kind of structuring multivariate information frame based on XML of the present invention interface assignment method in XML file structure
Change definition figure.
Fig. 5 is XML literary composition defined in the interface assignment method of a kind of structuring multivariate information frame based on XML of the present invention
Part.
Fig. 6 is assignment method median surface, the interface control wheel of a kind of structuring multivariate information frame based on XML of the present invention
Ask the flow chart of assignment.
Fig. 7 be a kind of structuring multivariate information frame based on XML of the present invention interface assignment method in read XML file
Interface assignment graph.
Detailed description of the invention
Below in conjunction with accompanying drawing embodiment, the present invention is described in further detail.
The present invention relates to the interface assignment method of a kind of structuring multivariate information frame based on XML, as it is shown in figure 1, tool
Body process is:
The first step, structured message data are carried out framing formed information frame
Information frame, by controlling territory and data field forms, controls territory and includes frame head (1byte), data variable number (4byte), becomes
Measure (00 point of number of seconds of 00 second, 4byte during the relative same day 00) when amassing, (corresponding many data fields, mark coding to each data field
Know, be equivalent to the name of each structure, 2byte in high-level language).
Data field is carried out arranging (nbyte), as shown in Figure 2 according to about definite sequence by multiple variablees.According to data type, will
The data that can be expressed as 1bit or a few bit in data are combined, and the child node as certain node of XML file carries out table
Show;Int in data (uint), double, float, char etc. there are is clear and definite byte to define, and take the data that byte is more,
It is indicated as certain node;Some are had the user-defined dada type of obvious characteristic, as defined the Chinese of 60 bytes
Describe, be indicated as certain node.According to data field size, data field (the most just can be divided into one or more data field
Corresponding one or more XML file), made a distinction by " coding " field controlling territory, namely " encode " and XML file
Associated.
Second step, the XML file of formation characterization information frame structure
The present invention depends on the systematicness of XML (eXtensible Markup Language, expansible markup language) and retouches
Predicate is sayed, examples of language such as Fig. 2.Wherein, A is XML prelude, and version represents version number, encoding presentation code type;B
For XML tag, comprising element and attribute, 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 definition</attrs>terminate.
The inside definition of single structure body comprises two parts;Field and type (or nested structure body), structure (superstructure
Body) can nested multiple single structure bodies, the population structure of XML file according to structure formal definition, holds correspondence in superstructure body
The node of XML file, holds corresponding child node in nested structure body.For realizing interface assignment, node and child node attribute must wrap
Containing type and value.
For the interface control that structured message is corresponding, generally comprise text box, choice box, instruction class control and horn of plenty
Various container class control used by interface, must comprise container control type and title, various display control in XML file attribute
The type of system and title.
XML file structure
XML file structure is as shown in Figure 4.
(1) there is the node definition of child node
The father node with child node has 4 attribute, is respectively description, identification code, data type and data value, describes
For increasing readability, identification code is used for showing data and node relationships, and data type defines according to figure place needed for child node
The type of this node, data value is that son node number is according to the value after 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, comes certainly according to data start bit and data length
Fixed its position relationship after father node data transfer binary data types to, i.e. data length determine the position of this child node
Number.
(2) without the node definition of child node
This node definition 10 attribute, be respectively description, container name, Container Type, control name, control type, identification code,
Data type, data value, maximum, minima, describe and be used for increasing readability, and identification code is used for showing that data are closed with node
System, data type is defined according to desirable type (also can customize type), and maximum, minima (can be empty) characterize numeral
The upper and lower bound of type data value.
3rd step, realizes interface assignment by the method reading XML file
Interface assignment is a kind of low-frequency method for refreshing, by traversal XML file, reads each node or child node
Control name attribute, completes type conversion according to data type attribute to data value attribute, obtains the number needed for interface display control
Character, the selectitemindex value of combobox according to value, such as text box;The interface chamber that XML specifies (also may be used
Nothing), make a look up according to control type, if control name is identical with control type, then carry out assignment according to control type, more accurate
For searching next time, until running through last node of XML file.
Example:
Below as a example by a certain C# programmed environment lower network information frame structure design, show the present invention in practice should
Use process.According to the principle of inventive step one, realize successively: second step, write the XML file of characterization information frame structure,;3rd
Step, uses control polling method to realize interface assignment.
Second step, write characterize data frame structure XML file.
According to Frame compilation principles, write XML file, as shown in Figure 5.First frame head node, is defined as follows attribute:
Id, desc, dataType, Value, Value is about set to 40;Second variable number node, defined attribute head node at same frame, Value
Corresponding data variable number;Node during SANJI, defined attribute head node at same frame, Value corresponding data delivery time relative to
Value of long-pending second during the same day 0;4th coding nodes, defined attribute head node at same frame, Value correspondence encoded radio;For number after 5th
According to node, being divided into and have child node and without sub-node type, loss of fecundity node definition attribute is: 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).
3rd step, use control polling method realize interface assignment.
In C#, provide the class libraries that XML technology is supported, the read-write realized XML file can be facilitated, by reading XML
File corresponding node property value just can realize the automatic assignment of interface control, and its software flow is as shown in Figure 6.Program is passed through
XmlDocument, XmlElement attribute of System.Xml class libraries, timing is read and is specified XML file from the 4th back end
After data: extract the information such as the id property value of corresponding node, Value property value, after data check is qualified, travel through interface chamber
Lookup names is the control of id property value, as found then corresponding assignment;Next node data are read in circulation, and carry out processing tax
Value, until all back end read complete, program runnable interface is as shown in Figure 7.
In addition to the implementation, present invention additionally comprises other embodiments, all employing equivalents or equivalence to replace
The technical scheme that mode is formed, all should fall within the scope of the hereto appended claims.
Claims (2)
1. the interface assignment method of a structuring multivariate information frame based on XML, it is characterised in that: described method include with
Lower step:
Step one, structured message data are carried out framing formed information frame
Information frame, by controlling territory and data field forms, controls territory and includes field when frame head, data variable number and variable amass, data field
Arranged according to about definite sequence by multiple variablees, according to data type, data will can be expressed as the number of 1bit or a few bit
According to being combined, the child node as certain node of XML file is indicated;Data will there is clear and definite byte define, and take
The data that byte is more, are indicated as certain node;Some are had the user-defined dada type of obvious characteristic, as certain
Individual node is indicated;
Step 2, the XML file of formation characterization information frame structure
(1) there is the node of child node
The father node with child node defines 4 attribute, is respectively description, identification code, data type, data value, and description is used for
Increasing readability, identification code is used for showing data and node relationships, and data type is defined as Long, and data value is son node number evidence
Value after integration.
Its child node defines 8 attribute, and respectively description, container name, Container Type, control name, control type, data initiate
Position, data length, data value, the data type of each child node is bit, determines according to data start bit and data length
Its position relationship after father node data transfer binary data types to, i.e. data length determine the figure place of this child node;
(2) without the node definition of child node
This node definition 10 attribute, is respectively description, container name, Container Type, control name, control type, identification code, data
Type, data value, maximum, minima, describe and be used for increasing readability, and identification code is used for showing data and node relationships, number
Being defined according to desirable type (also can customize type) according to type, maximum, minima (can be empty) characterize numeric type number
Upper and lower bound according to value;
Step 3, by read XML file method realize interface assignment
By the XML file of traversal step three, read the control name attribute of each node or child node, according to data type attribute
Data value attribute is completed type conversion, obtains the data value needed for interface display control, the interface chamber then specified at XML
In make a look up according to control type, if control name is identical with control type, then carries out assignment according to control type, then prepare
Search, until running through last node of XML file next time.
The interface assignment method of a kind of structuring multivariate information frame based on XML the most according to claim 1, its feature
It is: the information frame in described step one controls territory and includes code field, and the data field in step 2, according to size, can be divided into
One or more data fields, make a distinction by controlling the code field in territory.
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 true CN106126196A (en) | 2016-11-16 |
CN106126196B 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) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109460231A (en) * | 2018-09-25 | 2019-03-12 | 北京通广龙电子科技有限公司 | 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)
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 |
-
2015
- 2015-12-30 CN CN201511034371.2A patent/CN106126196B/en not_active Expired - Fee Related
Patent Citations (5)
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 |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109460231A (en) * | 2018-09-25 | 2019-03-12 | 北京通广龙电子科技有限公司 | Upper computer software implementation method based on XML |
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 |
Also Published As
Publication number | Publication date |
---|---|
CN106126196B (en) | 2019-02-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106528129B (en) | A kind of Web application interface generation system and method | |
CN102915242B (en) | A kind of method utilizing graphical operation code to programme | |
CN107273117B (en) | Programming-friendly agile code automatic generation system | |
CN106371825A (en) | Dynamic form generation method and apparatus for mobile end application interface | |
US7698694B2 (en) | Methods and systems for transforming an AND/OR command tree into a command data model | |
US7779398B2 (en) | Methods and systems for extracting information from computer code | |
CN108121542B (en) | MyBatis-based SQL statement configuration method and system | |
US7784036B2 (en) | Methods and systems for transforming a parse graph into an and/or command tree | |
CN107291450A (en) | A kind of quick code automatic generation method for programming friendly | |
CN102542002A (en) | Satellite telemetry data treatment system and realization method thereof | |
CN105242597B (en) | A kind of automatic generation method of embedded controller Debugging interface | |
CN105335412A (en) | Method and device for data conversion and data migration | |
CN102236709B (en) | Flex-based monitoring page display method and system | |
CN102339314A (en) | Cross-terminal data form description and presentation method based on extensive makeup language (XML) | |
CN110442595B (en) | Method and device for constructing universal SQL report data set | |
CN104407863A (en) | Abstract control model programming device and method | |
CN109032577A (en) | A kind of data simulation method | |
CN105117215A (en) | Development method and device of automobile function | |
CN108664546B (en) | XML data structure conversion method and device | |
CN106250134B (en) | The code automatic generation method of single language | |
Drath | AutomationML: the industrial cookbook | |
CN106126196A (en) | A kind of interface assignment method of structuring multivariate information frame based on XML | |
CN104951565B (en) | XM (extensible messaging client) L (extensible markup language) configuration maintenance method and system based on memory database | |
CN103186582A (en) | Device description file-based data analysis method | |
CN107797805A (en) | A kind of code wrap method, apparatus and computer-readable recording medium |
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 |