Communication method, gateway and communication system
By using gateways to forward request messages from master and slave equipment in industrial networks, backup master and monitoring stations can diagnose communication status, solving the problem of inefficiency in the existing technology and improving the system Overall efficiency.
Patent Information
- Application Number
- CN202411399934.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2024-12-31
AI Technical Summary
In industrial networks, the backup master and monitoring station cannot diagnose the communication status between the master master and slave equipment within the same time segment, resulting in a decrease in system efficiency.
Receive request messages from the master and master station through the gateway and forward them to the slave equipment, backup master station and monitoring station. At the same time, receive reply messages from the slave equipment and forward them to the master and master station and backup master station. The station and monitoring station enable the backup master and monitoring station to use these messages to diagnose the communication status without sending a separate request.
It improves the overall efficiency of the system, allows the backup master and monitoring station to diagnose communication status without sending separate requests, and enhances the reliability and efficiency of the system.
Smart Images

Figure CN119232561A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of industrial automation technology, and in particular to a communication method; and also to a gateway and a communication system. Background Art
[0002] Industrial networks mainly include industrial Ethernet and fieldbus. RS485 and RS422 serial ports are widely used in fieldbus. With the cloudification of industrial interconnection, a large number of slave devices using serial ports need to be forwarded by gateways to communicate with the master station using Ethernet. Among them, in order to improve the reliability of the system, the master station is often configured as a redundant master station, that is, the master station includes a primary master station and a backup master station. In addition, several monitoring stations can also be configured to monitor the communication between the master station and the slave devices.
[0003] In the traditional technical solution, the actual host (usually the main station, it can also be a backup station, but the main station and the backup station cannot both act as the actual host to send requests to the slave device in the same time segment) sends a request to the gateway through the network port, and the gateway forwards the request to the corresponding serial port. After the slave device receives the request through the serial port and verifies the request, it replies with a response. After the gateway receives the response from the serial port, it only forwards the response to the actual host. After receiving the response, the actual host completes the request sending and response receiving to the slave device. However, other master stations and monitoring stations except the actual host cannot receive the request sent by the actual host and the corresponding slave device response. In this way, other master stations and monitoring stations except the actual host need to send separate requests to the slave device in order to diagnose their own links, which affects the overall efficiency of the system.
[0004] In view of this, how to solve the above-mentioned technical defects has become a technical problem that needs to be solved urgently by those skilled in the art. Summary of the invention
[0005] The purpose of the present application is to provide a communication method, by which a standby master station and a monitoring station can use the request of the main master station and the response of the slave station device to diagnose their own links without sending a separate request, thereby improving the overall efficiency of the system. Another purpose of the present application is to provide a gateway and a communication system, both of which have the above technical effects.
[0006] To solve the above technical problems, the present application provides a communication method, comprising:
[0007] Receive request messages sent by the primary master station via Ethernet;
[0008] Forwarding the request message to the slave station device via the serial bus, and forwarding the request message to the standby master station and the monitoring station via the Ethernet;
[0009] receiving a response message returned by the slave device via the serial bus;
[0010] Forwarding the response message to the active master station, the standby master station and the monitoring station via the Ethernet;
[0011] The standby master station and / or the monitoring station can diagnose the communication status with the active master station and the slave station equipment according to the received request message and response message.
[0012] Optionally, forwarding the request message to the monitoring station includes:
[0013] Filtering the request message according to the desensitization strategy configured by the gateway;
[0014] The request message that passes the screening is forwarded to the monitoring station.
[0015] Optionally, screening the request message according to the desensitization policy configured by the gateway includes:
[0016] Determining whether to filter all the request messages sent through the primary master station according to the first permission configured by the gateway;
[0017] If the first permission is true, all the request messages are filtered and passed;
[0018] If the first permission is false, determine whether to filter through any of the request messages according to the second permission configured by the gateway.
[0019] Optionally, forwarding the response message to the monitoring station includes:
[0020] Screening the response message according to the desensitization strategy;
[0021] The response message that has passed the screening is forwarded to the monitoring station.
[0022] Optionally, the screening the response message according to the desensitization strategy includes:
[0023] Determining whether to filter all the response messages returned by the slave device according to the first permission configured by the gateway;
[0024] If the first permission is true, all the response messages are filtered and passed;
[0025] If the first permission is false, it is determined whether to filter through any of the response messages according to the second permission configured by the gateway.
[0026] Optionally, also include:
[0027] configuring the first authority corresponding to the active master station, the standby master station and the monitoring station respectively;
[0028] The corresponding second authority is configured for each request message and response message.
[0029] Optionally, also include:
[0030] The first permission and the second permission of the gateway configuration are dynamically modified by using a dynamic authentication method to dynamically switch the identities of the active master station, the standby master station and the monitoring station.
[0031] Optionally, the standby master station and / or the monitoring station diagnoses the communication status with the active master station and the slave station device according to the received request message and response message, including:
[0032] The standby master station and / or the monitoring station pairs the received request message with the response message, and diagnoses the communication status with the active master station and the slave station device according to the pairing result.
[0033] In order to solve the above technical problems, the present application also provides a gateway, which is used to execute the steps of the communication method described above.
[0034] In order to solve the above technical problems, the present application also provides a communication system, including:
[0035] Gateway, active master station, standby master station, monitoring station and slave station equipment;
[0036] The gateway is used to receive a request message sent by the main master station via Ethernet; forward the request message to the slave station device via a serial bus, and forward the request message to the standby master station and the monitoring station via the Ethernet; receive a response message returned by the slave station device via the serial bus; forward the response message to the main master station, the standby master station and the monitoring station via the Ethernet, so that the standby master station and / or the monitoring station can diagnose the communication status with the main master station and the slave station device according to the received request message and response message.
[0037] The communication method provided in the present application includes: receiving a request message sent by a primary master station via Ethernet; forwarding the request message to a slave station device via a serial bus, and forwarding the request message to a standby master station and a monitoring station via the Ethernet; receiving a response message returned by the slave station device via the serial bus; forwarding the response message to the primary master station, the standby master station and the monitoring station via the Ethernet, so that the standby master station and / or the monitoring station diagnose the communication status with the primary master station and the slave station device according to the received request message and response message.
[0038] It can be seen that in the communication method provided by the present application, for the request message sent by the active master station, the gateway not only forwards the request message to the slave device, but also forwards the request message to the standby master station and the monitoring station. For the response message returned by the slave device, the gateway not only forwards the response message to the active master station, but also forwards the response message to the standby master station and the monitoring station. As a result, the standby master station and the monitoring station can use the request message of the active master station and the response message of the slave device to diagnose their own links without sending a request message to the slave device separately, thereby improving the overall efficiency of the system.
[0039] The gateway and communication system provided in this application have the above-mentioned technical effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the prior art and the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0041] Figure 1 A flow chart of a communication method provided in an embodiment of the present application;
[0042] Figure 2 A schematic diagram of a communication system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] The core of this application is to provide a communication method, by which the backup master station and the monitoring station can use the request of the main master station and the response of the slave station device to diagnose their own links without sending requests separately, thereby improving the overall efficiency of the system. Another core of this application is to provide a gateway and a communication system, both of which have the above technical effects.
[0044] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0045] Please refer to Figure 1 , Figure 1 A flow chart of a communication method provided in an embodiment of the present application, refer to Figure 1 As shown, the method includes:
[0046] S101: receiving a request message sent by the primary master station via Ethernet;
[0047] S102: forwarding the request message to the slave station device via the serial bus, and forwarding the request message to the standby master station and the monitoring station via the Ethernet;
[0048] S103: receiving a response message returned by the slave device via the serial bus;
[0049] S104: forwarding the response message to the active master station, the standby master station and the monitoring station via the Ethernet, so that the standby master station and / or the monitoring station diagnose the communication status with the active master station and the slave device according to the received request message and response message.
[0050] Combination Figure 2 As shown in the figure, the active master station, standby master station and monitoring station are all upper computers, which can be connected to the network port side of the gateway through the TCP network or the UDP network. The slave station equipment is connected to the serial port side of the gateway through the serial bus. The active master station, standby master station and monitoring station communicate or monitor communication with the slave station equipment through the gateway.
[0051] After the active master station sends a request message to the gateway through the network port, the gateway forwards the request message to the corresponding serial port, so that the serial port sends the request message to the corresponding slave station device. In addition, the gateway also forwards the request message to the standby master station and the monitoring station.
[0052] After receiving the request message through the serial port, the slave device replies with a response message. After receiving the response message from the serial port, the gateway forwards the response message to the active master station, the standby master station and the monitoring station.
[0053] When the network type is UDP, the gateway directly forwards the message to the host computer (main master station, backup master station and monitoring station). When the network type is TCP, the gateway first checks the connection status of the host computer. When the TCP connection of the host computer is successfully established, the message is forwarded to the host computer, otherwise, the host computer with unsuccessful TCP connection is skipped.
[0054] After the active master station receives the reply message, the request sending and reply receiving to the slave station device are completed. The standby master station and the monitoring station can identify the request message and the reply message, and perform the diagnosis of their own links according to the request message and the reply message. In some embodiments, the standby master station and / or the monitoring station diagnose the communication status with the active master station and the slave station device according to the received request message and the reply message, including: the standby master station and / or the monitoring station pair the received request message and the reply message, and diagnose the communication status with the active master station and the slave station device according to the pairing result. If after receiving the request message, the most recent message received is the reply message of the request message, then the pairing is successful, indicating that the standby master station and / or the monitoring station obtain a normal communication cycle in the communication process. As for how to identify the request message and the reply message, reference can be made to the relevant documents that have been disclosed, and no further description is given here. This embodiment adopts the method of identifying the request message and the reply message, and configuring the request message and the reply message to diagnose the communication status, which can quickly and accurately realize the communication status diagnosis, and improve efficiency and accuracy.
[0055] In order to ensure the security of communication and avoid leakage of sensitive messages, in some embodiments, forwarding the request message to the monitoring station includes: screening the request message according to the desensitization policy configured by the gateway; forwarding the request message that passes the screening to the monitoring station. Forwarding the response message to the monitoring station includes: screening the response message according to the desensitization policy; forwarding the response message that passes the screening to the monitoring station.
[0056] In this embodiment, before forwarding the request message and the response message to the monitoring station, the gateway first filters the request message and the response message through the filter, and only forwards the request message and the response message that pass the filter to the monitoring station. The monitoring station can only receive the request message and the response message that have been filtered and passed the filter. In this way, the message filtering of the specific monitoring port can be realized to prevent the leakage of sensitive messages, and only the required messages can be filtered out and forwarded to the monitoring station.
[0057] The gateway filters the request and response messages according to the configured desensitization strategy. The gateway can be configured with whitelists, blacklists, etc. The so-called whitelist means that only messages that meet the whitelist rules are forwarded. The so-called blacklist means that all messages that meet the blacklist rules will not be forwarded. The gateway is configured with a desensitization strategy to filter the messages without installing additional firewalls or additional upper-layer applications for special processing. This has low implementation costs, and since no additional links are required, the implementation complexity and additional risk points will be greatly reduced.
[0058] In some embodiments, screening the request message according to the desensitization strategy configured by the gateway includes: determining whether to screen all the request messages sent by the primary master station according to the first permission configured by the gateway; if the first permission is true, all the request messages are screened through; if the first permission is false, determining whether to screen any of the request messages according to the second permission configured by the gateway. Screening the response message according to the desensitization strategy includes: determining whether to screen all the response messages returned by the slave station device according to the first permission configured by the gateway; if the first permission is true, all the response messages are screened through; if the first permission is false, determining whether to screen any of the response messages according to the second permission configured by the gateway.
[0059] In this embodiment, a receiving permission field is configured in the gateway so that the gateway can filter the messages according to the receiving permission field. The receiving permission field includes a first permission and a second permission. Each host computer (including the main master station, the backup master station and the monitoring station) has a corresponding first permission. The first permission is used to characterize whether the host computer can receive all messages. If the value of the first permission corresponding to a host computer is true, it indicates that the host computer can receive all messages. If the value of the first permission corresponding to a host computer is false, it indicates that the host computer cannot receive all messages, but can only receive some messages.
[0060] For the standby master station, it can receive all messages (including all request messages sent by the active master station and all response messages sent by the slave station devices). Therefore, the value of the first permission corresponding to the standby master station is true.
[0061] For the monitoring station, since the messages forwarded to the monitoring station need to be screened and filtered first, only the messages that pass the screening are forwarded to the monitoring station, that is, the monitoring station cannot receive all the messages. Therefore, the value of the first permission corresponding to the monitoring station is fasle.
[0062] The second permission is used to indicate whether the request message and the response message can be received by the host computer. If a request message can be received by a host computer, the corresponding second permission value is true. If a request message cannot be received by a host computer, the corresponding second permission value is fasle. Similarly, if a response message can be received by a host computer, the corresponding second permission value is true. If a response message cannot be received by a host computer, the corresponding second permission value is fasle.
[0063] Each request message and each reply message correspond to a second permission respectively. The second permission can be an array, and the size of the array is the algebraic sum of the number of request messages and the number of reply messages, that is, each request message and each reply message correspond to a second permission respectively. If the value of the second permission corresponding to a message is true, it indicates that the message can be received by the corresponding host computer. If the value of the second permission corresponding to a message is fasle, it indicates that the message cannot be received by the corresponding host computer.
[0064] The standby master station can receive all messages. Therefore, for the standby master station, the value of the second permission corresponding to each request message and response message is true.
[0065] The monitoring master station cannot receive all messages, but can only receive some messages. As for which messages can be received, it can be determined according to the second permission. If a request message can be received by the monitoring station, the corresponding second permission value is true. If a request message cannot be received by the monitoring station, the corresponding second permission value is fasle. Similarly, if a response message can be received by the monitoring station, the corresponding second permission value is true. If a response message cannot be received by the monitoring station, the corresponding second permission value is fasle.
[0066] Desensitization is achieved by setting the first permission for characterizing whether the host computer can receive all messages and the method for characterizing whether the request message and the response message can be received by the host computer. This can not only effectively prevent the leakage of sensitive messages, but also is easier to implement and can perform message filtering in a more targeted manner.
[0067] In some embodiments, it also includes: configuring the first authority corresponding to the active master station, the standby master station and the monitoring station respectively; configuring the second authority corresponding to each of the request message and the response message respectively.
[0068] Configuring the first permission for each host computer and the second permission for each message can effectively improve the security of communication and avoid the leakage of sensitive messages.
[0069] In some embodiments, it also includes:
[0070] The first permission and the second permission of the gateway configuration are dynamically modified by using a dynamic authentication method to dynamically switch the identities of the active master station, the standby master station and the monitoring station.
[0071] In addition to configuring the first and second permissions, the gateway also configures the number of host computers, network ports, request and response messages, etc. In addition to modifying the first and second permissions, you can also use the dynamic authentication method to modify the number of host computers and other configurations. When the gateway starts, the configuration is loaded. The configuration changes take effect immediately. Before modifying the configuration of the gateway, first perform dynamic authentication identification, that is, identify whether there is modification permission. If there is modification permission, the gateway configuration is allowed to be modified. If there is no modification permission, the gateway configuration is not allowed to be modified. In addition, dynamic authentication can also be modified dynamically.
[0072] By dynamically modifying the first permission and the second permission of the gateway configuration and the identity of each host computer using a dynamic authentication method, it is possible to avoid illegal modification of permissions and identities and ensure the reliability of permissions and identities.
[0073] A specific implementation is described below:
[0074] Configure the gateway. Each serial port COMX can be configured with N host computers, N≥1. N=2 indicates dual redundancy; N=3 indicates triple redundancy, and so on. The network ports of the N host computers are SOCKETX1, SOCKETX2, ... SOCKETXN. The N host computers all have the first and second permissions.
[0075] The configuration is loaded when the gateway starts.
[0076] Assume that N=4, and use host computer 1 as the main master station, host computers 2 and 3 as backup master stations, and host computer 4 as the monitoring station.
[0077] After the gateway receives the request message from the host computer 1, it forwards the request message to the slave device, host computer 2 and host computer 3, and filters the request message. If the request message passes the screening, the request message is forwarded to the host computer 4. If the request message fails the screening, the request message is not forwarded to the host computer 4.
[0078] After the gateway receives the response message from the slave device, the gateway forwards the response message to host computer 1, host computer 2 and host computer 3, and filters the response message. If the response message passes the screening, the response message is forwarded to host computer 4. If the response message fails the screening, the response request message is not forwarded to host computer 4.
[0079] In summary, in the communication method provided by the present application, for the request message sent by the active master station, the gateway not only forwards the request message to the slave device, but also forwards the request message to the standby master station and the monitoring station. For the response message returned by the slave device, the gateway not only forwards the response message to the active master station, but also forwards the response message to the standby master station and the monitoring station. As a result, the standby master station and the monitoring station can use the request message of the active master station and the response message of the slave device to diagnose their own links without sending a request message to the slave device separately, thereby improving the overall efficiency of the system.
[0080] The present application also provides a gateway, and the gateway described below can be referred to in correspondence with the method described above. The gateway is used to receive a request message sent by the main master station through Ethernet; forward the request message to the slave device through the serial bus, and forward the request message to the standby master station and the monitoring station through the Ethernet; receive a response message returned by the slave device through the serial bus; forward the response message to the main master station, the standby master station and the monitoring station through the Ethernet, so that the standby master station and / or the monitoring station can diagnose the communication status with the main master station and the slave device according to the received request message and response message.
[0081] Based on the above embodiment, as a specific implementation manner, forwarding the request message to the monitoring station includes:
[0082] Filtering the request message according to the desensitization strategy configured by the gateway;
[0083] The request message that passes the screening is forwarded to the monitoring station.
[0084] Based on the above embodiment, as a specific implementation method, screening the request message according to the desensitization policy configured by the gateway includes:
[0085] Determining whether to filter all the request messages sent through the primary master station according to the first permission configured by the gateway;
[0086] If the first permission is true, all the request messages are filtered and passed;
[0087] If the first permission is false, determine whether to filter through any of the request messages according to the second permission configured by the gateway.
[0088] Based on the above embodiment, as a specific implementation manner, forwarding the response message to the monitoring station includes:
[0089] Screening the response message according to the desensitization strategy;
[0090] The response message that has passed the screening is forwarded to the monitoring station.
[0091] Based on the above embodiment, as a specific implementation method, screening the response message according to the desensitization strategy includes:
[0092] Determining whether to filter all the response messages returned by the slave device according to the first permission configured by the gateway;
[0093] If the first permission is true, all the response messages are filtered and passed;
[0094] If the first permission is false, it is determined whether to filter through any of the response messages according to the second permission configured by the gateway.
[0095] Based on the above embodiment, as a specific implementation method, it also includes:
[0096] configuring the first authority corresponding to the active master station, the standby master station and the monitoring station respectively;
[0097] The corresponding second authority is configured for each request message and response message.
[0098] Based on the above embodiment, as a specific implementation method, it also includes:
[0099] The first permission and the second permission of the gateway configuration are dynamically modified by using a dynamic authentication method to dynamically switch the identities of the active master station, the standby master station and the monitoring station.
[0100] Based on the above embodiment, as a specific implementation mode, the standby master station and / or the monitoring station diagnoses the communication status with the active master station and the slave station device according to the received request message and response message, including:
[0101] The standby master station and / or the monitoring station pairs the received request message with the response message, and diagnoses the communication status with the active master station and the slave station device according to the pairing result.
[0102] The gateway provided in the present application, for the request message sent by the active master station, in addition to forwarding the request message to the slave device, also forwards the request message to the standby master station and the monitoring station. For the response message returned by the slave device, in addition to forwarding the response message to the active master station, the gateway also forwards the response message to the standby master station and the monitoring station. As a result, the standby master station and the monitoring station can use the request message of the active master station and the response message of the slave device to diagnose their own links, without the need to send a request message to the slave device separately, thereby improving the overall efficiency of the system.
[0103] The present application also provides a communication system, referring to Figure 2 As shown, the communication system includes:
[0104] Gateway, active master station, standby master station, monitoring station and slave station equipment;
[0105] The gateway is used to receive a request message sent by the main master station via Ethernet; forward the request message to the slave station device via a serial bus, and forward the request message to the standby master station and the monitoring station via the Ethernet; receive a response message returned by the slave station device via the serial bus; forward the response message to the main master station, the standby master station and the monitoring station via the Ethernet, so that the standby master station and / or the monitoring station can diagnose the communication status with the main master station and the slave station device according to the received request message and response message.
[0106] Based on the above embodiment, as a specific implementation mode, the gateway is specifically used for:
[0107] Filtering the request message according to the desensitization strategy configured by the gateway;
[0108] The request message that passes the screening is forwarded to the monitoring station.
[0109] Based on the above embodiment, as a specific implementation mode, the gateway is specifically used for:
[0110] Determining whether to filter all the request messages sent through the primary master station according to the first permission configured by the gateway;
[0111] If the first permission is true, all the request messages are filtered and passed;
[0112] If the first permission is false, determine whether to filter through any of the request messages according to the second permission configured by the gateway.
[0113] Based on the above embodiment, as a specific implementation mode, the gateway is specifically used for:
[0114] Screening the response message according to the desensitization strategy;
[0115] The response message that has passed the screening is forwarded to the monitoring station.
[0116] Based on the above embodiment, as a specific implementation mode, the gateway is specifically used for:
[0117] Determining whether to filter all the response messages returned by the slave device according to the first permission configured by the gateway;
[0118] If the first permission is true, all the response messages are filtered and passed;
[0119] If the first permission is false, it is determined whether to filter through any of the response messages according to the second permission configured by the gateway.
[0120] Based on the above embodiment, as a specific implementation mode, the gateway is further used for:
[0121] configuring the first authority corresponding to the active master station, the standby master station and the monitoring station respectively;
[0122] The corresponding second authority is configured for each request message and response message.
[0123] Based on the above embodiment, as a specific implementation mode, the gateway is further used for:
[0124] The first permission and the second permission of the gateway configuration are dynamically modified by using a dynamic authentication method to dynamically switch the identities of the active master station, the standby master station and the monitoring station.
[0125] Based on the above embodiment, as a specific implementation mode, the standby master station and / or the monitoring station diagnoses the communication status with the active master station and the slave station device according to the received request message and response message, including:
[0126] The standby master station and / or the monitoring station pairs the received request message with the response message, and diagnoses the communication status with the active master station and the slave station device according to the pairing result.
[0127] In the communication system provided by the present application, for the request message sent by the active master station, the gateway not only forwards the request message to the slave device, but also forwards the request message to the standby master station and the monitoring station. For the response message returned by the slave device, the gateway not only forwards the response message to the active master station, but also forwards the response message to the standby master station and the monitoring station. Thus, the standby master station and the monitoring station can use the request message of the active master station and the response message of the slave device to diagnose their own links, without having to send a request message to the slave device separately, thereby improving the overall efficiency of the system.
[0128] For an introduction to the communication system provided in this application, please refer to the above method embodiment, and this application will not go into details here.
[0129] The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps can be implemented:
[0130] Receive a request message sent by the main master station through the Ethernet; forward the request message to the slave station device through the serial bus, and forward the request message to the standby master station and the monitoring station through the Ethernet; receive a response message returned by the slave station device through the serial bus; forward the response message to the main master station, the standby master station and the monitoring station through the Ethernet, so that the standby master station and / or the monitoring station diagnose the communication status with the main master station and the slave station device according to the received request message and response message.
[0131] The computer-readable storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0132] For an introduction to the computer-readable storage medium provided in this application, please refer to the above method embodiment, and this application will not go into details here.
[0133] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the devices, equipment, and computer-readable storage media disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0134] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0135] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0136] The communication method, gateway and communication system provided by the present application are described in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A communication method, applied to a gateway, characterized in that: include: Receive request messages sent by the primary master station via Ethernet; Forwarding the request message to the slave station device via the serial bus, and forwarding the request message to the standby master station and the monitoring station via the Ethernet; receiving a response message returned by the slave device via the serial bus; Forwarding the response message to the active master station, the standby master station and the monitoring station via the Ethernet; The standby master station and / or the monitoring station can diagnose the communication status with the active master station and the slave station equipment according to the received request message and response message.
2. The communication method according to claim 1, characterized in that: Forwarding the request message to the monitoring station includes: Filtering the request message according to the desensitization strategy configured by the gateway; The request message that passes the screening is forwarded to the monitoring station.
3. The communication method according to claim 2, characterized in that: Screening the request message according to the desensitization strategy configured by the gateway includes: Determining whether to filter all the request messages sent through the primary master station according to the first permission configured by the gateway; If the first permission is true, all the request messages are filtered and passed; If the first permission is false, determine whether to filter through any of the request messages according to the second permission configured by the gateway.
4. The communication method according to claim 2, characterized in that: Forwarding the response message to the monitoring station includes: Screening the response message according to the desensitization strategy; The response message that has passed the screening is forwarded to the monitoring station.
5. The communication method according to claim 4, characterized in that: The screening of the response message according to the desensitization strategy includes: Determining whether to filter all the response messages returned by the slave device according to the first permission configured by the gateway; If the first permission is true, all the response messages are filtered and passed; If the first permission is false, it is determined whether to filter through any of the response messages according to the second permission configured by the gateway.
6. The communication method according to claim 3 or 5, characterized in that: Also includes: configuring the first authority corresponding to the active master station, the standby master station and the monitoring station respectively; The corresponding second authority is configured for each request message and response message.
7. The communication method according to claim 6, characterized in that: Also includes: The first permission and the second permission of the gateway configuration are dynamically modified by using a dynamic authentication method to dynamically switch the identities of the active master station, the standby master station and the monitoring station.
8. The communication method according to claim 1, characterized in that: The standby master station and / or the monitoring station diagnoses the communication status with the active master station and the slave station device according to the received request message and response message, including: The standby master station and / or the monitoring station pairs the received request message with the response message, and diagnoses the communication status with the active master station and the slave station device according to the pairing result.
9. A gateway, characterized in that: The gateway is used to execute the steps of the communication method according to any one of claims 1 to 8.
10. A communication system, characterized in that: include: Gateway, active master station, standby master station, monitoring station and slave station equipment; The gateway is used to receive a request message sent by the primary master station via Ethernet; Forwarding the request message to the slave station device via the serial bus, and forwarding the request message to the standby master station and the monitoring station via the Ethernet; receiving a response message returned by the slave device via the serial bus; The response message is forwarded to the active master station, the standby master station and the monitoring station via the Ethernet, so that the standby master station and / or the monitoring station diagnose the communication status with the active master station and the slave station device according to the received request message and response message.
