Communication expansion method and device
By establishing a data partition mapping relationship between the private protocol of the lower device and the network protocol of the Ethernet in the controller, directly converting and transmitting data, the problem of communication delay in traditional solutions is solved, and high real-time industrial communication is achieved.
Patent Information
- Application Number
- CN202211199415.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-29
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2042-09-29
AI Technical Summary
Traditional industrial communication solutions have delays in communication between devices and networks, and are difficult to meet the needs in scenarios where high real-time communication requirements are required.
By establishing a data partition mapping relationship between the private protocol of the lower device and the network protocol of the Ethernet in the controller, direct conversion and transmission of data is realized, and the analysis and conversion process of communication data in traditional solutions is avoided.
This method significantly shortens the scanning time of multi-device communication, improves the real-time communication, and can meet the communication requirements of the lower-level equipment and the master station.
Smart Images

Figure CN115567617B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of industrial communications, and in particular to a communication expansion method and device. Background Art
[0002] Currently, in the field of industrial communications, the communication protocols used by devices and networks are often inconsistent. In order to ensure normal communication between devices and networks, it is necessary to establish a communication solution between devices and networks. Traditional communication solutions are mostly in the form of transparent transmission, directly converting the communication data under each communication protocol into control commands for the corresponding devices. In this method, the scanning time for multi-device communication in the network is long, and the communication data must be parsed when converted into control commands. It can be seen that the delay in the device receiving the communication data is long. For devices with high real-time communication requirements, traditional communication solutions are difficult to meet the equipment needs.
[0003] Therefore, how to provide a solution to the above technical problems is a problem that those skilled in the art need to solve. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a communication expansion method and device with high real-time performance. The specific scheme is as follows:
[0005] A communication expansion method, applied to a controller, comprising:
[0006] According to the private protocol of the lower device, establish a communication connection between itself and the lower device, and establish a data partition mapping relationship between its own communication storage area and the device storage area of the lower device;
[0007] According to the network protocol of Ethernet, a network connection is established between the network itself and the master station in the Ethernet; the network protocol is a real-time Ethernet protocol combined with TSN technology;
[0008] Reading the first communication information of the lower device through the data partition mapping relationship, and converting the first communication information from the private protocol to the network protocol and then sending it to the master station;
[0009] When the second communication information of the master station is received, the second communication information is converted from the network protocol to the private protocol and then sent to the lower device through the data partition mapping relationship.
[0010] Preferably, the process of reading the first communication information of the lower device through the data partition mapping relationship includes:
[0011] According to the current target communication mode, reading the first communication information of the lower device through the data partition mapping relationship;
[0012] Correspondingly, the process of converting the second communication information from the network protocol to the private protocol and then sending the second communication information to the lower device through the data partition mapping relationship includes:
[0013] According to the current target communication mode, converting the second communication information from the network protocol to the private protocol and then sending it to the lower device through the data partition mapping relationship;
[0014] The target communication mode includes a cyclic communication mode and / or an instantaneous communication mode.
[0015] Preferably, the communication extension method further includes time synchronization, and the time synchronization includes:
[0016] Through PTP protocol support, the same communication time benchmark is established for communication information of different sites;
[0017] The sites include the master site and other sites in the Ethernet, and the communication information includes the second communication information sent by the master site and the communication information sent by the other sites.
[0018] Preferably, after establishing a network connection between itself and the master station in the Ethernet according to the Ethernet network protocol, the method further comprises:
[0019] The cyclic communication mode, and / or the instantaneous communication mode, and / or the time synchronization are executed in time division according to a time division standard.
[0020] Preferably, the communication extension method further includes:
[0021] The device status information of the lower device is read through the data partition mapping relationship and sent to the master station.
[0022] Preferably, the process of reading the device status information of the subordinate device through the data partition mapping relationship and sending it to the master station includes:
[0023] When an abnormal signal from the lower device is received, the device status information of the lower device is read through the data partition mapping relationship and sent to the master station.
[0024] Preferably, the process of reading the device status information of the subordinate device through the data partition mapping relationship and sending it to the master station includes:
[0025] When the diagnostic information of the master station is received, the device status information of the subordinate device is read through the data partition mapping relationship, and the device status information and its own status information are sent to the master station together.
[0026] Accordingly, the present application also discloses a communication expansion device, comprising:
[0027] Memory for storing computer programs;
[0028] The first processor is used to implement the steps of any one of the communication expansion methods described above when executing the computer program.
[0029] Preferably, the communication expansion device further includes:
[0030] A first port, used to connect the first processor and a lower device;
[0031] The second port is used to connect the first processor and one or more sites, wherein the sites include at least a master site, and all the sites are located in the same Ethernet.
[0032] Preferably, the communication expansion device further includes:
[0033] a second processor for establishing a communication link of a network protocol;
[0034] The first processor and the second port are connected through the second processor.
[0035] The present application discloses a communication extension method, which is applied to a controller, including: establishing a communication connection between itself and the subordinate device according to the private protocol of the subordinate device, and establishing a data partition mapping relationship between its own communication storage area and the device storage area of the subordinate device; establishing a network connection between itself and the master station in Ethernet according to the CC-Link IE TSN protocol; reading the first communication information of the subordinate device through the data partition mapping relationship, and converting the first communication information from the private protocol to the network protocol and sending it to the master station; when receiving the second communication information of the master station, converting the second communication information from the network protocol to the private protocol and sending it to the subordinate device through the data partition mapping relationship. In the present application, the data partition mapping between the controller itself and the subordinate device is established based on the private protocol of the subordinate device. It is not necessary to convert the communication data into a control command during communication, and the parsing time is short. The connection with the master station in Ethernet is established based on the time synchronization protocol. The scanning time of multi-device communication is short, which can meet the high real-time communication requirements of the subordinate device and the master station. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0037] Figure 1 A flowchart of a communication expansion method according to an embodiment of the present invention;
[0038] Figure 2 A schematic diagram of a data partition mapping relationship in an embodiment of the present invention;
[0039] Figure 3 The structure distribution diagram of a communication extension system in an embodiment of the present invention. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0041] Traditional communication solutions are mostly in the form of transparent transmission, directly converting the communication data under each communication protocol into control commands for the corresponding devices. In this method, the scanning time for multi-device communication in the network is long, and the communication data must be parsed when converted into control commands. It can be seen that the device has a long delay in receiving the communication data. For devices with high real-time communication requirements, traditional communication solutions are difficult to meet the equipment needs.
[0042] In this application, a data partition mapping is established between the controller itself and the lower-level device based on the private protocol of the lower-level device. There is no need to convert the communication data into control commands during communication, and the parsing time is short. A connection with the master station in the Ethernet is established based on the time synchronization protocol. The scanning time for multi-device communication is short, which can meet the high real-time communication requirements of the lower-level device and the master station.
[0043] The embodiment of the present invention discloses a communication expansion method, which is applied to a controller, see Figure 1 As shown, including:
[0044] S1: Establish a communication connection between itself and the lower device according to the private protocol of the lower device, and establish a data partition mapping relationship between its own communication storage area and the device storage area of the lower device;
[0045] It can be understood that the lower-level devices here are devices with their own private protocols, including industrial control equipment and instruments and meters, which have internal processors and storage areas and can communicate with each other to meet the requirements of industrial fields such as CNC machine tools and automobiles. The frequency converter is a typical industrial control device that can communicate with the master station using this communication extension method. Furthermore, the lower-level device is connected to the master station through a controller, and the controller implements this communication extension method to achieve the high real-time requirements of communication between the lower-level device and the master station.
[0046] In this embodiment, the hardware of the lower device does not need to be changed, and the purpose of communicating with the lower device can be achieved by the controller executing the action of step S1.
[0047] S2: Establishing a network connection between itself and the master station in Ethernet according to the Ethernet network protocol; the network protocol is a real-time Ethernet protocol combined with TSN technology;
[0048] Furthermore, in this embodiment, the real-time Ethernet protocol combined with TSN technology is used as a network protocol to connect to Ethernet. Specifically, the real-time Ethernet protocol can select real-time Ethernet protocols of architectures such as profinet and ethcat, and combine with TSN technology to achieve it. This embodiment preferably uses CC-Link IE TSN protocol, which can solve the problem that traditional solutions cannot well support time synchronization and traffic scheduling characteristics, thereby meeting various applications in industrial Ethernet.
[0049] Specifically, in Ethernet, the controller itself is a site, and its connection topology with the master site and other sites includes star, ring, linear, hybrid and other structures. The site topology in Ethernet has a high degree of freedom. This embodiment uses TSN technology to ensure the current high real-time communication requirements while being able to communicate with other open networks. The network protocols of various lower-level devices coexist on the same link, meeting the requirements of control communication and information communication at the same time, and realizing a one-stop network.
[0050] S3: reading the first communication information of the lower device through the data partition mapping relationship, converting the first communication information from the private protocol to the network protocol and sending it to the master station;
[0051] S4: When receiving the second communication information from the master station, convert the second communication information from the network protocol to a private protocol and then send it to the lower device through the data partition mapping relationship.
[0052] It is understandable that there is no necessary order between steps S1 and S2, and there is no necessary order between steps S3 and S4. Figure 1 The sequence arrangement is only an example, and this embodiment does not have to be strictly followed when implementing Figure 1It can be performed as long as steps S3 and S4 are performed after steps S1 and S2.
[0053] It can be understood that steps S3 and S4 respectively describe the processing methods of communication information in different directions, wherein the first communication information is transmitted from the lower device to the main station, and during the process, the first communication information of the lower device is read through the data partition mapping relationship, and then the private protocol is converted into the network protocol and sent to the main station; the second communication information is transmitted from the main station to the lower device, and during the process, the second communication information is converted into the private protocol by the network protocol, and then sent to the lower device through the data partition mapping relationship.
[0054] It can be understood that the CC-Link IE TSN protocol has the following characteristics: using time synchronization to transmit input and output data frames in both directions at the same time within the specified time, thereby shortening the overall cyclic data update time of the network; providing flow control, allowing multiple communication cycles in the same network, that is, setting different channels for different communication rate requirements of lower-level devices. Therefore, in this embodiment, there are multiple communication modes between the master station and the lower-level devices, and the data of each communication mode is processed in time slices. During processing, the data partition mapping will also be set according to different communication modes. Furthermore, when Ethernet is congested, higher priority network data can be processed first. The network data here includes network data in cyclic communication mode, network data in instantaneous communication mode, and network data related to the PTP protocol.
[0055] Specifically, the process of reading the first communication information of the lower device through the data partition mapping relationship includes:
[0056] According to the current target communication mode, the first communication information of the lower device is read through the data partition mapping relationship;
[0057] Correspondingly, the process of converting the second communication information from the network protocol to the private protocol and then sending it to the lower device through the data partition mapping relationship includes:
[0058] According to the current target communication mode, the second communication information is converted from the network protocol to the private protocol and then sent to the lower device through the data partition mapping relationship;
[0059] The target communication mode includes a cyclic communication mode and / or an instantaneous communication mode.
[0060] It should be noted that the controller can only select one target communication mode at the same time, and different communication modes can communicate in different time periods.
[0061] It can be understood that the partitioning of the data partition mapping relationship is mainly based on the communication mode. For the same communication mode, a partition in the communication storage area of the controller and a partition in the device storage area of the lower device have a mapping relationship. The cyclic communication mode is used to implement periodic communication functions with high real-time requirements, mainly for lower devices, and is divided into two types: read and write. Figure 2 Taking the data partition mapping relationship shown as an example, in a single communication cycle, the controller records the second communication information to the write area of the communication storage area cycle area, and then the controller quickly refreshes the lower device to notify the lower device. The lower device processes and refreshes the data in the control area of the device storage area according to the data in the write area. The processing process includes writing the information that needs to be fed back into the status area of the control area, and updating the data in the read area of the communication storage area cycle area corresponding to the status area. The controller reads the read area data through a private protocol. If valid data is read, it is converted into a network protocol form as the first communication information and sent to the master station. In the process, the read area data is refreshed from the control area of the lower device in the remaining time slice of the cyclic communication, and the real-time performance is higher.
[0062] It is understandable that the transient communication mode is usually implemented based on the SLMP protocol and is used to achieve information communication with low real-time requirements. In the data partition mapping relationship, the transient area in the communication storage area of the controller corresponds to the information area of the lower device for the transient communication mode.
[0063] Furthermore, the data processing of the time synchronization protocol in this embodiment allows different devices to have different real-time requirements, so the communication expansion method also includes time synchronization, which includes:
[0064] Through PTP protocol support, the same communication time benchmark is established for communication information of different sites;
[0065] The different sites include a master site and other sites in the Ethernet, and the communication information includes second communication information sent by the master site and communication information sent by other sites.
[0066] It is understandable that after the controller is connected to the master station, the controller can also connect to other stations in the Ethernet and communicate with other stations. The communication information sent to the controller by these different stations will use the PTP protocol support in the controller to establish a unified communication time base.
[0067] It is understandable that the support of the PTP protocol establishes an accurate time benchmark for the communication data of different sites, eliminates the interference of network burst traffic on timing accuracy, and improves the real-time performance of the control of lower-level equipment.
[0068] Furthermore, after establishing a network connection between itself and the master station in the Ethernet according to the Ethernet network protocol, the method further includes:
[0069] According to the time division standard, the cyclic communication mode and / or the instantaneous communication mode and / or the time synchronization are performed in a time-division manner.
[0070] Specifically, the time division standard may be the 802.1Qbv protocol standard, which belongs to the TSN technology and has the ability to adjust the allocation according to the flow. In addition, the time division standard in this embodiment may also be other protocol standards, which are not limited here, as long as the cyclic communication mode, instantaneous communication mode, and time synchronization correspond to different execution times.
[0071] The present application discloses a communication extension method, which is applied to a controller, including: establishing a communication connection between itself and the subordinate device according to the private protocol of the subordinate device, and establishing a data partition mapping relationship between its own communication storage area and the device storage area of the subordinate device; establishing a network connection between itself and the master station in Ethernet according to the CC-Link IE TSN protocol; reading the first communication information of the subordinate device through the data partition mapping relationship, and converting the first communication information from the private protocol to the network protocol and sending it to the master station; when receiving the second communication information of the master station, converting the second communication information from the network protocol to the private protocol and sending it to the subordinate device through the data partition mapping relationship. In the present application, the data partition mapping between the controller itself and the subordinate device is established based on the private protocol of the subordinate device. It is not necessary to convert the communication data into a control command during communication, and the parsing time is short. The connection with the master station in Ethernet is established based on the network protocol. The scanning time of multi-device communication is short, which can meet the high real-time communication requirements of the subordinate device and the master station.
[0072] The embodiment of the present invention discloses a specific communication extension method. Compared with the previous embodiment, this embodiment further illustrates and optimizes the technical solution.
[0073] Specifically, the communication extension method also includes:
[0074] The device status information of the lower device is read through the data partition mapping relationship and sent to the master station.
[0075] It is understandable that the device status information can reflect whether the status of the lower device is normal. If there is a problem with the lower device that causes abnormal read and write control between the controller and the lower device, the status area of the device storage area of the lower device will store an error code so as to feedback a reminder signal upward. Generally, when the controller executes the method of this embodiment and performs read and write operations on the lower device, it can detect the abnormal signal of the lower device and mark the current read and write operation as abnormal to prevent blocking; in addition, when the lower device generates an abnormality, in addition to sending an abnormal signal to the controller, the read and write data to be replied to the controller can be directly replaced with the error code of the device abnormality, so that when the controller performs read and write operations on the lower device, it detects the abnormal signal of the lower device and reads the error code of the device abnormality returned by the lower device, which can be used for fault diagnosis.
[0076] Furthermore, in order to avoid waiting, an instant communication mode may be selected to send the information, such as Figure 2 As shown, an area transmit diagnose is designated in the transient area of the communication storage area for interacting with the status area and the configuration area in the information area of the device storage area to determine the device status information.
[0077] Furthermore, the device status information of the lower device may be the device status information fed back to the master station by the lower device after the master station sends the diagnostic information, or the device status information actively sent to the master station after the lower device detects an abnormality in self-detection.
[0078] Therefore, the process of reading the device status information of the lower device through the data partition mapping relationship and sending it to the master station includes:
[0079] When an abnormal signal is received from a lower-level device, the device status information of the lower-level device is read through the data partition mapping relationship and sent to the master station.
[0080] Alternatively, the process of reading the device status information of the lower device through the data partition mapping relationship and sending it to the master station includes:
[0081] When receiving the diagnostic information from the master station, the device status information of the lower device is read through the data partition mapping relationship, and the device status information and its own status information are sent to the master station together.
[0082] It can be understood that if the lower device is normal, no abnormal signal will be generated, and the device status information will be empty. The controller determines that the current lower device is normal after recognizing that the abnormal signal does not exist; if the lower device is abnormal, an abnormal signal will be generated, and an error code will appear in the device status information. After receiving the abnormal signal, the controller reads the error code of the device status information and the current operating status information of the lower device, and sends the abnormal information, error code, current operating status information of the lower device, and its own status information to the main station for fault diagnosis.
[0083] It is understandable that, in the process of sending the status information of the lower device to the master station, the controller can simultaneously package its own status information with the status information of the lower device and send them together, thereby improving the accuracy of device positioning and reducing maintenance operation hours.
[0084] Correspondingly, the present application also discloses a communication expansion device, see Figure 3 As shown, including:
[0085] A memory 10, used for storing computer programs;
[0086] The first processor 11 is configured to implement the steps of any one of the communication extension methods described above when executing the computer program.
[0087] In some specific embodiments, the communication expansion device further includes:
[0088] The first port P1 is used to connect the first processor 11 and a lower device;
[0089] The second port P2 is used to connect the first processor 11 and one or more sites, where the sites at least include a master site, and all the sites are located in the same Ethernet.
[0090] In some specific embodiments, the communication expansion device further includes:
[0091] The second processor 12 is used to establish a communication link of the network protocol;
[0092] The first processor 11 and the second port P2 are connected through the second processor 12 .
[0093] In some specific embodiments, the communication expansion device may further include:
[0094] The status port is used to connect the reset pin and / or the abnormal status pin of the lower device to the first processor 11.
[0095] It can be understood that, in this embodiment, the first processor 11 can be implemented by a CPU, the second processor 12 is connected between the second port P2 and the first processor 11, and is implemented by an Ethernet controller with time synchronization protocol function support. The memory 10 can be flash or other storable media. In addition to storing computer programs, the memory 10 also stores protocol stacks related to lower devices and Ethernet, such as CC-Link IE TSN protocol stack, TCP / IP protocol stack, etc.; the first port P1, the second port P2, and the third port are selected according to the connection object and the corresponding protocol. For example, the first port P1 can be a port of SPI protocol, and the second port P2 is usually an RJ45 port. At the same time, a communication expansion device may include multiple second ports P2, which are respectively connected to different sites, and these sites belong to the same Ethernet.
[0096] Furthermore, a status indication circuit 13 may be provided on the communication extension device to indicate the current status of the communication extension device or a lower device. The status indication circuit may be connected to the first controller 11 via a GPIO line.
[0097] It can be understood that the communication expansion device in this embodiment has a simple structure, low requirements for PCB layout, does not require a separate Ethernet chip, and saves hardware costs.
[0098] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0099] The communication expansion method and device provided by the present invention are introduced in detail above. The principle and implementation mode of the present invention are explained in detail by using specific examples in this article. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation mode and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A communication expansion method, characterized in that: Applicable to controllers, including: According to the private protocol of the lower device, establish a communication connection between itself and the lower device, and establish a data partition mapping relationship between its own communication storage area and the device storage area of the lower device; According to the network protocol of Ethernet, a network connection is established between the network itself and the master station in the Ethernet; the network protocol is a real-time Ethernet protocol combined with TSN technology; According to the current target communication mode, the first communication information of the lower device is read through the data partition mapping relationship, and the first communication information is converted from the private protocol to the network protocol and then sent to the main station; wherein the target communication mode includes a cyclic communication mode and / or an instantaneous communication mode, and the partition of the data partition mapping relationship is based on the communication mode; wherein the transient area in the communication storage area of the controller corresponds to the information area of the storage area of the lower device for the instantaneous communication mode, and the cycle area in the communication storage area of the controller corresponds to the control area of the storage area of the lower device for the cyclic communication mode; When the second communication information of the master station is received, the second communication information is converted from the network protocol to the private protocol and then sent to the lower device through the data partition mapping relationship.
2. The communication expansion method according to claim 1, characterized in that: The process of converting the second communication information from the network protocol to the private protocol and then sending the second communication information to the lower device through the data partition mapping relationship includes: According to the current target communication mode, the second communication information is converted from the network protocol to the private protocol and then sent to the lower device through the data partition mapping relationship.
3. The communication expansion method according to claim 2, characterized in that: Also included is time synchronization, which includes: Through PTP protocol support, the same communication time benchmark is established for communication information of different sites; The sites include the master site and other sites in the Ethernet, and the communication information includes the second communication information sent by the master site and the communication information sent by the other sites.
4. The communication expansion method according to claim 3, characterized in that: After establishing a network connection between itself and the master station in the Ethernet according to the Ethernet network protocol, the method further includes: The cyclic communication mode, and / or the instantaneous communication mode, and / or the time synchronization are executed in time division according to a time division standard.
5. The communication expansion method according to any one of claims 1 to 4, characterized in that: Also includes: The device status information of the lower device is read through the data partition mapping relationship and sent to the master station.
6. The communication expansion method according to claim 5, characterized in that: The process of reading the device status information of the subordinate device through the data partition mapping relationship and sending it to the master station includes: When an abnormal signal from the lower device is received, the device status information of the lower device is read through the data partition mapping relationship and sent to the master station.
7. The communication expansion method according to claim 5, characterized in that: The process of reading the device status information of the subordinate device through the data partition mapping relationship and sending it to the master station includes: When the diagnostic information of the master station is received, the device status information of the subordinate device is read through the data partition mapping relationship, and the device status information and its own status information are sent to the master station together.
8. A communication expansion device, characterized in that: include: Memory for storing computer programs; The first processor is configured to implement the steps of the communication extension method according to any one of claims 1 to 7 when executing the computer program.
9. The communication expansion device according to claim 8, characterized in that: Also includes: A first port, used to connect the first processor and a lower device; The second port is used to connect the first processor and one or more sites, wherein the sites include at least a master site, and all the sites are located in the same Ethernet.
10. The communication expansion device according to claim 9, characterized in that: Also includes: a second processor for establishing a communication link of a network protocol; The first processor and the second port are connected through the second processor.
Citation Information
Patent Citations
Communication system and method
CN106656773A
Time-sensitive heterogeneous network system of industrial control system, and management method thereof
CN112073388A