CN108390877B - Communication protocol conversion method and communication protocol converter - Google Patents

Communication protocol conversion method and communication protocol converter Download PDF

Info

Publication number
CN108390877B
CN108390877B CN201810159332.2A CN201810159332A CN108390877B CN 108390877 B CN108390877 B CN 108390877B CN 201810159332 A CN201810159332 A CN 201810159332A CN 108390877 B CN108390877 B CN 108390877B
Authority
CN
China
Prior art keywords
communication protocol
data
attribute
transmission type
conversion
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
CN201810159332.2A
Other languages
Chinese (zh)
Other versions
CN108390877A (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.)
Sungrow Power Supply Co Ltd
Original Assignee
Sungrow Power Supply 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 Sungrow Power Supply Co Ltd filed Critical Sungrow Power Supply Co Ltd
Priority to CN201810159332.2A priority Critical patent/CN108390877B/en
Publication of CN108390877A publication Critical patent/CN108390877A/en
Application granted granted Critical
Publication of CN108390877B publication Critical patent/CN108390877B/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/08Protocols for interworking; Protocol conversion

Abstract

The application discloses a communication protocol conversion method and a communication protocol converter, wherein the method comprises the following steps: when an instruction for converting a first communication protocol into a second communication protocol is received, importing configuration parameters of each item of data accessed to the first communication protocol into the same set, wherein the configuration parameters comprise the transmission type; classifying other configuration parameters of each item of data in the set according to different transmission types to obtain a plurality of subsets corresponding to a single transmission type; transmitting the subsets of different transmission types into corresponding conversion channels for data format conversion; sending the signal output by the target conversion channel into a queue corresponding to the target conversion channel; the target conversion channel is a conversion channel with the corresponding transmission type being the same as the transmission type supported by the second communication protocol; and each queue outputs data according to the priority to obtain data suitable for the second communication protocol. The application realizes the conversion of the communication protocol with various transmission types into other arbitrary communication protocols.

Description

