CN110830466B - Method and device for framing DL/T645 protocol message based on XML - Google Patents

Method and device for framing DL/T645 protocol message based on XML Download PDF

Info

Publication number
CN110830466B
CN110830466B CN201911064856.4A CN201911064856A CN110830466B CN 110830466 B CN110830466 B CN 110830466B CN 201911064856 A CN201911064856 A CN 201911064856A CN 110830466 B CN110830466 B CN 110830466B
Authority
CN
China
Prior art keywords
frame
message
field
node
array
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911064856.4A
Other languages
Chinese (zh)
Other versions
CN110830466A (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.)
Electric Power Research Institute of Yunnan Power Grid Co Ltd
Original Assignee
Electric Power Research Institute of Yunnan Power Grid 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 Electric Power Research Institute of Yunnan Power Grid Co Ltd filed Critical Electric Power Research Institute of Yunnan Power Grid Co Ltd
Priority to CN201911064856.4A priority Critical patent/CN110830466B/en
Publication of CN110830466A publication Critical patent/CN110830466A/en
Application granted granted Critical
Publication of CN110830466B publication Critical patent/CN110830466B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/03Protocol definition or specification 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/26Special purpose or proprietary protocols or architectures

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Communication Control (AREA)

Abstract

The application provides a method and a device for framing a DL/T645 protocol message based on XML. The method comprises the following steps: after receiving a message sent by a remote end, reading an XML document of the message, and determining structural information of the message according to the XML document of the message; analyzing frame field nodes in the frame message nodes according to the structural information of the message to obtain attribute values of the frame field nodes; and then creating a character array, assigning values to the character array according to the attribute values of the frame field nodes to form a target message, and sending the target message to a destination address. Therefore, no matter whether the DL/T645 protocol message is self-defined by a manufacturer or not, the DL/T645 protocol message can be framed, so that the structure of the DL/T645 protocol message is uniformly described, and the deviation in understanding partial content of the DL/T645 protocol is avoided.

Description

