CN113783902B - Communication conversion method and device suitable for communication among different devices - Google Patents
Communication conversion method and device suitable for communication among different devices Download PDFInfo
- Publication number
- CN113783902B CN113783902B CN202111351034.1A CN202111351034A CN113783902B CN 113783902 B CN113783902 B CN 113783902B CN 202111351034 A CN202111351034 A CN 202111351034A CN 113783902 B CN113783902 B CN 113783902B
- Authority
- CN
- China
- Prior art keywords
- communication
- data
- data packet
- configuration information
- information
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/08—Protocols for interworking; Protocol conversion
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/24—Negotiation of communication capabilities
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)
Abstract
The invention discloses a communication conversion method and a device suitable for communication among different devices, wherein the method comprises the following steps: when the sending equipment communicates with the receiving equipment, first configuration information and second configuration information are obtained; generating an equipment connection object with a uniform interface, and establishing communication between sending equipment and receiving equipment; when the sending equipment sends a data packet through the established communication, acquiring first parameter information to enable the data of the data packet to be embodied as embodied data, and extracting the receiving equipment from the first parameter information; second parameter information is obtained and the avatar data is translated into a translation data packet for identification by the receiving device. The communication conversion method and the communication conversion device suitable for communication among different devices can be adapted to different communication modes and communication protocols among the devices extremely, the development efficiency can be effectively improved, the development work can be reduced, and the module design in a unified mode is very convenient to expand.
Description
Technical Field
The invention relates to the technical field of industrial automation, in particular to equipment information acquisition through communication and data exchange between equipment in the field of automation.
Background
Under the large background that the country greatly promotes the upgrading and the transformation of the manufacturing industry, each large manufacturing factory promotes the construction of the intelligent factory, improves the utilization rate of automatic equipment and the traceability of produced products, and realizes the informatization of an automatic production line and the like. The realization foundation is that various types of production equipment can communicate according to the needs to complete the exchange of required data, and the intelligent factory construction is realized through an informatization foundation. The equipment of the manufacturing plant is various, originates from different equipment suppliers, and uses different communication modes and communication protocols with each other. Especially in the field of nonstandard automation equipment, each supply merchant and even each equipment development engineer have own communication preference. Due to the reasons, the communication and data exchange among the devices are very difficult, and the automation and the informatization of the production line are not facilitated.
The current common solution is to develop different communication conversion modules with pertinence to adapt to different communication modes and communication protocols between devices. Therefore, in response to such a situation, the development engineer needs to spend a lot of time, cost and effort to implement communication and data exchange with various devices, and needs to redevelop compilation deployment when new or modified exchange data is added or modified.
In order to solve the above problems, an adaptive communication conversion module is proposed, which can adapt to different communication modes and communication protocols between devices, effectively improve the development efficiency and reduce the development work, and the unified module design mode is very convenient to expand. Aiming at the addition and modification of communication exchange data, the new data exchange requirement can be realized by simply adjusting the parameters of the module without redeveloping, compiling and deploying.
Disclosure of Invention
The technical problem to be solved by the present invention is to develop different communication conversion modules to adapt to different communication modes and communication protocols between different devices, which is costly, and to provide a communication conversion method and apparatus suitable for communication between different devices, so as to solve the above problems.
The invention is realized by the following technical scheme:
in one aspect.
A communication conversion method suitable for communication between different devices comprises the following steps:
when communication is carried out between sending equipment and receiving equipment, acquiring connection configuration information of the sending equipment as first configuration information, and acquiring connection configuration information of the receiving equipment as second configuration information;
generating an equipment connection object with a unified interface according to the corresponding relation between the first configuration information and the second configuration information inquired from a communication mode support library, and establishing communication between the sending equipment and the receiving equipment according to the equipment connection object;
when sending equipment sends a data packet through established communication, acquiring information communication data packet configuration of the sending equipment as first parameter information;
according to the first parameter information, the data of the data packet is embodied as embodied data, and a receiving object of the data packet is extracted from the first parameter information to serve as receiving equipment;
acquiring communication protocol configuration information of the receiving equipment as second parameter information, and translating the image data into a translation data packet for the receiving equipment to identify according to the second parameter information;
transmitting the translation data packet to the receiving device.
In the prior art, the communication protocol conversion method or device is mostly directed to an application scenario where 1 to many pre-configured communication systems correspond to N third-party communication system protocols and the communication mode is not changed, or a method for converting a single communication protocol. However, in practice, the inventor finds that, because of different equipment suppliers, the communication modes and the communication protocols used in communication of non-standard automation equipment generally have different differences, which is a main reason why communication conversion modules need to be developed separately between the non-standard automation equipment, if the communication protocol conversion method in the prior art is adopted, 1 to more communication conversion modules need to be developed for each equipment, and the difficulty in developing the communication conversion modules caused by different communication modes is not realized in the prior art.
In this embodiment, in order to apply this embodiment to a scenario of many-to-many communication, a communication method support library is adopted to adapt to different communication methods among devices, and a method of translating a packet according to a translation rule is adopted to implement data exchange under different communication protocols.
In this embodiment, for the conversion of the communication method, the first configuration information represents connection configuration information of the sending device corresponding to the communication method, and the second configuration information represents connection configuration information of the receiving device corresponding to the communication method. The communication mode support library is generated through the following processes: the supporting files for communication between different communication modes are pre-configured to form a communication mode supporting library. It should be understood that, as a preferred exemplary scheme, connection characteristics may be described by an exhaustive method according to specific attributes of different communication modes, so as to form a supporting relationship between the different communication modes. By inquiring the corresponding relation between the first configuration information and the second configuration information in the communication mode support library, the equipment connection object with the uniform interface can be generated according to the inquired content, and communication between the equipment is established based on the equipment connection object.
Illustratively, the establishing of the communication mode support library includes:
obtaining description parameters of various communication modes;
pairing the description parameters of any two communication modes to form a communication support file;
and summarizing the communication support files to form the communication mode support library.
Generating the device connection object of the unified interface according to the corresponding relation between the first configuration information and the second configuration information inquired from the communication mode support library, wherein the device connection object comprises:
and inquiring a communication support file corresponding to the first configuration information and the second configuration information from the communication mode support library to generate a connection object with a uniform interface mode.
In order to further realize communication between devices, communication protocols of different devices need to be coordinated. In practice, the inventor finds that, for different communication protocols, not only the coordination of protocol parameters but also the translation of the communicated data packets are needed, so in this embodiment, for the conversion of the communication protocols, the data of the data packets are represented as the embodied data, which is referred to herein as the content specifically referred to by the data in the data packets, for example, the a device represents an OK signal by the letter "a" when sending the data packets, which is advantageous in that, for different devices, regardless of the logic rules in the data packets, the transcoding of the data packets can be realized by using the embodied data as intermediate data. In this embodiment, it is further required to extract a receiving object of the data packet from the first parameter information as a receiving device, and then obtain the communication protocol configuration information of the receiving device to translate the object data to implement translation and transmission of the data packet. The embodiment can be adapted to different communication modes and communication protocols among equipment, the development efficiency can be effectively improved, the development work is reduced, and the module design of the unified mode is very convenient to expand. Aiming at the addition and modification of communication exchange data, the new data exchange requirement can be realized by simply adjusting the parameters of the module without redeveloping, compiling and deploying. Effectively solved different equipment N: the problems of incompatible N communication, difficult data exchange, low development efficiency and repeated development, compilation and deployment.
Furthermore, a uniform connection interface is established for different communication modes; the connection interface specifies the input and output interfaces for connection attributes and data.
Further, generating the device connection object of the unified interface according to the correspondence between the first configuration information and the second configuration information queried from the communication mode support library includes:
and when the corresponding relation between the first configuration information and the second configuration information cannot be inquired from the communication mode support library, establishing a configuration file according to the corresponding relation and newly adding the configuration file to the communication mode support library.
Further, translating the avatar data into a translation data packet for the receiving device to recognize according to the second parameter information comprises:
extracting the corresponding relation between the specific image data and the data in the translation data packet from the second parameter information;
and acquiring a communication protocol logic rule according to the type of the corresponding relation, and translating the image-bearing data into data of a translation data packet according to the communication protocol logic rule and the corresponding relation.
Further, the communication protocol logic rule is a logic conversion rule of the avatar data and the data in the data packet;
acquiring a communication protocol logic rule according to the type of the corresponding relationship, and translating the object-bearing data into data of a translation data packet according to the communication protocol logic rule and the corresponding relationship, wherein the data comprises:
acquiring classification information of the data packet content, wherein the classification information is a data classification type based on a programming language;
selecting the category of the communication protocol logic rule according to the classification information;
and selecting a corresponding communication protocol logic rule from the categories.
In one aspect:
a communication conversion device suitable for communication between different devices comprises:
a communication connection module configured to provide a connection between two devices when the two devices communicate;
a communication protocol conversion module configured to provide protocol conversion and packet translation when two devices communicate;
the communication connection module includes:
the communication parameter configuration module is configured to acquire connection configuration information of a sending device as first configuration information and acquire connection configuration information of a receiving device as second configuration information when the sending device communicates with the receiving device;
the communication connection conversion module is configured to generate an equipment connection object with a unified interface according to the corresponding relation between the first configuration information and the second configuration information inquired from the communication mode support library;
the communication connection execution module is configured to establish communication between the sending device and the receiving device according to the device connection object;
the communication protocol conversion module comprises:
the communication data packet configuration module is configured to acquire information communication data packet configuration of a sending device as first parameter information when the sending device sends a data packet through established communication; according to the first parameter information, the data of the data packet is embodied as embodied data, and a receiving object of the data packet is extracted from the first parameter information to serve as receiving equipment;
a protocol conversion executing module configured to acquire communication protocol configuration information of the receiving device as second parameter information, and convert the avatar data into a conversion data packet for the receiving device to recognize according to the second parameter information; transmitting the translation data packet to the receiving device.
Further, the method also comprises the following steps:
the connection interface is configured to be an input/output interface which provides uniform connection attributes and data for different communication modes.
Further, the communication connection conversion module is configured to, when the correspondence between the first configuration information and the second configuration information cannot be queried from the communication method support library, establish a configuration file according to the correspondence and newly add the configuration file to the communication method support library.
Further, the method also comprises the following steps:
the data conversion rule module is configured with a plurality of communication protocol logic rules;
a communication protocol configuration module configured to extract a corresponding relationship between the avatar data and data in the translation data packet from the second parameter information; and acquiring a communication protocol logic rule according to the type of the corresponding relation, and translating the image-bearing data into data of a translation data packet according to the communication protocol logic rule and the corresponding relation.
Further, the communication protocol configuration module acquires classification information of the data packet content, wherein the classification information is a data classification type based on a programming language;
the communication protocol configuration module selects the category of the communication protocol logic rule according to the classification information;
and the communication protocol configuration module selects the corresponding communication protocol logic rule of the category from the data conversion rule module.
Compared with the prior art, the invention has the following advantages and beneficial effects:
the communication conversion method and the communication conversion device suitable for communication among different devices can be adapted to different communication modes and communication protocols among the devices extremely, the development efficiency can be effectively improved, the development work can be reduced, and the module design in a unified mode is very convenient to expand. Aiming at the addition and modification of communication exchange data, the new data exchange requirement can be realized by simply adjusting the parameters of the module without redeveloping, compiling and deploying. Effectively solved different equipment N: the problems of incompatible N communication, difficult data exchange, low development efficiency and repeated development, compilation and deployment.
Drawings
The accompanying drawings, which are included to provide a further understanding of the embodiments of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the principles of the invention. In the drawings:
FIG. 1 is a schematic diagram of the method steps of an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to examples and accompanying drawings, and the exemplary embodiments and descriptions thereof are only used for explaining the present invention and are not meant to limit the present invention.
Example (b):
referring to fig. 1, a flow chart of a communication conversion method suitable for communication between different devices according to an embodiment of the present invention is shown, where the communication conversion method suitable for communication between different devices can be applied to the communication conversion apparatus suitable for communication between different devices in fig. 2, and further, the communication conversion method suitable for communication between different devices specifically includes the following contents described in steps S1-S6.
S1: when communication is carried out between sending equipment and receiving equipment, acquiring connection configuration information of the sending equipment as first configuration information, and acquiring connection configuration information of the receiving equipment as second configuration information;
s2: generating an equipment connection object with a unified interface according to the corresponding relation between the first configuration information and the second configuration information inquired from a communication mode support library, and establishing communication between the sending equipment and the receiving equipment according to the equipment connection object;
s3: when sending equipment sends a data packet through established communication, acquiring information communication data packet configuration of the sending equipment as first parameter information;
s4: according to the first parameter information, the data of the data packet is embodied as embodied data, and a receiving object of the data packet is extracted from the first parameter information to serve as receiving equipment;
s5: acquiring communication protocol configuration information of the receiving equipment as second parameter information, and translating the image data into a translation data packet for the receiving equipment to identify according to the second parameter information;
s6: transmitting the translation data packet to the receiving device.
In this embodiment, in order to apply this embodiment to a scenario of many-to-many communication, a communication method support library is adopted to adapt to different communication methods among devices, and a method of translating a packet according to a translation rule is adopted to implement data exchange under different communication protocols.
In this embodiment, for the conversion of the communication method, the first configuration information represents connection configuration information of the sending device corresponding to the communication method, and the second configuration information represents connection configuration information of the receiving device corresponding to the communication method. The communication mode support library is generated through the following processes: the supporting files for communication between different communication modes are pre-configured to form a communication mode supporting library. It should be understood that, as a preferred exemplary scheme, connection characteristics may be described by an exhaustive method according to specific attributes of different communication modes, so as to form a supporting relationship between the different communication modes. By inquiring the corresponding relation between the first configuration information and the second configuration information in the communication mode support library, the equipment connection object with the uniform interface can be generated according to the inquired content, and communication between the equipment is established based on the equipment connection object.
Illustratively, the establishing of the communication mode support library includes:
obtaining description parameters of various communication modes;
pairing the description parameters of any two communication modes to form a communication support file;
and summarizing the communication support files to form the communication mode support library.
Generating the device connection object of the unified interface according to the corresponding relation between the first configuration information and the second configuration information inquired from the communication mode support library, wherein the device connection object comprises:
and inquiring a communication support file corresponding to the first configuration information and the second configuration information from the communication mode support library to generate a connection object with a uniform interface mode.
In order to further realize communication between devices, communication protocols of different devices need to be coordinated. In practice, the inventor finds that, for different communication protocols, not only the coordination of protocol parameters but also the translation of the communicated data packets are needed, so in this embodiment, for the conversion of the communication protocols, the data of the data packets are represented as the embodied data, which is referred to herein as the content specifically referred to by the data in the data packets, for example, the a device represents an OK signal by the letter "a" when sending the data packets, which is advantageous in that, for different devices, regardless of the logic rules in the data packets, the transcoding of the data packets can be realized by using the embodied data as intermediate data. In this embodiment, it is further required to extract a receiving object of the data packet from the first parameter information as a receiving device, and then obtain the communication protocol configuration information of the receiving device to translate the object data to implement translation and transmission of the data packet. The embodiment can be adapted to different communication modes and communication protocols among equipment, the development efficiency can be effectively improved, the development work is reduced, and the module design of the unified mode is very convenient to expand. Aiming at the addition and modification of communication exchange data, the new data exchange requirement can be realized by simply adjusting the parameters of the module without redeveloping, compiling and deploying. Effectively solved different equipment N: the problems of incompatible N communication, difficult data exchange, low development efficiency and repeated development, compilation and deployment.
In one embodiment, when any device sends a data packet to a plurality of devices, communication between the current device and the plurality of devices is established;
when the current equipment sends a data packet through the established communication, sequencing the obtained multiple receiving objects according to a sending sequence, and writing a sequencing result into a communication sequence list;
and reading the communication sequence list in a polling mode, translating the read data packet corresponding to the receiving object, and sending the translated data packet to the read receiving object.
In this embodiment, a many-to-many communication scheme implemented by a communication sequence table is provided, and it should be understood that although the communication sequence table is read in a polling manner in the present application, a receiving object in the communication sequence table may be obtained in a multi-thread reading manner or a manner of directly monitoring the communication sequence table in the prior art; in this way, every time transmission of a packet is performed, translation is less prone to errors, and packet transmission efficiency can be ensured.
In one embodiment, a uniform connection interface is established for different communication modes; the connection interface specifies the input and output interfaces for connection attributes and data.
When the embodiment is implemented, the unified connection interface can specify the input/output port of the connection attribute and the data, and the specification of the connection attribute and the data refers to the unification of the interfaces of different communication modes.
In one embodiment, generating the device connection object of the unified interface according to the correspondence between the first configuration information and the second configuration information queried from the communication method support library includes:
and when the corresponding relation between the first configuration information and the second configuration information cannot be inquired from the communication mode support library, establishing a configuration file according to the corresponding relation and newly adding the configuration file to the communication mode support library.
When the embodiment is implemented, the method has strong usability, and when the pre-configured communication mode file in the communication mode support library is insufficient, other modules or the current module do not need to be modified, and only the configuration file is newly added to the module according to the unified interface design.
In one embodiment, translating the avatar data into a translation data packet for identification by the receiving apparatus according to the second parameter information comprises:
extracting the corresponding relation between the specific image data and the data in the translation data packet from the second parameter information;
and acquiring a communication protocol logic rule according to the type of the corresponding relation, and translating the image-bearing data into data of a translation data packet according to the communication protocol logic rule and the corresponding relation.
In this embodiment, the inventor finds that if the translation is simply performed through the second parameter information, the translation efficiency is low, so that a communication protocol logic rule is formulated in this embodiment for translating the data packet, where the communication protocol logic rule is obtained based on a type having a correspondence between data and data in the translated data packet, where the type refers to a correspondence between different data types, such as a correspondence between numeric data and text data, and a correspondence between boolean data and text data, and by determining these correspondences and selecting an appropriate communication protocol logic rule, the conversion between different communication protocols can be well adapted, so as to improve the efficiency.
For example, the device communication data "a" represents an OK signal, and the device communication data "1" is considered as an OK signal, and the data translation rule module has a customized rule a: a corresponds to 1, and the customization rule b is: 1 corresponds to a, the communication protocol configuration module configures the received a device data "a" of the device B with the translation rule a, and configures the received B device data "1" of the device a with the translation rule B, so that the A, B device can accurately identify the OK signals of both parties; in this example, it is shown that the data request of the a device can be accurately identified and responded by the B device, and the a device can also accurately identify and receive the response data of the B device, although the A, B devices use different communication methods and communication protocols.
In one embodiment, the communication protocol logic rule is a logic conversion rule between the avatar data and the data in the data packet;
acquiring a communication protocol logic rule according to the type of the corresponding relationship, and translating the object-bearing data into data of a translation data packet according to the communication protocol logic rule and the corresponding relationship, wherein the data comprises:
acquiring classification information of the data packet content, wherein the classification information is a data classification type based on a programming language;
selecting the category of the communication protocol logic rule according to the classification information;
and selecting a corresponding communication protocol logic rule from the categories.
In this embodiment, in order to further improve the translation efficiency, the translation of the packet content is implemented by using the classified communication protocol logic rules, the classification information of the packet content is based on the data classification type of the programming language, for example, for C + +, the data type may be classified into data of boolean type, character type, shaping type, floating point type, double floating point type, and the like, and based on the communication protocol logic rules after the classification, an appropriate communication protocol logic rule may be selected to directly translate the packet, thereby improving the translation efficiency.
For example, obtaining a communication protocol logic rule according to the type of the correspondence, and translating the object data into data of a translation data packet according to the communication protocol logic rule and the correspondence includes:
acquiring trigger bit data from the data packet;
extracting the corresponding relation between the position of the data in the data packet and the trigger position from the communication protocol logic rule, and extracting the data from the data packet according to the corresponding relation;
and when the data packet content is in a digital type, calculating the data packet content through the communication protocol logic rule corresponding to the digital type to generate a translation data packet.
As an example, the communication protocol logic rules mainly include:
1. all characters are input in an English half-corner state;
2. true and false are both valid in the lower case input state, and are only judged in the trigger bit, and meanwhile, the trigger bit is an item that the instruction must have, and the first bit is the trigger bit;
3. the reference data number refers to the number of the feedback data of the visual program when the PLC is written, and refers to the number of the PLC data when the PLC is read, and the data number is counted from 0;
4. the left side is input needing conversion, and the right side is an instruction meeting the condition for output;
5. "indicating interval, using when several instructions need to make output conversion"; "separating, end not inputting";
6. reference data number-9999, indicating a direct output translation instruction;
7. if the number of the reference data is not-9999 and the translation instruction is null, directly outputting the data corresponding to the number of the reference data;
8. the reference data number being negative greater than-9999, indicating that the data directly references the inverse digit of the original translation data, e.g. reference number-3, reference the third-to-last digit
9. The method comprises the following steps of using 1^16:1 to indicate that data input into the data with the data being more than or equal to 1 and less than or equal to 16 are translated into 1, and using 17:2 to indicate that the data input into the data with the data being more than or equal to 17 is translated into 2;
10. using False + 4, > =,11111000:3, "+" with the left side being the value of the current input data [ equal to ], the right side being the reference data number that needs to be judged at the same time, the two following "," between is the judgment operator, followed by the value compared with the operator, the operators that can be performed are: ! =, > =, <. The meaning of this translation rule is: when the current reference data input is False and the corresponding reference data number is 4 data > =1111000, the output instruction is 3. The situation that two reference data are judged simultaneously is only supported at present;
11. when the input data and the output command are in a data type, the input data is subjected to the operation result of (input data-standard value) × proportionality coefficient + compensation value) to be the output value.
Based on the same inventive concept, please refer to fig. 2, further providing a communication conversion apparatus suitable for communication between different devices, the apparatus includes a communication connection module and a communication protocol conversion module, wherein:
a communication connection module configured to provide a connection between two devices when the two devices communicate;
a communication protocol conversion module configured to provide protocol conversion and packet translation when two devices communicate;
the communication connection module includes:
the communication parameter configuration module is configured to acquire connection configuration information of a sending device as first configuration information and acquire connection configuration information of a receiving device as second configuration information when the sending device communicates with the receiving device;
the communication connection conversion module is configured to generate an equipment connection object with a unified interface according to the corresponding relation between the first configuration information and the second configuration information inquired from the communication mode support library;
the communication connection execution module is configured to establish communication between the sending device and the receiving device according to the device connection object;
the communication protocol conversion module comprises:
the communication data packet configuration module is configured to acquire information communication data packet configuration of a sending device as first parameter information when the sending device sends a data packet through established communication; according to the first parameter information, the data of the data packet is embodied as embodied data, and a receiving object of the data packet is extracted from the first parameter information to serve as receiving equipment;
a protocol conversion executing module configured to acquire communication protocol configuration information of the receiving device as second parameter information, and convert the avatar data into a conversion data packet for the receiving device to recognize according to the second parameter information; transmitting the translation data packet to the receiving device.
In one embodiment, further comprising:
the connection interface is configured to be an input/output interface which provides uniform connection attributes and data for different communication modes.
In an embodiment, the communication connection conversion module is further configured to, when the correspondence between the first configuration information and the second configuration information cannot be queried from the communication method support library, establish a configuration file according to the correspondence and add the configuration file to the communication method support library.
In one embodiment, further comprising:
the data conversion rule module is configured with a plurality of communication protocol logic rules;
a communication protocol configuration module configured to extract a corresponding relationship between the avatar data and data in the translation data packet from the second parameter information; and acquiring a communication protocol logic rule according to the type of the corresponding relation, and translating the image-bearing data into data of a translation data packet according to the communication protocol logic rule and the corresponding relation.
In one embodiment, the communication protocol configuration module obtains classification information of the data packet content, wherein the classification information is a data classification type based on a programming language;
the communication protocol configuration module selects the category of the communication protocol logic rule according to the classification information;
and the communication protocol configuration module selects the corresponding communication protocol logic rule of the category from the data conversion rule module.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may also be an electric, mechanical or other form of connection.
The elements described as separate parts may or may not be physically separate, as one of ordinary skill in the art would appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general sense in the foregoing description for clarity of explanation of the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a grid device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are merely exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.
Claims (6)
1. A communication conversion method suitable for communication between different devices is characterized by comprising the following steps:
when communication is carried out between sending equipment and receiving equipment, acquiring connection configuration information of the sending equipment as first configuration information, and acquiring connection configuration information of the receiving equipment as second configuration information;
generating an equipment connection object with a unified interface according to the corresponding relation between the first configuration information and the second configuration information inquired from a communication mode support library, and establishing communication between the sending equipment and the receiving equipment according to the equipment connection object;
when sending equipment sends a data packet through established communication, acquiring information communication data packet configuration of the sending equipment as first parameter information;
according to the first parameter information, the data of the data packet is embodied as embodied data, and a receiving object of the data packet is extracted from the first parameter information to serve as receiving equipment;
acquiring communication protocol configuration information of the receiving equipment as second parameter information, and translating the image data into a translation data packet for the receiving equipment to identify according to the second parameter information;
sending the translation data packet to the receiving device;
translating the avatar data into a translation data packet for identification by the receiving apparatus according to the second parameter information comprises:
extracting the corresponding relation between the specific image data and the data in the translation data packet from the second parameter information;
acquiring a communication protocol logic rule according to the type of the corresponding relation, and translating the object-bearing data into data of a translation data packet according to the communication protocol logic rule and the corresponding relation;
the communication protocol logic rule is a logic conversion rule of the avatar data and the data in the data packet;
acquiring a communication protocol logic rule according to the type of the corresponding relationship, and translating the object-bearing data into data of a translation data packet according to the communication protocol logic rule and the corresponding relationship, wherein the data comprises:
acquiring classification information of the data packet content, wherein the classification information is a data classification type based on a programming language;
selecting the category of the communication protocol logic rule according to the classification information;
and selecting a corresponding communication protocol logic rule from the categories.
2. The communication conversion method for communication between different devices as claimed in claim 1, wherein a uniform connection interface is established for different communication modes; the connection interface specifies the input and output interfaces for connection attributes and data.
3. The communication conversion method according to claim 1, wherein generating the device connection object of the unified interface according to the correspondence between the first configuration information and the second configuration information queried from the communication method support library comprises:
and when the corresponding relation between the first configuration information and the second configuration information cannot be inquired from the communication mode support library, establishing a configuration file according to the corresponding relation and newly adding the configuration file to the communication mode support library.
4. A communication switching apparatus adapted to communicate between different devices, comprising:
a communication connection module configured to provide a connection between two devices when the two devices communicate;
a communication protocol conversion module configured to provide protocol conversion and packet translation when two devices communicate;
the communication connection module includes:
the communication parameter configuration module is configured to acquire connection configuration information of a sending device as first configuration information and acquire connection configuration information of a receiving device as second configuration information when the sending device communicates with the receiving device;
the communication connection conversion module is configured to generate an equipment connection object with a unified interface according to the corresponding relation between the first configuration information and the second configuration information inquired from the communication mode support library;
the communication connection execution module is configured to establish communication between the sending device and the receiving device according to the device connection object;
the communication protocol conversion module comprises:
the communication data packet configuration module is configured to acquire information communication data packet configuration of a sending device as first parameter information when the sending device sends a data packet through established communication; according to the first parameter information, the data of the data packet is embodied as embodied data, and a receiving object of the data packet is extracted from the first parameter information to serve as receiving equipment;
a protocol conversion executing module configured to acquire communication protocol configuration information of the receiving device as second parameter information, and convert the avatar data into a conversion data packet for the receiving device to recognize according to the second parameter information; sending the translation data packet to the receiving device;
further comprising:
the data conversion rule module is configured with a plurality of communication protocol logic rules;
a communication protocol configuration module configured to extract a corresponding relationship between the avatar data and data in the translation data packet from the second parameter information; acquiring a communication protocol logic rule according to the type of the corresponding relation, and translating the object-bearing data into data of a translation data packet according to the communication protocol logic rule and the corresponding relation;
the communication protocol logic rule is a logic conversion rule of the avatar data and the data in the data packet;
the communication protocol configuration module acquires classification information of the data packet content, wherein the classification information is a data classification type based on a programming language;
the communication protocol configuration module selects the category of the communication protocol logic rule according to the classification information;
and the communication protocol configuration module selects the corresponding communication protocol logic rule of the category from the data conversion rule module.
5. The communication conversion apparatus according to claim 4, further comprising:
the connection interface is configured to be an input/output interface which provides uniform connection attributes and data for different communication modes.
6. The communication conversion apparatus according to claim 4, wherein the communication connection conversion module is further configured to establish a configuration file according to the correspondence relationship and add the configuration file to the communication mode support library when the correspondence relationship between the first configuration information and the second configuration information cannot be queried from the communication mode support library.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111351034.1A CN113783902B (en) | 2021-11-16 | 2021-11-16 | Communication conversion method and device suitable for communication among different devices |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111351034.1A CN113783902B (en) | 2021-11-16 | 2021-11-16 | Communication conversion method and device suitable for communication among different devices |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113783902A CN113783902A (en) | 2021-12-10 |
CN113783902B true CN113783902B (en) | 2022-01-21 |
Family
ID=78873910
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111351034.1A Active CN113783902B (en) | 2021-11-16 | 2021-11-16 | Communication conversion method and device suitable for communication among different devices |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113783902B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101150584A (en) * | 2007-10-31 | 2008-03-26 | 中兴通讯股份有限公司 | A multi-protocol conversion device and method for SMS gateway |
CN201146538Y (en) * | 2008-01-21 | 2008-11-05 | 上海可鲁系统软件有限公司 | Apparatus for protocol conversion |
CN104038414A (en) * | 2013-08-21 | 2014-09-10 | 江南大学 | Multiprotocol intelligent household gateway apparatus and system thereof |
CN106302071A (en) * | 2015-05-29 | 2017-01-04 | 华为技术有限公司 | A kind of adapter, the network equipment and the method for port configuration |
CN107980215A (en) * | 2016-08-31 | 2018-05-01 | 深圳配天智能技术研究院有限公司 | A kind of protocol converter and method for converting protocol |
EP3657778A1 (en) * | 2017-07-20 | 2020-05-27 | Hisense Visual Technology Co., Ltd. | Terminal device and control method therefor |
WO2021105764A1 (en) * | 2019-11-26 | 2021-06-03 | Draegerwerk Ag & Co. Kgaa | Self-describing protocol translation device |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104753958A (en) * | 2015-04-17 | 2015-07-01 | 深圳市英威腾电气股份有限公司 | Card and method for converting communication protocols |
-
2021
- 2021-11-16 CN CN202111351034.1A patent/CN113783902B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101150584A (en) * | 2007-10-31 | 2008-03-26 | 中兴通讯股份有限公司 | A multi-protocol conversion device and method for SMS gateway |
CN201146538Y (en) * | 2008-01-21 | 2008-11-05 | 上海可鲁系统软件有限公司 | Apparatus for protocol conversion |
CN104038414A (en) * | 2013-08-21 | 2014-09-10 | 江南大学 | Multiprotocol intelligent household gateway apparatus and system thereof |
CN106302071A (en) * | 2015-05-29 | 2017-01-04 | 华为技术有限公司 | A kind of adapter, the network equipment and the method for port configuration |
CN107980215A (en) * | 2016-08-31 | 2018-05-01 | 深圳配天智能技术研究院有限公司 | A kind of protocol converter and method for converting protocol |
EP3657778A1 (en) * | 2017-07-20 | 2020-05-27 | Hisense Visual Technology Co., Ltd. | Terminal device and control method therefor |
WO2021105764A1 (en) * | 2019-11-26 | 2021-06-03 | Draegerwerk Ag & Co. Kgaa | Self-describing protocol translation device |
Non-Patent Citations (1)
Title |
---|
"基于策略和NETCONF管理的统一网关模型的研究与设计";赵志霞;《万方》;20080925;全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN113783902A (en) | 2021-12-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3703315A1 (en) | Communication system, control device, setting device, setting method and program | |
CN101784968B (en) | Programming device for a network of control nodes and system with such a programming device | |
CN108833394B (en) | Protocol conversion algorithm of data acquisition system | |
CN104521186A (en) | Message tunneling in an industrial network | |
CN103634161A (en) | Train communication protocol consistency detection device and train communication protocol consistency detection method | |
CN102736617A (en) | Method for diagnosing PROFIBUS-DP bus | |
CN116016434A (en) | Registration analysis method, device, equipment and medium for identification data | |
CN117130318B (en) | Industrial data acquisition method, device, system and readable storage medium | |
CN113783902B (en) | Communication conversion method and device suitable for communication among different devices | |
EP3703342A1 (en) | Dynamic load balancing in network centric process control systems | |
US10281887B2 (en) | Optimized communications with HART instruments | |
US11308020B2 (en) | Method for data communication between fieldbus devices and a control desk of an automation system, and automation system | |
US20180046589A1 (en) | Function connection unit | |
CN108696574B (en) | Public gateway platform | |
CN108092959B (en) | BACnet protocol analysis method based on configuration | |
US10459816B2 (en) | Communication setting notification apparatus | |
US11796975B2 (en) | Network centric process control | |
CN111327465B (en) | Intelligent distributed feeder automation terminal node configuration method | |
CN111413918A (en) | Method, system and storage medium for processing creation data of OPC communication label | |
CN206074734U (en) | Wire harness break-make detecting system | |
CN114697293B (en) | Data transmission method, lower computer and controller | |
JP6570462B2 (en) | Communication protocol converter | |
CN117201229B (en) | Communication method, system and storage medium | |
CN111711660B (en) | Method, device, equipment and storage medium for communication between electronic equipment | |
CN114095541B (en) | Data processing system and method, edge device, protocol management device and server |
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 |