Communication protocol conversion method and communication protocol converter
Technical Field
The present invention relates to the field of communication protocol conversion technology, and more particularly, to a communication protocol conversion method and a communication protocol converter.
Background
A communication protocol is a set of conventions that are specified for both parties to communicate in a communication system to be compliant with each other in order to ensure that both parties can communicate efficiently and reliably, and includes: data format, transmission type (the transmission type contains a plurality of attribute items, such as transmission mode, transmission basic unit, etc.), and the like.
At present, due to the national conditions of China, the communication protocol versions existing in the power grid of China are more, such as IEC versions, power industry association versions, national power grid company versions, enterprise standard versions and the like. The differences among the communication protocol versions are extremely large and difficult to unify, so that the development difficulty of the communication system of the power system master station is extremely large, the power system master station cannot be suitable for various types of communication protocols, and once the communication protocols supported by the communication system need to be modified, the workload of later expansion and maintenance of the communication system is huge.
In the prior art, a communication protocol converter is adopted to realize conversion between different communication protocols, but the communication protocol converter is only suitable for conversion between communication protocols with different data formats under a single transmission type, and cannot convert the communication protocols with multiple transmission types, so that the communication protocol converter has the advantages of single function, limited processing capability and insufficient expansibility.
Disclosure of Invention
In view of the above, the present invention provides a communication protocol conversion method and a communication protocol converter, so as to convert a communication protocol having multiple transmission types into any other communication protocol.
A communication protocol conversion method, comprising:
judging whether an instruction for converting a first communication protocol into a second communication protocol is received, wherein transmission types of various items of data accessed to the first communication protocol are not uniform;
when the instruction is received, importing configuration parameters of the data into the same set, wherein the configuration parameters comprise the transmission type;
classifying other configuration parameters of the data in the set according to different transmission types to obtain a plurality of subsets corresponding to a single transmission type;
sending the subsets of different transmission types into a conversion channel corresponding to the transmission type, wherein the conversion channel is used for realizing data format conversion under a fixed transmission type;
sending the signal output by the target conversion channel into a queue corresponding to the target conversion channel; the target conversion channel refers to a conversion channel of which the corresponding transmission type is the same as the transmission type supported by the second communication protocol;
and outputting data by each queue according to the priority to obtain data suitable for the second communication protocol.
Optionally, the transmission type is composed of a1 st attribute item to an nth attribute item, an attribute value of the ith attribute item is called as an ith attribute value, i is 1, 2, 3, …, n, and n is greater than or equal to 1; classifying other configuration parameters of the data in the set according to different transmission types to obtain a plurality of subsets corresponding to a single transmission type, including:
classifying other configuration parameters of the data in the set according to different 1 st attribute values to obtain a plurality of subsets;
according to the difference of the attribute values of the No. 2, continuously classifying other configuration parameters of the data in the subsets obtained by primary classification to obtain a plurality of subsets;
according to the difference of the 3 rd attribute values, continuously classifying other configuration parameters of the data in the subsets obtained by secondary classification to obtain a plurality of subsets;
and by analogy, according to the difference of the nth attribute value, continuously classifying other configuration parameters of the data in the subsets obtained by n-1 times of classification to obtain a plurality of subsets.
A communication protocol conversion method, comprising:
judging whether an instruction for converting the second communication protocol into the first communication protocol is received; the configuration parameters of the data accessed to the second communication protocol comprise transmission types, and the transmission types of the data accessed to the second communication protocol are not uniform;
when the instruction is received, sending other configuration parameters of each item of data into a conversion channel corresponding to the transmission type according to different transmission types; the conversion channel is used for realizing data format conversion under a fixed transmission type;
leading configuration parameters output by the same conversion channel into the same set;
combining the sets into a set containing the transmission types of the data;
and analyzing the combined set to obtain data suitable for the first communication protocol.
Optionally, the transmission type is composed of a1 st attribute item to an nth attribute item, an attribute value of the ith attribute item is called as an ith attribute value, i is 1, 2, 3, …, n, and n is greater than or equal to 1; said combining sets into a set containing transmission types for said data items comprises:
combining the sets with the same value of the nth attribute into a set containing the nth attribute item;
combining the sets with the same n-1 attribute value in the sets obtained by the primary combination into a set containing the n-1 attribute item;
combining the sets with the same n-2 attribute value in the sets obtained by the secondary combination into a set containing the n-2 attribute item;
and by analogy, combining the sets with the same value of the 1 st attribute in the sets obtained by combining the n-1 times into a set containing the 1 st attribute item.
A communication protocol conversion method comprises k-1 item conversion steps, which are sequentially as follows: converting the communication protocol 1 into a communication protocol 2; converting communication protocol 2 into communication protocol 3; … …, respectively; converting a communication protocol k-1 into a communication protocol k, wherein k is more than or equal to 2;
the communication protocol 1, the communication protocol 2, the communication protocol 3, the communication protocol … … and the communication protocol k represent k different communication protocols;
any one of the conversion steps is any one of the communication protocol conversion methods as disclosed in the foregoing.
A communication protocol converter, comprising:
the device comprises a judging unit, a processing unit and a processing unit, wherein the judging unit is used for judging whether an instruction for converting a first communication protocol into a second communication protocol is received or not, and the transmission types of various items of data accessed to the first communication protocol are not uniform;
an importing unit, configured to import configuration parameters of the items of data into a same set when the instruction is received, where the configuration parameters include the transmission type;
a classifying unit, configured to classify other configuration parameters of the items of data in the set according to different transmission types to obtain a plurality of subsets corresponding to a single transmission type;
the format conversion unit is used for sending the subsets of different transmission types into a conversion channel corresponding to the transmission type, wherein the conversion channel is used for realizing data format conversion under a fixed transmission type;
the output unit is used for sending the signals output by the target conversion channel into a queue corresponding to the target conversion channel; the target conversion channel refers to a conversion channel of which the corresponding transmission type is the same as the transmission type supported by the second communication protocol; and outputting data by each queue according to the priority to obtain data suitable for the second communication protocol.
Optionally, the transmission type is composed of a1 st attribute item to an nth attribute item, an attribute value of the ith attribute item is called as an ith attribute value, i is 1, 2, 3, …, n, and n is greater than or equal to 1; the classification unit comprises a primary classification unit, a secondary classification unit, a tertiary classification unit, … and an n-1 secondary classification unit, wherein:
the primary classification unit is used for classifying other configuration parameters of the data in the set according to different 1 st attribute values to obtain a plurality of subsets;
the secondary classification unit is used for continuously classifying other configuration parameters of the data in the subsets obtained by the primary classification according to different attribute values of the No. 2 to obtain a plurality of subsets;
the third classification unit is used for continuously classifying other configuration parameters of the data in the subsets obtained by the second classification to obtain a plurality of subsets;
and in the same way, the n-1-time classification unit is used for continuously classifying other configuration parameters of the data in the subsets obtained by n-1-time classification according to different n-th attribute values to obtain a plurality of subsets.
A communication protocol converter, comprising:
the judging unit is used for judging whether an instruction for converting the second communication protocol into the first communication protocol is received or not; the configuration parameters of the data accessed to the second communication protocol comprise transmission types, and the transmission types of the data accessed to the second communication protocol are not uniform;
a format conversion unit, configured to send other configuration parameters of each item of data to a conversion channel corresponding to the transmission type according to the difference of the transmission types when receiving the instruction; the conversion channel is used for realizing data format conversion under a fixed transmission type;
the leading-in unit is used for leading the configuration parameters output by the same conversion channel into the same set;
a combination unit, configured to combine the sets into a set including transmission types of the data;
and the output unit is used for analyzing the combined set to obtain data suitable for the first communication protocol.
Optionally, the transmission type is composed of a1 st attribute item to an nth attribute item, an attribute value of the ith attribute item is called as an ith attribute value, i is 1, 2, 3, …, n, and n is greater than or equal to 1; the combination unit comprises a primary combination unit, a secondary combination unit, a tertiary combination unit, … and an n-1 secondary combination unit, wherein:
the primary combination unit is used for combining the sets with the same nth attribute value into a set containing the nth attribute item;
the secondary combination unit is used for combining the sets with the same n-1 attribute value in the sets obtained by primary combination into a set containing the n-1 attribute item;
the tertiary combination unit is used for combining the sets with the same n-2 attribute value in the sets obtained by secondary combination into a set containing the n-2 attribute item;
and in analogy, the n-1-time combination unit is used for combining the sets with the same 1 st attribute value in the sets obtained by n-1-time combination into a set containing the 1 st attribute item.
A communication protocol converter comprises k-1 conversion units, which are sequentially as follows: a first conversion unit, a second conversion unit, …, a k-1 conversion unit;
the first conversion unit is used for converting the communication protocol 1 into the communication protocol 2;
the second conversion unit is used for converting the communication protocol 2 into a communication protocol 3;
by analogy, the k-1 conversion unit is used for converting a communication protocol k-1 into a communication protocol k, wherein k is more than or equal to 2;
the communication protocol 1, the communication protocol 2, the communication protocol 3, the communication protocol … … and the communication protocol k represent k different communication protocols;
any one of the conversion units is any one of the communication protocol converters as disclosed in the foregoing.
According to the technical scheme, the data accessed to the first communication protocol are classified according to different transmission types, each type of data can be regarded as a communication protocol with a single transmission type, and the format conversion is respectively carried out on each type of data, so that the purpose of converting the format of the data accessed to the first communication protocol into the format agreed under another communication protocol is realized; and then, outputting the data which is subjected to format conversion and belongs to the transmission type supported by the other communication protocol according to the priority, so that the data suitable for the other communication protocol can be obtained, and the conversion of the communication protocol with multiple transmission types into any other communication protocol is completed.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a communication protocol conversion method according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for classifying sets in the communication protocol conversion method shown in fig. 1;
fig. 3 is a flowchart of another communication protocol conversion method according to an embodiment of the present invention;
fig. 4 is a flowchart of a method for combining sets in the communication protocol conversion method shown in fig. 3;
fig. 5 is a schematic structural diagram of a communication protocol converter according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a classification unit in the communication protocol converter shown in fig. 5;
fig. 7 is a schematic structural diagram of another communication protocol converter according to an embodiment of the present invention;
fig. 8 is a schematic diagram of a configuration of a combining unit in the communication protocol converter shown in fig. 7.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, an embodiment of the present invention discloses a communication protocol conversion method, including:
step S01: judging whether an instruction for converting a first communication protocol into a second communication protocol is received, wherein transmission types of various items of data accessed to the first communication protocol are not uniform; when the instruction is received, the flow proceeds to step S02, otherwise, the process loops to step S01.
Specifically, the transmission type of the data accessed to the first communication protocol reflects a manner in which the data is transmitted after the data is accessed to the first communication protocol. The transmission type comprises a plurality of attribute items, such as transmission modes, transmission basic units and the like, and different attribute items classify the transmission type according to different characteristics. Taking a data access communication protocol Modbus in a certain scene as an example, distinguishing the data access communication protocol Modbus according to transmission modes, wherein the transmission types of the data are divided into a polling mode, a circular uploading mode and a displacement uploading mode; the transmission types of data are classified into bit-wise transmission and value-wise transmission, which are distinguished by a transmission basic unit. The attribute values of the same item of data under the same attribute item are unique.
The transmission types of the data accessed to the first communication protocol are not uniform, and the fact that at least one item of data in the data accessed to the first communication protocol has an attribute value different from that of other data on at least one attribute item of the transmission type is meant. Still taking the scenario of data access to Modbus in the foregoing as an example, assume that four items of data, including voltage, current, time and power on/off, are accessed to Modbus in the current scenario, where the transmission type of the voltage data is polling mode + bit-wise transmission, the transmission type of the current data is polling mode + value-wise transmission, the transmission type of the time data is polling mode + bit-wise transmission, and the transmission type of the power on/off data is cyclic upload mode + bit-wise transmission, only the transmission types of the voltage data and the time data are the same, so the transmission types of the four items of data accessed to Modbus are not uniform.
In addition, the transmission types supported by the second communication protocol may or may not be unique.
Step S02: and importing configuration parameters of various items of data accessed to the first communication protocol into the same set, wherein the configuration parameters comprise the transmission type.
Specifically, the data access communication protocol needs to perform parameter configuration, where the configuration parameters at least include a transmission type of the data, parameters describing an actual value of the data, and the like (the parameters describing the actual value of the data include a register address, a coefficient, and the like, for example, if the register value of the data is 123, the coefficient is 0.1, and then the current value of the data is 12.3).
In this embodiment, the importing of the configuration parameters of each item of data accessed to the first communication protocol into the same set means that the configuration parameters of each item of data accessed to the first communication protocol are collected together, so that centralized processing is facilitated, and the collected content (i.e., the set) can be described in a matrix form or other forms. Still taking the scenario that four items of data, namely voltage, current, time and power on/off, are accessed to the Modbus in the foregoing as an example, the configuration parameters of the four items of data are respectively imported into different rows of the same matrix a, and the content format of the matrix a is as follows:
Figure BDA0001582446930000081
the matrix A is a 4-by-4 matrix, each row sequentially lists the transmission mode, the coefficient, the register address and the transmission basic unit of one item of data, and corresponding values are led into each element of the matrix A. It should be noted that the content format of the matrix a is modified differently according to the specific content of the Modbus, for example, the maximum value and the minimum value may be increased, the data type may be increased, and different configuration parameters such as a unit may be increased.
Step S03: and classifying other configuration parameters of the data in the set according to different transmission types to obtain a plurality of subsets corresponding to a single transmission type.
Specifically, still taking the matrix a obtained in the above scenario as an example, classifying the four items of data, i.e. voltage, current, time and power on/off, of other configuration parameters in the matrix a according to different transmission types, three sub-matrices (i.e. subsets described in the form of matrices) corresponding to a single transmission type are obtained, where the three sub-matrices are: the submatrix a1 for collectively describing coefficients of voltage, time data, and register addresses, the submatrix a2 for describing coefficients of current data and register addresses, and the submatrix A3 for describing coefficients of power on/off data and register addresses. The content formats of a1, a2, A3 are as follows:
Figure BDA0001582446930000082
a2 ═ coefficient register address
A3 ═ coefficient register address
Assuming that the transmission type of the data is composed of 1 st to nth attribute items, the attribute value of the ith attribute item is called as the ith attribute value, i is 1, 2, 3, …, n is a positive integer greater than or equal to 1, as shown in fig. 2, the step S03 specifically includes:
step S1: classifying other configuration parameters of the data in the set according to different 1 st attribute values to obtain a plurality of subsets;
step S2: according to the difference of the attribute values of the No. 2, continuously classifying other configuration parameters of the data in the subsets obtained by primary classification to obtain a plurality of subsets;
step S3: according to the difference of the 3 rd attribute values, continuously classifying other configuration parameters of the data in the subsets obtained by secondary classification to obtain a plurality of subsets;
… …, and so on;
step Sn: and according to the difference of the nth attribute values, continuously classifying other configuration parameters of the data in the subsets obtained by n-1 times of classification to obtain a plurality of subsets.
For example, still taking the matrix a obtained in the above scenario as an example, when n is 2, the transmission basic unit is defined as the 1 st attribute item, and the transmission mode is the 2 nd attribute item, then the matrix a has two different 1 st attribute values for bit-wise transmission and value-wise transmission, and has two different 2 nd attribute values for polling mode and cyclic uploading mode, then the implementation of the scheme shown in fig. 2 in the current scenario needs to be classified twice: the first classification is based on that the matrix A is firstly classified into two sub-matrices, namely a sub-matrix A4 for simultaneously and intensively describing coefficients of voltage data, time data and startup and shutdown data, register addresses and transmission modes, and a sub-matrix A2 for describing coefficients of current data, register addresses and transmission modes; the secondary classification is to continuously classify the sub-matrix a4 into two sub-matrices a1 and A3, so as to finally obtain sub-matrices a1, a2 and A3.
It can be seen that fig. 2 classifies the set attribute-item-by-attribute-item for each attribute item of a transmission type, so as to obtain a plurality of subsets having the same transmission type.
Step S04: sending the subsets of different transmission types into a conversion channel corresponding to the transmission type; the conversion channel is used for realizing data format conversion under a fixed transmission type.
Specifically, in this embodiment, according to different transmission types, other configuration parameters of each item of data with non-uniform transmission types under the first communication protocol are classified to obtain a plurality of subsets corresponding to a single transmission type, and each subset can be regarded as a communication protocol with a single transmission type, so that, in a general view, the format of data of various transmission types accessed to the first communication protocol is converted into a format agreed under the second communication protocol.
Step S05: sending the signal output by the target conversion channel into a queue corresponding to the target conversion channel; the target conversion channel refers to a conversion channel of which the corresponding transmission type is the same as the transmission type supported by the second communication protocol.
Specifically, in this embodiment, formats of data of various transmission types accessed to the first communication protocol can be converted into a format agreed under the second communication protocol, but the data applicable to the second communication protocol must be data of a transmission type supported by the second communication protocol, so a conversion channel required to be accessed to the queue is further selected according to the transmission type supported by the second communication protocol. Taking the small matrices a1, a2, and A3 classified in the above scenario as an example, assuming that Modbus needs to be converted into another communication protocol IEC104, and the transmission types supported by IEC104 are polling mode and cyclic uploading mode, the conversion channels accessed by the small matrices a1, a2, and A3 are all conversion channels that need to access queues when Modbus is converted into IEC104, that is, target conversion channels.
Step S06: and outputting data by each queue according to the priority to obtain data suitable for the second communication protocol.
Specifically, in order to comply with the output priority of data with different transmission types, in this embodiment, configuration parameters of data output by different target conversion channels are input into different queues, and each queue outputs data according to a set priority, so that data suitable for a second communication protocol is obtained, and thus conversion from a first communication protocol to the second communication protocol is completed.
As can be seen from the above description of the present embodiment, in the present embodiment, various data accessed to the first communication protocol are classified according to different transmission types, each type of data can be regarded as a communication protocol with a single transmission type, and format conversion is performed on each type of data, so that a format of data accessed to the first communication protocol is converted into a format agreed under another communication protocol; and then, outputting the data which is subjected to format conversion and belongs to the transmission type supported by the other communication protocol according to the priority, so that the data suitable for the other communication protocol can be obtained, and the conversion of the communication protocol with multiple transmission types into any other communication protocol is completed.
It should be noted that the communication protocol conversion process disclosed in the above embodiment is reversible, that is, the conversion of the second communication protocol into the first communication protocol can be realized by using the inverse process of the communication protocol conversion process disclosed in the above embodiment. The reverse process is shown in fig. 3 and includes:
step S11: judging whether an instruction for converting the second communication protocol into the first communication protocol is received; the configuration parameters of the data accessed to the second communication protocol comprise transmission types, and the transmission types of the data accessed to the second communication protocol are not uniform; when the instruction is received, the flow proceeds to step S12, otherwise, the process loops to step S11.
Step S12: when the instruction is received, sending other configuration parameters of each item of data into a conversion channel corresponding to the transmission type according to different transmission types; the conversion channel is used for realizing data format conversion under a fixed transmission type.
Specifically, the data accessing the second communication protocol already appoints the output priority of the data with different transmission types, so that other configuration parameters of each item of data accessing the second communication protocol are input into the corresponding conversion channel according to the priority.
Step S13: leading configuration parameters output by the same conversion channel into the same set, and combining the sets into a set containing the transmission types of the data;
step S14: and analyzing the combined set to obtain data suitable for the first communication protocol. The parsing is a form in which values restore data described in the form of a matrix to a message.
Optionally, if the transmission type of the data is composed of a1 st attribute item to an nth attribute item, an attribute value of an ith attribute item is referred to as an ith attribute value, i is 1, 2, 3, …, n, and n is a positive integer greater than or equal to 1, as shown in fig. 4, the combining the sets into one set including the transmission types of the data includes:
step S21: combining the sets with the same value of the nth attribute into a set containing the nth attribute item;
step S22: combining the sets with the same n-1 attribute value in the sets obtained by the primary combination into a set containing the n-1 attribute item;
step S23: combining the sets with the same n-2 attribute value in the sets obtained by the secondary combination into a set containing the n-2 attribute item;
… …, and so on;
step S2 n: and combining the sets with the same 1 st attribute value in the sets obtained by n-1 times of combination into a set containing the 1 st attribute item.
In the above embodiment, taking the inverse process of finally obtaining the sub-matrices a1, a2, and A3 based on the matrix a as an example, that is, in the current scenario, the sub-matrices a1, a2, and A3 need to be combined to obtain the matrix a, the implementation of the scheme shown in fig. 4 needs to be combined twice: the first combination is to combine the sub-matrices a1 and A3 into sub-matrix a4, and the second combination is to combine the sub-matrices a4 and a2 into sub-matrix a.
As can be seen from the above description of the two embodiments, the communication protocol conversion method shown in fig. 1 or fig. 3 can be used to implement conversion from one communication protocol to another, then communication protocol 1, communication protocol 2, communication protocol 3, … …, and communication protocol k are defined to represent k different communication rules, and when communication protocol 1 needs to be converted into communication protocol k, the communication protocol conversion method shown in fig. 1 or fig. 3 can be used to directly perform conversion, or can be indirectly implemented by setting a relay node.
The method is indirectly realized by setting a transfer node, and specifically comprises the following steps: converting the communication protocol 1 into a communication protocol 2; converting communication protocol 2 into communication protocol 3; … …, respectively; converting a communication protocol k-1 into a communication protocol k; any of which is converted into the communication protocol conversion method as shown in fig. 1 or fig. 3. Thus, in the case where the system has been provided with the function of converting communication protocol 1 into communication protocol 2, the function of converting communication protocol 2 into communication protocol 3, … …, and the function of converting communication protocol k-1 into communication protocol k, the conversion of communication protocol 1 into communication protocol k can be realized by calling these functions already provided, without having to recompile the function of converting communication protocol 1 into communication protocol k.
In addition, corresponding to the above method embodiment, an embodiment of the present invention further discloses a communication protocol converter, as shown in fig. 5, including:
a judging unit 100, configured to judge whether an instruction to convert a first communication protocol into a second communication protocol is received, where transmission types of items of data accessing the first communication protocol are not uniform;
an importing unit 200, configured to import configuration parameters of the items of data into the same set when the instruction is received, where the configuration parameters include the transmission type;
a classifying unit 300, configured to classify other configuration parameters of the items of data in the set according to different transmission types, so as to obtain a plurality of subsets corresponding to a single transmission type;
a format conversion unit 400, configured to send the subsets of different transmission types to a conversion channel corresponding to the transmission type, where the conversion channel is used to implement data format conversion under a fixed transmission type;
an output unit 500, configured to send a signal output by a target conversion channel into a queue corresponding to the target conversion channel; the target conversion channel refers to a conversion channel of which the corresponding transmission type is the same as the transmission type supported by the second communication protocol; and outputting data by each queue according to the priority to obtain data suitable for the second communication protocol.
Optionally, the transmission type is composed of a1 st attribute item to an nth attribute item, an attribute value of the ith attribute item is called as an ith attribute value, i is 1, 2, 3, …, n, and n is greater than or equal to 1; as shown in fig. 6, the classification unit 300 includes a primary classification unit, a secondary classification unit, a tertiary classification unit, …, and an n-1-degree classification unit, wherein:
the primary classification unit is used for classifying other configuration parameters of the data in the set according to different 1 st attribute values to obtain a plurality of subsets;
the secondary classification unit is used for continuously classifying other configuration parameters of the data in the subsets obtained by the primary classification according to different attribute values of the No. 2 to obtain a plurality of subsets;
the third classification unit is used for continuously classifying other configuration parameters of the data in the subsets obtained by the second classification to obtain a plurality of subsets;
and in the same way, the n-1-time classification unit is used for continuously classifying other configuration parameters of the data in the subsets obtained by n-1-time classification according to different n-th attribute values to obtain a plurality of subsets.
In addition, as shown in fig. 7, an embodiment of the present invention further discloses another communication protocol converter, including:
a judging unit 10 for judging whether an instruction to convert the second communication protocol into the first communication protocol is received; the configuration parameters of the data accessed to the second communication protocol comprise transmission types, and the transmission types of the data accessed to the second communication protocol are not uniform;
a format conversion unit 20, configured to send other configuration parameters of each item of data into a conversion channel corresponding to the transmission type according to the difference between the transmission types when receiving the instruction; the conversion channel is used for realizing data format conversion under a fixed transmission type;
an importing unit 30, configured to import configuration parameters output by the same conversion channel into the same set;
a combining unit 40, configured to combine the sets into a set including transmission types of the data;
and the output unit 50 is configured to parse the combined set to obtain data applicable to the first communication protocol.
Optionally, the transmission type is composed of a1 st attribute item to an nth attribute item, an attribute value of the ith attribute item is called as an ith attribute value, i is 1, 2, 3, …, n, and n is greater than or equal to 1; the combination unit 40 comprises a primary combination unit, a secondary combination unit, a tertiary combination unit, … and an n-1 secondary combination unit, wherein:
the primary combination unit is used for combining the sets with the same nth attribute value into a set containing the nth attribute item;
the secondary combination unit is used for combining the sets with the same n-1 attribute value in the sets obtained by primary combination into a set containing the n-1 attribute item;
the tertiary combination unit is used for combining the sets with the same n-2 attribute value in the sets obtained by secondary combination into a set containing the n-2 attribute item;
and in analogy, the n-1-time combination unit is used for combining the sets with the same 1 st attribute value in the sets obtained by n-1-time combination into a set containing the 1 st attribute item.
In addition, the embodiment of the invention also discloses another communication protocol converter, which comprises k-1 conversion units, and sequentially comprises the following components: a first conversion unit, a second conversion unit, …, a k-1 conversion unit;
the first conversion unit is used for converting the communication protocol 1 into the communication protocol 2;
the second conversion unit is used for converting the communication protocol 2 into a communication protocol 3;
by analogy, the k-1 conversion unit is used for converting a communication protocol k-1 into a communication protocol k, wherein k is more than or equal to 2;
the communication protocol 1, the communication protocol 2, the communication protocol 3, the communication protocol … … and the communication protocol k represent k different communication protocols;
any one of the conversion units is any one of the communication protocol converters as disclosed in the foregoing embodiments.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The communication protocol converter disclosed in the embodiment corresponds to the method disclosed in the embodiment, so that the description is simple, and the relevant points can be referred to the description of the method part.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, the use of the verb "comprise a" to define an element does not exclude the presence of another, identical element in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the embodiments. Thus, the present embodiments are not intended to be limited to the embodiments shown herein but are to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A communication protocol conversion method, comprising:
judging whether an instruction for converting a first communication protocol into a second communication protocol is received, wherein transmission types of various items of data accessed to the first communication protocol are not uniform; the transmission type of the data accessed to the communication protocol reflects the mode of transmitting the data after the data is accessed to the communication protocol; the transmission type comprises a plurality of attribute items, and the transmission type is classified by different attribute items according to different characteristics; the attribute values of the same item of data under the same attribute item are unique;
when the instruction is received, importing configuration parameters of the data into the same set, wherein the configuration parameters comprise the transmission type;
classifying other configuration parameters of the data in the set according to different transmission types to obtain a plurality of subsets corresponding to a single transmission type;
sending the subsets of different transmission types into a conversion channel corresponding to the transmission type, wherein the conversion channel is used for realizing data format conversion under a fixed transmission type;
sending the signal output by the target conversion channel into a queue corresponding to the target conversion channel; the target conversion channel refers to a conversion channel of which the corresponding transmission type is the same as the transmission type supported by the second communication protocol;
and outputting data by each queue according to the priority to obtain data suitable for the second communication protocol.
2. The communication protocol conversion method according to claim 1, wherein the transmission type is composed of 1 st to nth attribute items, the attribute value of the ith attribute item is referred to as the ith attribute value, i ═ 1, 2, 3, …, n ≧ 1; classifying other configuration parameters of the data in the set according to different transmission types to obtain a plurality of subsets corresponding to a single transmission type, including:
classifying other configuration parameters of the data in the set according to different 1 st attribute values to obtain a plurality of subsets;
according to the difference of the attribute values of the No. 2, continuously classifying other configuration parameters of the data in the subsets obtained by primary classification to obtain a plurality of subsets;
according to the difference of the 3 rd attribute values, continuously classifying other configuration parameters of the data in the subsets obtained by secondary classification to obtain a plurality of subsets;
and by analogy, according to the difference of the nth attribute value, continuously classifying other configuration parameters of the data in the subsets obtained by n-1 times of classification to obtain a plurality of subsets.
3. A communication protocol conversion method, comprising:
judging whether an instruction for converting the second communication protocol into the first communication protocol is received; the configuration parameters of the data accessed to the second communication protocol comprise transmission types, and the transmission types of the data accessed to the second communication protocol are not uniform; the transmission type of the data accessed to the communication protocol reflects the mode of transmitting the data after the data is accessed to the communication protocol; the transmission type comprises a plurality of attribute items, and the transmission type is classified by different attribute items according to different characteristics; the attribute values of the same item of data under the same attribute item are unique;
when the instruction is received, sending other configuration parameters of each item of data into a conversion channel corresponding to the transmission type according to different transmission types; the conversion channel is used for realizing data format conversion under a fixed transmission type;
leading configuration parameters output by the same conversion channel into the same set;
combining the sets into a set containing the transmission types of the data;
and analyzing the combined set to obtain data suitable for the first communication protocol.
4. The communication protocol conversion method according to claim 3, wherein the transmission type is composed of 1 st to nth attribute items, the attribute value of the ith attribute item is referred to as the ith attribute value, i ═ 1, 2, 3, …, n ≧ 1; said combining sets into a set containing transmission types for said data items comprises:
combining the sets with the same value of the nth attribute into a set containing the nth attribute item;
combining the sets with the same n-1 attribute value in the sets obtained by the primary combination into a set containing the n-1 attribute item;
combining the sets with the same n-2 attribute value in the sets obtained by the secondary combination into a set containing the n-2 attribute item;
and by analogy, combining the sets with the same value of the 1 st attribute in the sets obtained by combining the n-1 times into a set containing the 1 st attribute item.
5. A communication protocol conversion method is characterized by comprising k-1 conversion steps, which are sequentially as follows: converting the communication protocol 1 into a communication protocol 2; converting communication protocol 2 into communication protocol 3; … …, respectively; converting a communication protocol k-1 into a communication protocol k, wherein k is more than or equal to 2;
the communication protocol 1, the communication protocol 2, the communication protocol 3, the communication protocol … … and the communication protocol k represent k different communication protocols;
any one of the conversion steps is the communication protocol conversion method according to any one of claims 1 to 4.
6. A communication protocol converter, comprising:
the device comprises a judging unit, a processing unit and a processing unit, wherein the judging unit is used for judging whether an instruction for converting a first communication protocol into a second communication protocol is received or not, and the transmission types of various items of data accessed to the first communication protocol are not uniform; the transmission type of the data accessed to the communication protocol reflects the mode of transmitting the data after the data is accessed to the communication protocol; the transmission type comprises a plurality of attribute items, and the transmission type is classified by different attribute items according to different characteristics; the attribute values of the same item of data under the same attribute item are unique;
an importing unit, configured to import configuration parameters of the items of data into a same set when the instruction is received, where the configuration parameters include the transmission type;
a classifying unit, configured to classify other configuration parameters of the items of data in the set according to different transmission types to obtain a plurality of subsets corresponding to a single transmission type;
the format conversion unit is used for sending the subsets of different transmission types into a conversion channel corresponding to the transmission type, wherein the conversion channel is used for realizing data format conversion under a fixed transmission type;
the output unit is used for sending the signals output by the target conversion channel into a queue corresponding to the target conversion channel; the target conversion channel refers to a conversion channel of which the corresponding transmission type is the same as the transmission type supported by the second communication protocol; and outputting data by each queue according to the priority to obtain data suitable for the second communication protocol.
7. The communication protocol converter according to claim 6, wherein the transmission type is composed of 1 st to nth attribute items, the attribute value of the ith attribute item is referred to as the ith attribute value, i ═ 1, 2, 3, …, n ≧ 1; the classification unit comprises a primary classification unit, a secondary classification unit, a tertiary classification unit, … and an n-1 secondary classification unit, wherein:
the primary classification unit is used for classifying other configuration parameters of the data in the set according to different 1 st attribute values to obtain a plurality of subsets;
the secondary classification unit is used for continuously classifying other configuration parameters of the data in the subsets obtained by the primary classification according to different attribute values of the No. 2 to obtain a plurality of subsets;
the third classification unit is used for continuously classifying other configuration parameters of the data in the subsets obtained by the second classification to obtain a plurality of subsets;
and in the same way, the n-1-time classification unit is used for continuously classifying other configuration parameters of the data in the subsets obtained by n-1-time classification according to different n-th attribute values to obtain a plurality of subsets.
8. A communication protocol converter, comprising:
the judging unit is used for judging whether an instruction for converting the second communication protocol into the first communication protocol is received or not; the configuration parameters of the data accessed to the second communication protocol comprise transmission types, and the transmission types of the data accessed to the second communication protocol are not uniform; the transmission type of the data accessed to the communication protocol reflects the mode of transmitting the data after the data is accessed to the communication protocol; the transmission type comprises a plurality of attribute items, and the transmission type is classified by different attribute items according to different characteristics; the attribute values of the same item of data under the same attribute item are unique;
a format conversion unit, configured to send other configuration parameters of each item of data to a conversion channel corresponding to the transmission type according to the difference of the transmission types when receiving the instruction; the conversion channel is used for realizing data format conversion under a fixed transmission type;
the leading-in unit is used for leading the configuration parameters output by the same conversion channel into the same set;
a combination unit, configured to combine the sets into a set including transmission types of the data;
and the output unit is used for analyzing the combined set to obtain data suitable for the first communication protocol.
9. The communication protocol converter according to claim 8, wherein the transmission type is composed of 1 st to nth attribute items, the attribute value of the ith attribute item is referred to as the ith attribute value, i ═ 1, 2, 3, …, n ≧ 1; the combination unit comprises a primary combination unit, a secondary combination unit, a tertiary combination unit, … and an n-1 secondary combination unit, wherein:
the primary combination unit is used for combining the sets with the same nth attribute value into a set containing the nth attribute item;
the secondary combination unit is used for combining the sets with the same n-1 attribute value in the sets obtained by primary combination into a set containing the n-1 attribute item;
the tertiary combination unit is used for combining the sets with the same n-2 attribute value in the sets obtained by secondary combination into a set containing the n-2 attribute item;
and in analogy, the n-1-time combination unit is used for combining the sets with the same 1 st attribute value in the sets obtained by n-1-time combination into a set containing the 1 st attribute item.
10. A communication protocol converter, comprising k-1 conversion units, in order: a first conversion unit, a second conversion unit, …, a k-1 conversion unit;
the first conversion unit is used for converting the communication protocol 1 into the communication protocol 2;
the second conversion unit is used for converting the communication protocol 2 into a communication protocol 3;
by analogy, the k-1 conversion unit is used for converting a communication protocol k-1 into a communication protocol k, wherein k is more than or equal to 2;
the communication protocol 1, the communication protocol 2, the communication protocol 3, the communication protocol … … and the communication protocol k represent k different communication protocols;
any one of the conversion units is a communication protocol converter according to any one of claims 6-9.
CN201810159332.2A 2018-02-26 2018-02-26 Communication protocol conversion method and communication protocol converter Active CN108390877B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810159332.2A CN108390877B (en) 2018-02-26 2018-02-26 Communication protocol conversion method and communication protocol converter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810159332.2A CN108390877B (en) 2018-02-26 2018-02-26 Communication protocol conversion method and communication protocol converter

