CN108833394B - Protocol conversion algorithm of data acquisition system - Google Patents

Protocol conversion algorithm of data acquisition system Download PDF

Info

Publication number
CN108833394B
CN108833394B CN201810579760.0A CN201810579760A CN108833394B CN 108833394 B CN108833394 B CN 108833394B CN 201810579760 A CN201810579760 A CN 201810579760A CN 108833394 B CN108833394 B CN 108833394B
Authority
CN
China
Prior art keywords
data
protocol
field
conversion
message
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
CN201810579760.0A
Other languages
Chinese (zh)
Other versions
CN108833394A (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.)
Unit 63889 Of Pla
Original Assignee
Unit 63889 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 Unit 63889 Of Pla filed Critical Unit 63889 Of Pla
Priority to CN201810579760.0A priority Critical patent/CN108833394B/en
Publication of CN108833394A publication Critical patent/CN108833394A/en
Application granted granted Critical
Publication of CN108833394B publication Critical patent/CN108833394B/en
Expired - Fee Related 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/08Protocols for interworking; Protocol conversion

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Communication Control (AREA)
  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a protocol conversion algorithm of a data acquisition system, which realizes a universal protocol conversion algorithm by formulating a communication protocol conversion model, stores a source protocol, a target protocol and field conversion matching information into a database, directly reads data from a corresponding position of a source data packet according to the field conversion matching information during communication data conversion, converts the data into target field data, and synthesizes the target data packet field by field in sequence.

Description