Method and device for framing DL/T645 protocol message based on XML
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a method and an apparatus for framing a DL/T645 protocol packet based on XML.
Background
The communication protocol of the multifunctional electric energy meter with the electric power industry standard DL/T645 is a communication protocol for unifying and standardizing the data exchange between the multifunctional electric energy meter and the data acquisition terminal equipment, so that electric energy meter manufacturers and power consumption information acquisition terminal manufacturers can perform information interaction with unified standards, thereby avoiding the repeated investment of equipment, simplifying the work flow of power consumption information acquisition of an electric power department, and accelerating the marketing modernization and the measurement standard standardization construction of the electric power department.
After the communication protocol of the DL/T645 electric energy meter is promulgated, most electric energy meters contain the DL/T645 protocol, but part of electric energy meters only contain custom protocols of manufacturers, and the understanding of part of contents of the DL/T645 protocol is prone to deviation. Therefore, it is necessary to describe the structure of the DL/T645 protocol packet uniformly, which requires framing the DL/T645 protocol packet.
Disclosure of Invention
The application provides a method and a device for framing a DL/T645 protocol message based on XML, which can be used for framing a self-defined DL/T645 protocol message.
In a first aspect, an embodiment of the present application provides a method for framing a DL/T645 protocol packet based on XML, where the method includes:
after receiving a message sent by a remote end, reading an XML document of the message;
determining the structure information of the message according to the XML document of the message;
analyzing frame field nodes in frame message nodes according to the structural information of the message to obtain attribute values of the frame field nodes;
creating a character array;
according to the attribute value of the frame field node, carrying out assignment on the character array to form a target message;
and sending the target message to a destination address.
Optionally, the structure information of the packet includes a protocol name, a protocol uplink and downlink identifier, a number of frame formats, and structure information of a plurality of frame format packet nodes of the packet; the number of the frame message nodes is consistent with the number of the frame formats.
Optionally, the structure information of the frame packet node includes a value of a frame type identifier node, a value of a byte number of a frame node, and structure information of a frame field.
Optionally, the structure information of the frame field includes attribute information of a plurality of fields.
Optionally, the attribute information of the field includes at least one of a position of the frame sequence in which the field is located, a length of bytes occupied by the field, a field name, a number of types of field functions, a field code, and a meaning of the field code.
Optionally, before analyzing the frame field node in the frame packet node according to the structure information of the packet and obtaining the attribute value of the frame field node, the method further includes:
creating an array of a plurality of frame types; the number of the array of the frame type is consistent with the number of the frame formats, and the array of the frame type is used for storing the structural information of the frame message node.
Optionally, analyzing a frame field node in the frame packet node according to the structure information of the packet to obtain an attribute value of the frame field node, including:
for a first frame message node, selecting an array of a target frame type from the arrays of a plurality of frame types, and assigning the value of the frame type identification node and the value of the frame byte number node to the array of the target frame type; the first frame message node is any one of the plurality of frame message nodes;
creating a plurality of variable arrays under the array of the target frame type; the number of the variable arrays is consistent with that of the fields, and the variable arrays are used for storing attribute information of the fields;
aiming at a first field, selecting a target variable array from a plurality of variable arrays, and assigning the position of a frame sequence where the field is located, the length of bytes occupied by the field, the field name, the field function type number, the field code and the meaning of the field code to the target variable array; the first field is any one of the plurality of fields;
and determining the attribute value of the frame field node according to the array of the assigned target frame type and the array of the assigned target variable.
Optionally, the creating a character array includes:
selecting a frame message node to be framed;
selecting a target assigned frame type array corresponding to the frame message node to be framed from the multiple assigned frame type arrays;
and creating a character array according to the value of the frame byte number node in the array of the frame type after the target assignment.
Optionally, the assigning the character array according to the attribute value of the frame field node to form a target packet includes:
selecting a field to be framed from the frame message node to be framed;
selecting a target assigned variable array corresponding to the field of the frame to be framed from the assigned variable data;
and assigning the character array according to the attribute information in the variable array after the target assignment to form a target message.
Optionally, before forming the target packet, the method further includes:
and converting the assigned character array into a byte array.
In a second aspect, an embodiment of the present application provides an apparatus for framing a DL/T645 protocol packet based on XML, where the apparatus includes:
the receiving unit is used for receiving a message sent by a far end;
the reading unit is used for reading the XML document of the message;
the processing unit is used for determining the structural information of the frame message node according to the XML document of the message; analyzing frame field nodes in the frame message nodes according to the structural information of the frame message nodes to obtain attribute values of the frame field nodes;
a creating unit for creating a character array;
the processing unit is also used for assigning the character array according to the attribute value of the frame field node to form a target message;
and the sending unit is used for sending the target message to a destination address.
Optionally, the structure information of the packet includes a protocol name, a protocol uplink and downlink identifier, a number of frame formats, and structure information of a plurality of frame format packet nodes of the packet; the number of the frame message nodes is consistent with the number of the frame formats.
Optionally, the structure information of the frame packet node includes a value of a frame type identifier node, a value of a byte number of a frame node, and structure information of a frame field.
Optionally, the structure information of the frame field includes attribute information of a plurality of fields.
Optionally, the attribute information of the field includes at least one of a position of the frame sequence in which the field is located, a length of bytes occupied by the field, a field name, a number of types of field functions, a field code, and a meaning of the field code.
Optionally, the processing unit is further configured to:
creating an array of a plurality of frame types; the number of the array of the frame type is consistent with the number of the frame formats, and the array of the frame type is used for storing the structural information of the frame message node.
Optionally, the processing unit is specifically configured to:
for a first frame message node, selecting an array of a target frame type from the arrays of a plurality of frame types, and assigning the value of the frame type identification node and the value of the frame byte number node to the array of the target frame type; the first frame message node is any one of the plurality of frame message nodes; and, creating a plurality of variable arrays under the array of the target frame type; the number of the variable arrays is consistent with that of the fields, and the variable arrays are used for storing attribute information of the fields; and aiming at the first field, selecting a target variable array from the multiple variable arrays, and assigning the position of a frame sequence where the field is located, the length of bytes occupied by the field, the field name, the field function type number, the field code and the meaning of the field code to the target variable array; the first field is any one of the plurality of fields; and determining the attribute value of the frame field node according to the array of the assigned target frame type and the array of the assigned target variable.
Optionally, the creating unit is specifically configured to:
selecting a frame message node to be framed; selecting a target assigned frame type array corresponding to the frame message node of the frame to be framed from the multiple assigned frame type arrays; and creating a character array according to the value of the frame byte number node in the array of the frame type after the target assignment.
Optionally, the processing unit is specifically configured to:
selecting a field to be framed from the frame message node to be framed;
selecting a target assigned variable array corresponding to the field of the frame to be framed from the assigned variable data;
and assigning the character array according to the attribute information in the variable array after the target assignment to form a target message.
Optionally, the processing unit is further configured to:
and converting the assigned character array into a byte array.
Therefore, in the embodiment of the application, the structural information of the message node is determined by reading the XML document of the message, the frame field node in the frame message node is analyzed to obtain the attribute value of the frame field node, then the character array is created, and the character array is assigned according to the attribute value of the frame field node to form the target message. By adopting the method, the DL/T645 protocol message can be framed no matter whether the DL/T645 protocol message is self-defined by a manufacturer, so that the structure of the DL/T645 protocol message is uniformly described, and the deviation of understanding the partial content of the DL/T645 protocol is avoided.
Drawings
Fig. 1 is a schematic flowchart corresponding to a method for framing a DL/T645 protocol packet based on XML according to an embodiment of the present application;
fig. 2 is a tree directory structure diagram of an XML document of a DL/T645 protocol packet according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a framing device for a DL/T645 protocol packet based on XML according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Fig. 1 exemplarily shows a flow diagram corresponding to a method for framing a DL/T645 protocol packet based on XML according to an embodiment of the present application. As shown in fig. 1, the method specifically comprises the following steps:
step 101, after receiving a message sent by a remote end, reading an XML document of the message.
Step 102, determining the structure information of the message according to the XML document of the message.
And 103, analyzing the frame field nodes in the frame message nodes according to the structure information of the message to obtain the attribute values of the frame field nodes.
Step 104, create a character array.
And 105, assigning the character array according to the attribute value of the frame field node to form a target message.
And step 106, sending the target message to a destination address.
Therefore, in the embodiment of the application, the structural information of the message node is determined by reading the XML document of the message, the frame field node in the frame message node is analyzed to obtain the attribute value of the frame field node, then the character array is created, and the character array is assigned according to the attribute value of the frame field node to form the target message. By adopting the method, the DL/T645 protocol message can be framed no matter whether the DL/T645 protocol message is self-defined by a manufacturer, so that the structure of the DL/T645 protocol message is uniformly described, and the deviation of understanding the partial content of the DL/T645 protocol is avoided.
In step 101 and step 102, the structure of the DL/T645 protocol packet is described in the following XML:
six child nodes may be included in one < frames > node. The first three child nodes are a specification name node (i.e., < name > node), a specification up-down identification node (i.e., < Sendmachanism > node), and a frame format number node (i.e., < frame > node), respectively. Since there are 3 types of DL/T645 reduced packet frame formats, the structure information (i.e., < frame > nodes) describing each packet node in detail is all from the fourth node to the sixth node.
Each frame packet node (i.e., < frame > node) may contain three nodes, respectively, a frame type identifier node (i.e., < frameType > node), a frame byte number node (i.e., < frameLength > node), and a frame field node (i.e., < framebody > node).
Each frame field node (i.e., < framebody > node) may contain a plurality of field nodes (i.e., < Subdata > node), which may contain six node attributes, respectively, the position (position) of the frame sequence in which the field is located, the length (length) of the field in bytes, the field name (extension), the number of field function types (Functiontype), the field code (code), and the meaning (mean) of the field code.
In order to more clearly describe the XML document of the message, it is described below with reference to fig. 2. Fig. 2 exemplarily shows a tree directory structure diagram of an XML document of a DL/T645 protocol packet according to an embodiment of the present application.
As can be seen from fig. 2, the structure information of the frame packet node may include a protocol name of the packet, protocol uplink and downlink identifiers, a number of frame formats, and structure information of a plurality of frame packet nodes. The number of the frame message nodes and the number of the frame formats can be consistent.
The structure information of the frame message node may include a value of a frame type identification node, a value of a byte number of the frame, and structure information of a frame field.
The structure information of the frame field may include attribute information of a plurality of fields. The attribute information of the field may include at least one of a position of a frame sequence in which the field is located, a length of bytes occupied by the field, a field name, a number of kinds of functions of the field, a field code, and a meaning of the field code.
Before step 103 is performed, arrays of multiple frame types may be created. The number of the frame type arrays can be consistent with the number of the frame formats, and the frame type arrays can be used for storing the structural information of the frame message nodes.
Taking the structure shown in FIG. 2 as an example, an array of three frame types may be created. The first array of frame type is used for storing the structural information of the frame message node 1, the second array of frame type is used for storing the structural information of the frame message node 2, and the third array of frame type is used for storing the structural information of the frame message node 3.
In step 103, for the first frame packet node, selecting an array of a target frame type from the arrays of the plurality of frame types, and assigning a value of a frame type identifier node and a value of a frame byte number node to the array of the target frame type. The first frame message node is any one of a plurality of frame message nodes.
A plurality of variable arrays are created under the array of the target frame type. And the number of the variable arrays is consistent with that of the fields, and the variable arrays are used for storing the attribute information of the fields.
And aiming at the first field, selecting a target variable array from the multiple variable arrays, and assigning the position of a frame sequence where the field is located, the length of bytes occupied by the field, the field name, the field function type number, the field code and the meaning of the field code to the target variable array. Wherein the first field is any one of a plurality of fields.
And determining the attribute value of the frame field node according to the array of the assigned target frame type and the array of the assigned target variable.
For example, the array of frame types created is denoted by fm, and fm [ N ] is a description of the link layer packet types for the DL/T645 specification, an array used in writing framing algorithms. Wherein, N represents the (N + 1) th message type, and N is an array subscript and starts counting from 0. DL/T645 defines three messages (i.e., frame message node 1, frame message node 2, and frame message node 3 shown in fig. 2), so three subscripts 0, 1, and 2 are used here.
Taking the frame message node 1 shown in fig. 2 as an example, the selected target frame node is fm [0], and then the value of the frame byte number node < frameLength > and the number of sub-nodes of the frame field node < framebody > are obtained and respectively assigned to the frameLength and framebody member variables in the target frame node fm [0 ]. A plurality of variable arrays are created under fm [0], representing fb [0], fb [1] … … fb [ m ], respectively, where m is the number of fields. For field 1 shown in FIG. 2, corresponding to fb [0], and so on, field 2 corresponds to fb [1] … …, and field m corresponds to fb [ m ]. Taking field 1 as an example, attribute information (i.e. the position of the frame sequence in which the field is located, the length of the byte occupied by the field, the field name, the number of field functions, the field code, and the meaning of the field code) obtained in field 1 is respectively assigned to array fb [0] in fm [0], and other fields can also be respectively assigned to fb [1] … … fb [ m ] in a similar manner, so that the frame message node 1 of the DL/T645 protocol message is analyzed.
For the frame message node 2 and the frame message node 3, the above-described method may be adopted for assignment, which is not described in detail.
In step 104, frame message nodes to be framed need to be selected first, then an array of target assigned frame types corresponding to the frame message nodes to be framed can be selected from the arrays of the plurality of assigned frame types, and character arrays are created according to the values of the number of frame bytes nodes in the array of the target assigned frame types.
Specifically, according to which frame format a frame of the DL/T645 protocol packet to be grouped belongs to, a corresponding frame format element fm [ n ] may be selected in the group fm, that is, any one of fm [0], fm [1], and fm [2] is selected; furthermore, a character array is created based on the number of bytes fm [ n ]. framelength contained in the frame of the frame format.
In step 105, a field to be framed may be selected from a frame message node to be framed, then a target-assigned variable array corresponding to the field to be framed may be selected from the plurality of assigned variable data, and then the character array is assigned according to each attribute information in the target-assigned variable array to form a target message.
Specifically, the corresponding framebody structure type elements fm [ n ]. fb [ m-1] can be selected in fm [ n ] in sequence according to the sequence number of each frame attribute in the frame structure in the frame format; and then according to the position fm [ n ]. fb [ m-1]. position of the byte corresponding to each frame attribute in the frame format structure in the frame sequence, giving the corresponding code corresponding characters to the elements in the character array in sequence.
Further, before the target message is formed, the assigned character array can be converted into a byte array, so that a complete frame is formed and can be sent.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Fig. 3 exemplarily shows a schematic structural diagram of a framing apparatus for a DL/T645 protocol packet based on XML according to an embodiment of the present application. As shown in fig. 3, the apparatus has a function of implementing the framing method for the DL/T645 protocol packet based on XML, and the function may be implemented by hardware, or by hardware executing corresponding software. The apparatus may include: a receiving unit 301, a reading unit 302, a processing unit 303, a creating unit 304 and a sending unit 305.
A receiving unit 301, configured to receive a message sent by a remote end;
a reading unit 302, configured to read an XML document of a message;
a processing unit 303, configured to determine structural information of a frame packet node according to the XML document of the packet; analyzing frame field nodes in the frame message nodes according to the structural information of the frame message nodes to obtain attribute values of the frame field nodes;
a creating unit 304 for creating a character array;
the processing unit 303 is further configured to assign a value to the character array according to the attribute value of the frame field node to form a target packet;
a sending unit 305, configured to send the target packet to a destination address.
Optionally, the structure information of the packet includes a protocol name, a protocol uplink and downlink identifier, a number of frame formats, and structure information of a plurality of frame format packet nodes of the packet; the number of the frame message nodes is consistent with the number of the frame formats.
Optionally, the structure information of the frame packet node includes a value of a frame type identifier node, a value of a byte number of a frame node, and structure information of a frame field.
Optionally, the structure information of the frame field includes attribute information of a plurality of fields.
Optionally, the attribute information of the field includes at least one of a position of the frame sequence in which the field is located, a length of bytes occupied by the field, a field name, a number of types of field functions, a field code, and a meaning of the field code.
Optionally, the processing unit 303 is further configured to:
creating an array of a plurality of frame types; the number of the array of the frame type is consistent with the number of the frame formats, and the array of the frame type is used for storing the structural information of the frame message node.
Optionally, the processing unit 303 is specifically configured to:
for a first frame message node, selecting an array of a target frame type from the arrays of a plurality of frame types, and assigning the value of the frame type identification node and the value of the frame byte number node to the array of the target frame type; the first frame message node is any one of the plurality of frame message nodes; and, creating a plurality of variable arrays under the array of the target frame type; the number of the variable arrays is consistent with that of the fields, and the variable arrays are used for storing attribute information of the fields; and aiming at the first field, selecting a target variable array from the multiple variable arrays, and assigning the position of a frame sequence where the field is located, the length of bytes occupied by the field, the field name, the field function type number, the field code and the meaning of the field code to the target variable array; the first field is any one of the plurality of fields; and determining the attribute value of the frame field node according to the array of the assigned target frame type and the array of the assigned target variable.
Optionally, the creating unit 304 is specifically configured to:
selecting a frame message node to be framed; selecting a target assigned frame type array corresponding to the frame message node of the frame to be framed from the multiple assigned frame type arrays; and creating a character array according to the value of the frame byte number node in the array of the frame type after the target assignment.
Optionally, the processing unit 303 is specifically configured to:
selecting a field to be framed from the frame message node to be framed;
selecting a target assigned variable array corresponding to the field of the frame to be framed from the assigned variable data;
and assigning the character array according to the attribute information in the variable array after the target assignment to form a target message.
Optionally, the processing unit 303 is further configured to:
and converting the assigned character array into a byte array.
In an exemplary embodiment, a computer-readable storage medium is further provided, in which a computer program or an intelligent contract is stored, and the computer program or the intelligent contract is loaded and executed by a node to implement the transaction processing method provided by the above-described embodiment. Alternatively, the computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Those skilled in the art will clearly understand that the techniques in the embodiments of the present application may be implemented by way of software plus a required general hardware platform. Based on such understanding, the technical solutions in the embodiments of the present application may be essentially implemented or a part contributing to the prior art may be embodied in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the embodiments or some parts of the embodiments of the present application.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (8)