Publications (2)

Publication Number Publication Date
CN108390877A CN108390877A (en) 2018-08-10
CN108390877B true CN108390877B (en) 2020-08-28

Family

ID=63069215

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810159332.2A Active CN108390877B (en) 2018-02-26 2018-02-26 Communication protocol conversion method and communication protocol converter

Country Status (1)

Country Link
CN (1) CN108390877B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113923268B (en) * 2021-09-08 2023-11-14 山东信通电子股份有限公司 Resolution method, device and storage medium for multi-version communication protocol

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1758625A (en) * 2004-10-09 2006-04-12 华为技术有限公司 Method for classification processing message
CN202094884U (en) * 2011-05-18 2011-12-28 国网电力科学研究院 Protocol conversion device for supporting medium voltage power line carrier networking communication
CN102333031A (en) * 2011-09-07 2012-01-25 江苏润和软件股份有限公司 Device intelligent access system based on device adaptation technology, and method of the same
CN107357219A (en) * 2017-08-30 2017-11-17 江南大学 A kind of adaptive industrial gateway
EP2449417B1 (en) * 2009-06-30 2018-10-17 Telefonaktiebolaget LM Ericsson (publ) Method and arrangement handling pluggable modules and operating modes in a media converter system and pluggable module therefore

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1758625A (en) * 2004-10-09 2006-04-12 华为技术有限公司 Method for classification processing message
EP2449417B1 (en) * 2009-06-30 2018-10-17 Telefonaktiebolaget LM Ericsson (publ) Method and arrangement handling pluggable modules and operating modes in a media converter system and pluggable module therefore
CN202094884U (en) * 2011-05-18 2011-12-28 国网电力科学研究院 Protocol conversion device for supporting medium voltage power line carrier networking communication
CN102333031A (en) * 2011-09-07 2012-01-25 江苏润和软件股份有限公司 Device intelligent access system based on device adaptation technology, and method of the same
CN107357219A (en) * 2017-08-30 2017-11-17 江南大学 A kind of adaptive industrial gateway