Protocol conversion algorithm of data acquisition system
Technical Field
The invention relates to the technical field of universal protocol conversion, in particular to a protocol conversion algorithm of a data acquisition system.
Background
The development target of the data acquisition system is to complete the conversion between different communication protocols, enhance the adaptability of the equipment to the external communication function, realize the interconnection and intercommunication between the equipment and each control center system, more and more intelligent equipment can realize the direct connection communication through the internet, but there is not unified standard language between the field equipment, the field equipment is different in communication language due to the difference of types, brands and applicable areas, the communication language is different from each other, the communication mode between independent individuals is still single, and the expansion and expansion of the information scale of the internet of things are not facilitated.
The present invention provides a new solution to this problem.
Disclosure of Invention
In view of the above, the present invention is directed to a protocol conversion algorithm for a data acquisition system to overcome the shortcomings of the prior art.
The technical scheme for solving the problem is as follows: the protocol conversion algorithm of the data acquisition system comprises the following steps:
1) formulating a communication protocol conversion model;
2) storing the original protocol, the target protocol and the field conversion matching information into a database;
3) according to the field conversion matching information, directly reading data from the corresponding position of the source data packet, converting the data into target field data, and sequentially synthesizing the target data packet field by field;
4) when a new protocol conversion requirement exists, the new protocol and field conversion matching information is added into the database in the software configuration interface, and the new conversion requirement can be met without modifying the executable program.
The step 1) comprises the following steps:
step 2.1) definition: symbol "→" is the conversion operator, symbol
Figure GDA0002557007730000011
For non-convertible operators, the symbol "|" is a combined operator, let PPAiIs PAOf any one of the independent protocol clusters, PPBjIs PBComprises a header MH, a DATA field DATA and a trailer MT, and a protocol cluster PP: PP | DATA | MT;
defining each independently used communication protocol P as a protocol cluster PP, and the communication protocol P of any device in the field can be expressed as: p ═ PP1,PP2,…,PPnIn which PPj={pj1,pj2,…,pjmAnd exist
Figure GDA00025570077300000210
Figure GDA0002557007730000029
The protocol cluster PP is then unique and the header MH presents a fixed position field for distinguishing each element p in the protocol cluster PPjReferred to as the data flag bit q;
since MH, DATA and MT are composed of a plurality of fields d, and are all associated with a DATA flag q, which is a function of q, then:
Figure GDA0002557007730000021
it is determined from the above equation that in the protocol cluster PP, there must be one p for each value of qjCorresponding to it;
step 2.2) because the existence of consistent data is the basis of the interconversion of two related protocol clusters PP, and the protocol clusters PP are the function of the data flag bit Q, let Q be the value set of the data flag bit Q, therefore there are:
Figure GDA0002557007730000022
step 2.3) for Q ∈ QAiAnd Q ∈ QBjThe method comprises the following steps:
Figure GDA0002557007730000023
step 2.4) because the MT is often closely related to the string of MH | DATA, which varies with the value of the string of MH | DATA, and is independent of each other during the message conversion process:
Figure GDA0002557007730000024
step 2.5) since the field is the minimum unit of the communication protocol, there are:
Figure GDA0002557007730000025
Figure GDA0002557007730000026
Figure GDA0002557007730000027
Figure GDA0002557007730000028
from the above formula, it can be seen that the P can be realized only by changing the position of the field belonging to the protocol family A in the messageA→PB
Step 2.6) considering the existence of the field and the multivariate conversion in practice, the field conversion has the following types:
Figure GDA0002557007730000031
Figure GDA0002557007730000032
therefore, at the time of protocol conversion, for an arbitrary dB, it can be obtained by three ways in the above equation.
The step 3) comprises the following steps:
3.1) reading message data information generated by a source system from a database;
3.2) checking the message data according to the source system communication protocol cluster followed by the message data;
3.3) if the message has errors, ending the processing flow; if the message is correct, extracting a header and data;
3.4) inquiring whether the protocol corresponding to the message data needs to be converted;
3.5) if the conversion is not needed, ending the processing flow; if conversion is needed, generating a header and a data field of the corresponding target system message data field by field according to a protocol conversion model;
3.6) adding a trailer according to a target system protocol;
3.7) sending message data information to the target system to complete protocol conversion.
Due to the adoption of the technical scheme, compared with the prior art, the invention has the following advantages: the invention realizes a universal protocol conversion algorithm by formulating a communication protocol conversion model, stores a source protocol, a target protocol and field conversion matching information into a database, directly reads data from the corresponding position of a source data packet according to the field conversion matching information during communication data conversion, converts the data into target field data, and synthesizes the target data packets field by field sequentially.
Drawings
FIG. 1 is a schematic diagram of a protocol conversion algorithm for a data acquisition system of the present invention.
FIG. 2 is a flow chart of a protocol conversion algorithm for the data acquisition system of the present invention.
Detailed Description
The foregoing and other technical matters, features and effects of the present invention will be apparent from the following detailed description of the embodiments, which is to be read in connection with the accompanying drawings of fig. 1 to 2. The structural contents mentioned in the following embodiments are all referred to the attached drawings of the specification.
As shown in fig. 1, the protocol conversion algorithm of the data acquisition system includes the following steps:
1) formulating a communication protocol conversion model;
2) storing the original protocol, the target protocol and the field conversion matching information into a database;
3) according to the field conversion matching information, directly reading data from the corresponding position of the source data packet, converting the data into target field data, and sequentially synthesizing the target data packet field by field;
4) when a new protocol conversion requirement exists, the new protocol and field conversion matching information is added into the database in the software configuration interface, and the new conversion requirement can be met without modifying the executable program.
The step 1) comprises the following steps:
step 2.1) definition: symbol "→" is the conversion operator, symbol
Figure GDA0002557007730000041
For non-convertible operators, the symbol "|" is a combined operator, let PPAiIs PAOf any one of the independent protocol clusters, PPBjIs PBComprises a header MH, a DATA field DATA and a trailer MT, and a protocol cluster PP: PP | DATA | MT;
in the communication network, all data messages can be represented by a character string D, in which one or more continuous bits or continuous bytes with specific meanings at specific positions are represented by common fields D, such as task flags, pitching, switches, and the like. Then, the outbound interaction message D of any device in the domain can be regarded as being formed by sequentially combining a plurality of fields D. The convention for defining the arrangement sequence of the fields D in the interactive message D is a communication protocol P, and the communication protocol P only limits the data format definition of network transmission and does not include the provisions of a synchronous mode, a transmission speed, a transmission step and the like of information transmission.
Since the communication protocol P is a regular definition of the domain device system message D, P is a finite element set P ═ P1,p2,…,pnIn which p isi≠pjAll messages D, D ∈ D are examples of an element P in P, and the content of data D can be understood according to the definition of P.
There is a practical situation that devices in the domain support multiple protocols, so each independently used communication protocol P is defined as a protocol cluster PP, and the communication protocol P of any device in the domain can be expressed as: p ═ PP1,PP2,…,PPnIn which PPj={pj1,pj2,…,pjmAnd exist
Figure GDA0002557007730000053
The protocol cluster PP is then unique and the header MH presents a fixed position field for distinguishing each element p in the protocol cluster PPjReferred to as the data flag bit q.
In the usual case, the protocol cluster PP consists of three parts, a header MH, a DATA field DATA and a trailer MT, or directly consists of two parts, a header MH and a DATA field DATA; and a fixed position field exists in the header for distinguishing each p in the protocol cluster PPjCalled data flag bit q, or distinguishes each p in the protocol cluster PP according to the data field lengthj. Under special conditions, the field equipment only interacts certain type of data in a single direction, no other type of data exists, or the field equipment is distinguished and judged according to the length of a data field, and the definitions of a header and a trailer are lacked.
Since MH, DATA and MT are composed of a plurality of fields d, and are all associated with a DATA flag q, which is a function of q, then:
Figure GDA0002557007730000051
it is determined from the above equation that in the protocol cluster PP, there must be one p for each value of qjCorresponding thereto.
Therefore, the communication protocol can be identified according to the data flag bit q, and according to the development task requirement of the data acquisition system, the equipment communication protocol needs to be converted into a communication protocol understood by the control center. I.e. a certain communication protocol cluster of the device is converted into a communication protocol cluster understood by the control center and converted into a standard communication protocol cluster.
If the conversion from the device protocol to the control center standard protocol is realized, a peer-to-peer system with q values with the same meaning in the two protocols is established, and then the field of the target message is completely supplemented according to the source message.
Step 2.2) when the same communication protocol is not available, if the communication between the field device A and the control center B is realized without obstruction, P must be doneA→PBLet PPAiIs PAOf any one of the independent protocol clusters, PPBjIs PBAny of the independent protocol clusters. Then, if PP is implementedAi→PPBjCan realize PA→PB
Because the existence of consistent data is the basis of the interconversion of two related protocol clusters PP, and the protocol clusters PP is the function of the data flag bit Q, and Q is the value set of the data flag bit Q, the following steps are provided:
Figure GDA0002557007730000052
step 2.3) for Q ∈ QAiAnd Q ∈ QBjThe method comprises the following steps:
Figure GDA0002557007730000061
step 2.4) because the MT is often closely related to the string of MH | DATA, which varies with the value of the string of MH | DATA, and is independent of each other during the message conversion process:
Figure GDA0002557007730000062
step 2.5) since the field is the minimum unit of the communication protocol, there are:
Figure GDA0002557007730000063
Figure GDA0002557007730000064
Figure GDA0002557007730000065
Figure GDA0002557007730000066
from the above formula, it can be seen that the P can be realized only by changing the position of the field belonging to the protocol family A in the messageA→PB
Step 2.6) considering the existence of the field and the multivariate conversion in practice, the field conversion has the following types:
Figure GDA0002557007730000067
Figure GDA0002557007730000068
therefore, at the time of protocol conversion, for any dBCan be obtained by three ways in the above formula.
In summary, any two inter-device communication protocol conversions with consistent data classes can be realized by calculating a source protocol field to a target protocol field in the following three ways:
Figure GDA0002557007730000071
because of the PPAiIs PAOf any one of the independent protocol clusters, PPBjIs PBAny one of the above protocol conversion model derivation is general.
As shown in fig. 2, the step 3) includes the following steps:
3.1) reading message data information generated by a source system from a database;
3.2) checking the message data according to the source system communication protocol cluster followed by the message data;
3.3) if the message has errors, ending the processing flow; if the message is correct, extracting a header and data;
3.4) inquiring whether the protocol corresponding to the message data needs to be converted;
3.5) if the conversion is not needed, ending the processing flow; if conversion is needed, generating a header and a data field of the corresponding target system message data field by field according to a protocol conversion model;
3.6) adding a trailer according to a target system protocol;
3.7) sending message data information to the target system to complete protocol conversion.
In summary, the present invention implements a generalized protocol conversion algorithm by formulating a communication protocol conversion model, and stores a source protocol, a target protocol, and field conversion matching information into a database, and when converting communication data, directly reads data from a corresponding position of a source packet according to the field conversion matching information, converts the data into target field data, and synthesizes the target data packets field by field sequentially.
While the invention has been described in further detail with reference to specific embodiments thereof, it is not intended that the invention be limited to the specific embodiments thereof; for those skilled in the art to which the present invention pertains and related technologies, the extension, operation method and data replacement should fall within the protection scope of the present invention based on the technical solution of the present invention.