1. A framing method of DL/T645 protocol message based on XML is characterized by comprising the following steps:
after receiving a message sent by a remote end, reading an XML document of the message;
determining the structure information of the message according to the XML document of the message, wherein the structure information of the message comprises the protocol name, the protocol uplink and downlink identification, the number of frame formats and the structure information of a plurality of frame message nodes, and the number of the frame message nodes is consistent with the number of the frame formats;
creating a plurality of arrays of frame types, wherein the number of the arrays of frame types is consistent with the number of the frame formats, and the arrays of frame types are used for storing the structural information of the frame message nodes;
analyzing frame field nodes in frame message nodes according to the structural information of the message and the arrays of the plurality of frame types to obtain attribute values of the frame field nodes;
creating a character array;
according to the attribute value of the frame field node, carrying out assignment on the character array to form a target message;
and sending the target message to a destination address.
2. The method of claim 1, wherein the structure information of the frame packet node comprises a value of a frame type identifier node, a value of a byte number of a frame, and structure information of a frame field.
3. The method of claim 2, wherein the structure information of the frame field comprises attribute information of a plurality of fields.
4. The method according to claim 3, wherein the attribute information of the field comprises at least one of a position of the frame sequence in which the field is located, a length of bytes occupied by the field, a field name, a number of types of field functions, a field code, and a meaning of the field code.
5. The method of claim 4, wherein parsing frame field nodes in frame packet nodes according to the structure information of the packet and the array of the plurality of frame types to obtain attribute values of the frame field nodes comprises:
for a first frame message node, selecting an array of a target frame type from the arrays of a plurality of frame types, and assigning the value of the frame type identification node and the value of the frame byte number node to the array of the target frame type; the first frame message node is any one of the plurality of frame message nodes;
creating a plurality of variable arrays under the array of the target frame type; the number of the variable arrays is consistent with that of the fields, and the variable arrays are used for storing attribute information of the fields;
aiming at a first field, selecting a target variable array from a plurality of variable arrays, and assigning the position of a frame sequence where the field is located, the length of bytes occupied by the field, the field name, the field function type number, the field code and the meaning of the field code to the target variable array; the first field is any one of the plurality of fields;
and determining the attribute value of the frame field node according to the array of the assigned target frame type and the array of the assigned target variable.
6. The method of claim 5, wherein the creating a character array comprises:
selecting a frame message node to be framed;
selecting a target assigned frame type array corresponding to the frame message node to be framed from the multiple assigned frame type arrays;
and creating a character array according to the value of the frame byte number node in the array of the frame type after the target assignment.
7. The method according to claim 6, wherein the assigning the character array according to the attribute value of the frame field node to form the target packet comprises:
selecting a field to be framed from the frame message node to be framed;
selecting a target assigned variable array corresponding to the field of the frame to be framed from the assigned variable data;
and assigning the character array according to the attribute information in the variable array after the target assignment to form a target message.
8. An apparatus for framing XML-based DL/T645 protocol packets, the apparatus comprising:
the receiving unit is used for receiving a message sent by a far end;
the reading unit is used for reading the XML document of the message;
the processing unit is used for determining the structural information of the frame message node according to the XML document of the message; also for creating arrays of multiple frame types; analyzing the frame field nodes in the frame message nodes according to the structural information of the frame message nodes and the arrays of the plurality of frame types to obtain attribute values of the frame field nodes;
a creating unit for creating a character array;
the processing unit is also used for assigning the character array according to the attribute value of the frame field node to form a target message;
and the sending unit is used for sending the target message to a destination address.
CN201911064856.4A 2019-11-04 2019-11-04 Method and device for framing DL/T645 protocol message based on XML Active CN110830466B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911064856.4A CN110830466B (en) 2019-11-04 2019-11-04 Method and device for framing DL/T645 protocol message based on XML

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911064856.4A CN110830466B (en) 2019-11-04 2019-11-04 Method and device for framing DL/T645 protocol message based on XML