Also Published As

Publication number Publication date
CN108390877A (en) 2018-08-10

Similar Documents

Publication Publication Date Title
CN111181873B (en) Data transmission method, data transmission device, storage medium and electronic equipment
CN109309736A (en) The generation method and generating means of globally unique ID
CN111831748A (en) Data synchronization method, device and storage medium
WO2023143264A1 (en) Data compression method and apparatus
CN108390877B (en) Communication protocol conversion method and communication protocol converter
EP2681872B1 (en) Event monitoring devices and methods
EP3716531A1 (en) Method and controller for configuring nodes in an industrial network
CN111385815A (en) Method, device, equipment and medium for optimizing cell network resources
CN116233200B (en) Electric energy meter communication method and system based on subsequent frame dynamic registration
Chen et al. Design and analysis of multiple token ring networks
CN112328518A (en) Multi-channel serial communication device, system and method
WO2012159485A1 (en) Method and device for reporting and analyzing data
CN111031044A (en) Message analysis hardware device and message analysis method
CN109656984A (en) Data rule management system, method and apparatus
CN115580546B (en) Data subscription method and device, electronic equipment and readable storage medium
CN115643558B (en) Data processing method and device, electronic equipment and storage medium
CN114285784B (en) Data transmission and pipeline construction method, device, computing equipment and storage medium
CN111064727B (en) High-performance software analysis method for frame format streaming signal data
WO2024066811A1 (en) Resource configuration method and apparatus
US20160150553A1 (en) Method for managing periodic packets, server and network equipment
CN113821361B (en) Internet of things platform message processing method and system based on streaming processing
CN115296943B (en) Message broadcasting method, device, server and storage medium
CN112600702B (en) Data transmission method, device, system and storage medium based on competition mechanism
WO2022206940A1 (en) Indication method and apparatus, first node, second node, and storage medium
CN116049174A (en) Electric power internet of things node information forwarding method and device and wireless node

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