Claims (2)

1. The protocol conversion algorithm of the data acquisition system is characterized in that: the method comprises the following steps:
1) formulating a communication protocol conversion model;
2) storing the original protocol, the target protocol and the field conversion matching information into a database;
3) according to the field conversion matching information, directly reading data from the corresponding position of the source data packet, converting the data into target field data, and sequentially synthesizing the target data packet field by field;
4) when a new protocol conversion requirement exists, the new protocol and field conversion matching information is added into the database in the software configuration interface, and the new conversion requirement can be met without modifying an executable program;
the step 1) comprises the following steps:
step 2.1) definition: symbol "→" is the conversion operator, symbol
Figure FDA0002557007720000011
For non-convertible operators, the symbol "|" is a combined operator, let PPAiIs PAOf any one of the independent protocol clusters, PPBjIs PBComprises a header MH, a DATA field DATA and a trailer MT, and a protocol cluster PP: PP | DATA | MT;
defining each independently used communication protocol P as a protocol cluster PP, and the communication protocol P of any device in the field can be expressed as: p ═ PP1,PP2,…,PPnIn which PPj={pj1,pj2,…,pjmAnd exist
Figure FDA0002557007720000012
The protocol cluster PP is then unique and the header MH presents a fixed position field for distinguishing each element p in the protocol cluster PPjReferred to as the data flag bit q;
since MH, DATA and MT are composed of a plurality of fields d, and are all associated with a DATA flag q, which is a function of q, then:
Figure FDA0002557007720000013
it is determined from the above equation that in the protocol cluster PP, there must be one p for each value of qjCorresponding to it;
step 2.2) because the existence of consistent data is the basis of the interconversion of two related protocol clusters PP, and the protocol clusters PP are the function of the data flag bit Q, let Q be the value set of the data flag bit Q, therefore there are:
Figure FDA0002557007720000014
step 2.3) for Q ∈ QAiAnd Q ∈ QBjThe method comprises the following steps:
Figure FDA0002557007720000015
step 2.4) because the MT is often closely related to the string of MH | DATA, which varies with the value of the string of MH | DATA, and is independent of each other during the message conversion process:
Figure FDA0002557007720000021
step 2.5) since the field is the minimum unit of the communication protocol, there are:
Figure FDA0002557007720000022
Figure FDA0002557007720000023
Figure FDA0002557007720000024
Figure FDA0002557007720000025
from the above formula, it can be seen that the P can be realized only by changing the position of the field belonging to the protocol family A in the messageA→PB
Step 2.6) considering the existence of the field and the multivariate conversion in practice, the field conversion has the following types:
Figure FDA0002557007720000026
therefore, in the protocol conversion, theAny dBCan be obtained by three ways in the above formula.
2. The protocol conversion algorithm for a data acquisition system as claimed in claim 1, wherein: the step 3) comprises the following steps:
3.1) reading message data information generated by a source system from a database;
3.2) checking the message data according to the source system communication protocol cluster followed by the message data;
3.3) if the message has errors, ending the processing flow; if the message is correct, extracting a header and data;
3.4) inquiring whether the protocol corresponding to the message data needs to be converted;
3.5) if the conversion is not needed, ending the processing flow; if conversion is needed, generating a header and a data field of the corresponding target system message data field by field according to a protocol conversion model;
3.6) adding a trailer according to a target system protocol;
3.7) sending message data information to the target system to complete protocol conversion.
CN201810579760.0A 2018-06-07 2018-06-07 Protocol conversion algorithm of data acquisition system Expired - Fee Related CN108833394B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810579760.0A CN108833394B (en) 2018-06-07 2018-06-07 Protocol conversion algorithm of data acquisition system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810579760.0A CN108833394B (en) 2018-06-07 2018-06-07 Protocol conversion algorithm of data acquisition system