Publications (2)

Publication Number Publication Date
CN110830466A CN110830466A (en) 2020-02-21
CN110830466B true CN110830466B (en) 2022-01-28

Family

ID=69552274

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911064856.4A Active CN110830466B (en) 2019-11-04 2019-11-04 Method and device for framing DL/T645 protocol message based on XML

Country Status (1)

Country Link
CN (1) CN110830466B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111404902B (en) * 2020-03-08 2022-05-10 苏州浪潮智能科技有限公司 Method and device for realizing serial communication message matching based on database
CN112035040B (en) * 2020-08-31 2023-04-07 北京润科通用技术有限公司 Interface variable information processing method and device
CN114338747B (en) * 2021-12-31 2023-07-25 四川启睿克科技有限公司 Cloud scene control system and method supporting device to report data messages in self-defined mode

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7853621B2 (en) * 2005-11-23 2010-12-14 Oracle International Corp. Integrating medical data and images in a database management system
CN103123646B (en) * 2012-12-11 2015-11-04 北京航空航天大学 XML document is converted into automatically conversion method and the device of OWL document
US9996976B2 (en) * 2014-05-05 2018-06-12 Avigilon Fortress Corporation System and method for real-time overlay of map features onto a video feed
CN105472044B (en) * 2016-01-26 2019-11-12 云南电网有限责任公司电力科学研究院 A kind of DL/T645 based on XML and GOOSE mapping method
CN106603502A (en) * 2016-11-21 2017-04-26 云南电网有限责任公司电力科学研究院 XML-based IEC 60870-5-104 and GOOSE conversion method
CN108920437A (en) * 2018-07-12 2018-11-30 中国工程物理研究院计算机应用研究所 The method that XML document is converted into html format document based on XSL

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
《基于XML的DL/T645协议与GOOSE的映射研究》;刘名扬等;《信息技术》;20161231;全文 *