Publications (2)

Publication Number Publication Date
CN108833394A CN108833394A (en) 2018-11-16
CN108833394B true CN108833394B (en) 2020-10-09

Family

ID=64144276

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810579760.0A Expired - Fee Related CN108833394B (en) 2018-06-07 2018-06-07 Protocol conversion algorithm of data acquisition system

Country Status (1)

Country Link
CN (1) CN108833394B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109561104A (en) * 2018-12-28 2019-04-02 深圳市创梦天地科技有限公司 A kind of communication protocol conversion method and device
CN110704234B (en) * 2019-09-12 2023-05-23 无锡江南计算技术研究所 Memory control data transmission error injection method
CN111026059A (en) * 2019-12-18 2020-04-17 无锡睿控物联网科技有限公司 High-speed low-flow remote equipment data acquisition terminal and data processing method thereof
CN114760366A (en) * 2020-12-25 2022-07-15 广州海格通信集团股份有限公司 Communication system, communication method, and storage medium
CN114338262B (en) * 2021-11-26 2024-02-20 国网信息通信产业集团有限公司 Energy cabin communication method and system and electronic equipment
CN114500648A (en) * 2022-01-17 2022-05-13 徐工汉云技术股份有限公司 Tower crane data multi-form conversion forwarding method and system
CN116668195B (en) * 2023-07-28 2023-09-26 沈阳航盛科技有限责任公司 Transmission method for radio frequency analog terminal 429 communication protocol

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101212454A (en) * 2006-12-25 2008-07-02 深圳Tcl工业研究院有限公司 Protocol bridging method and device
CN101944025A (en) * 2010-09-16 2011-01-12 福建鑫诺通讯技术有限公司 Automatic TCP/UDP (Transmission Control Protocol/User Datagram Protocol) data packing and unpacking method based on PYTHON language
CN103347024A (en) * 2013-07-05 2013-10-09 昆山华谷科技发展有限公司 Method and device for conversion of elevator communication protocols
CN104331292A (en) * 2014-11-03 2015-02-04 重庆邮电大学 Method for generating configuration for middleware protocol conversion of Internet of vehicles
CN104639507A (en) * 2013-11-13 2015-05-20 中国科学院声学研究所 Loading protocol packet data transmission method and system among heterogeneous networks
EP3309818A1 (en) * 2015-06-12 2018-04-18 Fuji Machine Mfg. Co., Ltd. Relay device and manufacturing system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101212454A (en) * 2006-12-25 2008-07-02 深圳Tcl工业研究院有限公司 Protocol bridging method and device
CN101944025A (en) * 2010-09-16 2011-01-12 福建鑫诺通讯技术有限公司 Automatic TCP/UDP (Transmission Control Protocol/User Datagram Protocol) data packing and unpacking method based on PYTHON language
CN103347024A (en) * 2013-07-05 2013-10-09 昆山华谷科技发展有限公司 Method and device for conversion of elevator communication protocols
CN104639507A (en) * 2013-11-13 2015-05-20 中国科学院声学研究所 Loading protocol packet data transmission method and system among heterogeneous networks
CN104331292A (en) * 2014-11-03 2015-02-04 重庆邮电大学 Method for generating configuration for middleware protocol conversion of Internet of vehicles
EP3309818A1 (en) * 2015-06-12 2018-04-18 Fuji Machine Mfg. Co., Ltd. Relay device and manufacturing system