Also Published As

Publication number Publication date
CN110830466A (en) 2020-02-21

Similar Documents

Publication Publication Date Title
CN110830466B (en) Method and device for framing DL/T645 protocol message based on XML
US10666718B2 (en) Dynamic data transport between enterprise and business computing systems
CN110022289B (en) Data transmission method, device and system
CN112688967B (en) Internet of things data processing method, device, equipment and storage medium
CN111552838B (en) Data processing method and device, computer equipment and storage medium
CN108063775B (en) Communication protocol compatible method, device and system
US7620700B2 (en) Communication system implementing a plurality of communication apparatuses as communication client and communication server for exchanging operation requests and operation responses
CN108881251B (en) System and method for access analysis and standardization of any binary equipment
CN113596017B (en) Protocol analysis method and device, soft gateway and storage medium
CN101848239B (en) High-timeliness distributed service integration calling system
CN111294235A (en) Data processing method, device, gateway and readable storage medium
CN115242896A (en) Dynamic message analysis method and device, electronic equipment and computer readable storage medium
CN114025015A (en) Message transmission method and device
CN113079198A (en) Method and device for converting cloud platform interface protocol
CN113220481B (en) Request processing and feedback method, device, computer equipment and readable storage medium
CN107222461A (en) Communication processing method and device
CN113157975A (en) Extensible markup language parsing system and method
CN111782882A (en) TCP message conversion method, device, system and computer storage medium
CN116828346A (en) Ammeter data proxy reading method and device, electronic equipment and storage medium
CN113709177B (en) Method for processing message and external call gateway
CN113645131B (en) Data processing method, device, electronic equipment and storage medium
US11216424B2 (en) Dynamically rendering an application programming interface for internet of things applications
CN115372810A (en) Construction method, device, storage medium and equipment of relay protection digital twin body
CN110990635B (en) Dynamic modeling method based on dyeing and finishing equipment
CN115134380A (en) Data transmission method and device, electronic equipment and storage medium

Legal Events

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