Also Published As

Publication number Publication date
CN108833394A (en) 2018-11-16

Similar Documents

Publication Publication Date Title
CN108833394B (en) Protocol conversion algorithm of data acquisition system
EP3803578B1 (en) Dynamic data transport between enterprise and business computing systems
US11463275B2 (en) Electronic control unit, frame generating method, and non-transitory computer-readable recording medium storing a program
US20210044524A1 (en) Packet edit processing method and related device
US8151003B2 (en) System and method for routing data by a server
CN109768970B (en) Configurable universal protocol generation method
CN100586109C (en) Communication method and system for universal service data based on self-defined template
JP2015115832A (en) Relay device, relay control method, and relay control program
EP2633479A2 (en) Decoding, model and presentation system
EP3929673A1 (en) Field device configuration tool
CN113381870B (en) Message processing method and device
US20100124227A1 (en) Systems and methods for electronically routing data
WO2013016994A1 (en) Message sending method and system
JP5940632B2 (en) Network grouping system and network grouping method
CN110839022A (en) Vehicle-mounted control software communication protocol analysis method based on xml language
EP2991273A2 (en) Methods and systems for auto-commissioning of devices in a communication network
CN105793842B (en) Conversion method and device between serialized message
US11216424B2 (en) Dynamically rendering an application programming interface for internet of things applications
CN111314375B (en) Medical insurance data adaptation engine, medical insurance data adaptation method, electronic equipment and storage medium
CN110474838A (en) A kind of Json mixing binary transmissions data method
CN113783902B (en) Communication conversion method and device suitable for communication among different devices
CN104486344A (en) User access system and method based on SNMP (simple network management protocol)
KR20050031954A (en) Method and system for using multiple data type representations to deliver data objects to components in a distributed system
CN116166126B (en) Human-computer interaction method, system, electronic equipment and storage medium based on block chain
CN109783375B (en) Data analysis and simulation method

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
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20201009

Termination date: 20210607