CN111901216A - Backup processing method and system for RS485 ring network - Google Patents

Backup processing method and system for RS485 ring network Download PDF

Info

Publication number
CN111901216A
CN111901216A CN202010906045.0A CN202010906045A CN111901216A CN 111901216 A CN111901216 A CN 111901216A CN 202010906045 A CN202010906045 A CN 202010906045A CN 111901216 A CN111901216 A CN 111901216A
Authority
CN
China
Prior art keywords
interface
ring network
control end
main control
target device
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.)
Pending
Application number
CN202010906045.0A
Other languages
Chinese (zh)
Inventor
林宏洲
林忠杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Kunshan Shangnisi Electronic Technology Co ltd
Original Assignee
Kunshan Shangnisi Electronic Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Kunshan Shangnisi Electronic Technology Co ltd filed Critical Kunshan Shangnisi Electronic Technology Co ltd
Priority to CN202010906045.0A priority Critical patent/CN111901216A/en
Publication of CN111901216A publication Critical patent/CN111901216A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/42Loop networks
    • H04L12/437Ring fault isolation or reconfiguration
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0663Performing the actions predefined by failover planning, e.g. switching to standby network elements

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)

Abstract

The application relates to a backup processing method and system of RS485 ring network, which is characterized in that the backup processing is performed when the RS485 ring network is abnormal. The invention comprises the following steps: the main control end is connected in series with a plurality of RS485 devices through a ring network; when the main control end is in an initial stage, a first interface of the main control end sends out a first signal, and the first signal is received by a second interface of the main control end after passing through the ring network; the master control end judges whether the ring network is interrupted every second time interval; if the ring network is interrupted, the main control end drives the first interface to send a second control command to the second target device; the master control end drives the second interface to send a second control command to the second target device at intervals of third time; the second target device returns a third response message to the master control end according to the second control command.

Description

Backup processing method and system for RS485 ring network
Technical Field
A method and system for processing signal redundancy, and more particularly, to a method and system for processing redundancy in an RS485 ring network
Background
RS485 (or EIA485) is a standard that is subject to the OSI model physical layer electrical characteristics specified as 2-wire, half-duplex, balanced transmission line multi-drop communications. Is a standard jointly issued by Telecommunications Industry Association (TIA) and Electronic Industry Alliance (EIA). The RS485 protocol uses the difference in voltage across the cable to represent the transmitted signal. The RS485 protocol can be applied to the area network with cheap configuration and adopts single machine transmission, and multiple machines receive communication connection. Therefore, the RS485 protocol can be connected to various devices through a ring network in addition to connecting multiple devices in series.
In the ring network structure, the host provides two connection interfaces, and the two connection interfaces are connected to two ends of the ring network respectively. Therefore, the master control end can send signals through any interface and receive signals through the other interface. The ring network has the advantage that the master can send signals to the target device through any interface.
However, when the path of the ring network is interrupted, the master control end of the prior art cannot know where the route interruption point is located on the path. If the master selects the interface for sending the signal incorrectly, the control signal may not be sent to the target device smoothly. In the prior art, the target device can receive the signal, so the signal is sent to the target device through the two connection interfaces.
In addition, the master control end has no relevant mechanism to know whether the ring network is normal or not. When the ring network is restored, the master control end will still send out signal to the target device through the two connection interfaces. Therefore, the target device will receive two identical signals respectively, so that the target device will repeat twice actions or reply twice to the master. The master control end will be affected by two sets of same replies, so that the system is not operated normally.
Disclosure of Invention
The technical problem to be solved by the present application is that the backup processing method of the RS485 ring network can be used for backup processing when the RS485 ring network is abnormal.
In order to solve the above problems, the present application provides a backup processing method for RS485 ring network.
The backup processing method of the RS485 ring network comprises the following steps: the main control end is connected in series with a plurality of RS485 devices through a ring network; when the main control end is in an initial stage, a first interface of the main control end sends out a first signal, and the first signal is received by a second interface of the main control end after passing through the ring network; timing the first signal at a first time in the ring network; every time the main control end is spaced with a second time, the main control end sends a test signal to the second interface from the first interface for judging whether the ring network is interrupted; if the ring network is not interrupted, the main control end sends a first control command to the first target device through the first interface; after the first target equipment completes the first control command, the target equipment sends a first response message and a second response message to the main control end; if the ring network is interrupted, the main control end drives the first interface to send a second control command to the second target device; the master control end drives the second interface to send another second control command to the second target equipment at intervals of third time; the second target device returns a third response message to the master control end according to any second control command.
The application further provides a backup processing system of the RS485 ring network, which comprises the ring network, an RS485 device end and a main control end. The ring network is connected in series with a plurality of RS485 device terminals and a master control terminal. The main control end is provided with a processing unit, a storage unit, a path control program, a first interface and a second interface, the processing unit is electrically connected with the storage unit, the first interface and the second interface, the processing unit runs the path control program recorded in the storage unit, the first interface and the second interface are respectively connected with two ends of the ring network, the main control end sends a first signal through the first interface and calculates the first time of the first signal transmitted in the ring network, and when the ring network is connected, the main control end sends a first control command to first target equipment in the ring network through the first interface; and the master control end drives the first interface to send a second control command to a second target device in the ring network, and drives the second interface to send another second control command to the second target device at intervals of a third time.
The backup processing method and the system of the RS485 ring network can provide the access control of the main control end to the target equipment under various conditions of the connection, the interruption or the connection recovery of the ring network. The backup processing method and system of RS485 ring network of the invention can realize the relevant measures of the backup of the main control end and the ring network without increasing the additional hardware cost.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application.
FIG. 1 is a schematic diagram of a backup processing system of the RS485 ring network of the present application.
FIG. 2 is a diagram of a ring network architecture according to the present application.
Fig. 3 is a schematic operation flow chart of the present application.
FIG. 4 is a timing diagram illustrating signal transmission between each interface and a target device according to the present application.
Fig. 5A is a schematic diagram of a first target device, a first response message and a second response message according to the present application.
FIG. 5B is a timing diagram illustrating signal transmission between each interface and the target device according to the present application.
FIG. 5C is a timing diagram of signal transmission when an interrupt occurs according to the present application.
Detailed Description
Embodiments of the present application will be described in detail with reference to the drawings and examples, so that how to implement technical means to solve technical problems and achieve technical effects can be fully understood and implemented.
Please refer to fig. 1 and fig. 2, which are schematic diagrams of a backup processing system of the RS485 ring network of the present application, respectively. The backup processing system 100 of the RS485 ring network of the present application includes a main control end 110, an RS485 device end 120, and a ring network 130. The ring network 130 is connected to the master 110 and the RS485 devices 120, respectively. The host 110 may be, but is not limited to, a personal computer or a server, and may also be an electronic device with communication and computing capabilities.
The main control end 110 has a processing unit 111, a storage unit 112, a path control program 113, a first interface 114 and a second interface 115. The processing unit 111 is electrically connected to the storage unit 112, the first interface 114 and the second interface 115. The storage unit 112 stores a path control program 113. In addition to the processing unit 111 executing the path control program 113, the processing unit 111 also drives the first interface 114 and the second interface 115 and transmits commands or messages. The first interface 114 and the second interface 115 can transmit any command or message, and are not limited to the transmission direction described in this application.
The first interface 114 and the second interface 115 are respectively connected to two ends of the ring network 130. In FIGS. 1 and 2, the ring network 130 is shown by thick black lines. The ring network 130 is connected in series with the RS485 device 120. In other words, the first interface 114 connects the cable to the first RS485 device 120, and the first RS485 device 120 is connected to the second RS485 device 120 through the cable, and sequentially connected to the next RS485 device 120 to the second interface 115. The designated RS485 device side 120 is specified for convenience of description in this application, and thus the designated RS485 device side 120 is defined as the target device 140. The target device in fig. 2 is only an illustration and not limited to the RS485 device 120 in one position. And the host 110 may send control commands and test signals to the target device 140 according to different transmission purposes, so as to drive the target device 140 or confirm the connection status of the ring network 130.
In the present application, to facilitate the description of the target devices in different situations, a first target device and a second target device are defined. When the ring network 130 is normally connected, the target device to be controlled by the host 110 is the first target device 510. If the ring network 130 is abnormal, the host 110 defines the device to be controlled as the second target device 520. The abnormal condition generally refers to the condition of network signal transmission interruption or network delay overlong, etc.
To further explain the operation of the present application, please refer to fig. 3, which is a schematic operation flow chart of the present application. The backup processing method of the RS485 ring network comprises the following steps:
step S310: the main control end is connected in series with a plurality of RS485 devices through a ring network;
step S320: when the main control end is in an initial stage, a first interface of the main control end sends out a first signal, and the first signal is received by a second interface of the main control end after passing through the ring network;
step S330: confirming the connection of the ring network and timing the first time that the first signal passes through the ring network;
step S340: every time the main control end is spaced with a second time, the main control end sends a test signal to the second interface from the first interface for judging whether the ring network is interrupted;
step S350: if the ring network is not interrupted, the main control end sends a first control command to the first target equipment through the first interface, and the second interface receives the first control command after the first time;
step S360: after the first target equipment completes the first control command, the target equipment sends a first response message and a second response message to the main control end;
step S370: if the ring network is interrupted, the main control end drives the first interface to send a second control command to the second target device;
step S380: judging whether the second target equipment completes the second control command within the first time;
step S381: if the second target equipment does not finish the second control command in the first time, the main control end drives the second interface to send another group of second control commands to the second target equipment at intervals of third time; and
step S382: if the second target device completes the second control command within the first time, the second target device returns a third response message to the master control end according to any second control command.
The master 110 of the present application is serially connected to a plurality of RS485 devices to form a ring network 130, as shown in fig. 2. At the initial stage of the ring network 130, the host 110 will start running the path control program 113. The path control program 113 sends a first signal to the ring network 130 through the first interface 114, as shown in fig. 4, which is a timing diagram of signal transmission between each interface and the target device 140 according to the present application.
FIG. 4 is divided into upper and lower parts, which respectively show the initial stage and operation stage of network connectionAnd (4) section. The initial stage is the stage of connecting the host 110 to the ring network 130 after the host is powered on. The host 110 will time the first signal will pass through the first interface 114, the ring network 130 and the second interface 115, and this time is the first time. If the host 110 is restarted, the host 110 will load the previous first time as the criterion of a new round in the initial stage. For example, the host 110 will determine the first time T according to the previous timen-1And multiplied by a factor m, where 0<m ≦ 5 and m is an arbitrary number; n is the number of reboot rounds of the host 110, and if n is 1, m is not counted. m Tn-1For determining whether the ring network in the initial stage is interrupted.
In other words, if the second interface 115 is at m × Tn-1If the first signal is received within the time period of (2), the second interface 115 can assume that the ring network is connected and the elapsed time of the first signal is the new first time. Conversely, the second interface 115 passes through m × Tn-1If the first signal is not received, it indicates that the ring network 130 is interrupted. The host 110 will send out an alarm signal to prompt the user that the ring network 130 is abnormal.
After confirming that the ring network 130 is normal, the host 110 sends the test signal from the first interface 114 to the second interface 115 every second time interval. The host 110 receives the test signal through the second interface 115 as an interrupt reference of the ring network 130. Wherein, the length of the second time can be set by the user.
In the operation phase, the host 110 determines whether the ring network 130 is interrupted. In the following, the commands sent in different situations can be distinguished, so that the control command sent without interruption is the first control command, and the control command sent during interruption is the second control command.
If the ring network 130 is not interrupted, the host 110 sends a first control command to the first target device 510 and the second interface 115 through the first interface 114. Since the ring network 130 is not interrupted, the first control command is transmitted to the second interface 115 in addition to flowing through the first target device 150. Therefore, after the first control command is sent from the first interface 114, the second interface 115 should receive the first control command after the first time. The path control program 113 can determine whether the loop network 130 is interrupted by receiving the first control command through the second interface 115.
The difference in the connection distance between the first target device 510 and the first interface 114 and the second interface 115 also causes the packet transmission time to be different. Therefore, in order to avoid the occurrence of repeatedly receiving the response message, a set of threshold intervals is set when the first response message is received. The master 110 starts counting the threshold interval no matter the first interface 114 receives the response message first or the second interface 115 receives the response message first. If the host 110 receives another response message within the threshold interval, the host 110 discards the second set of response messages.
At this stage, the RS485 device 120 to be operated is defined as the first target device 510. In addition to the first target device 510 executing the first control command, the first target device 510 also sends a response message after the completion. Since the first target device 510 sends the response message to the first interface 114 and the second interface 115, the response message is defined as the first response message and the second response message, respectively. The first response message and the second response message have the same content, and the receiving destinations of the first response message and the second response message are different, as shown in fig. 5A.
The host 110 receives the first response message through the first interface 114, and the second interface 115 receives the second response message. The path control program 113 determines whether the time difference between the first response message and the second response message exceeds a first predetermined threshold according to the time interval, so as to determine whether the transmission path of the ring network 130 is abnormal.
For example, the first interface 114 receives the first response message at time T1The time for the second interface 115 to receive the second response message is T2And the time duration of the first predetermined threshold is Δ T. The duration of the first predetermined threshold Δ T is proportional to the first time. When | T1-T2If | is less than Δ T, then the path control is performedThe process 113 will continue to record the ring network as a normal connection state, as shown in FIG. 5B. The first target device 510 sends the first response message and the second response message to the first interface 114 and the second interface 115 at the same time, and the first target device 510 is drawn at intervals in fig. 5B for convenience of illustration, but is not actually sent in a time-sharing manner.
The host 110 can determine whether the ring network 130 is interrupted according to the Δ T and the test signal. In practice, the breakpoint of the ring network 130 may be located between the first interface 114 and the second target device 520, and the breakpoint may be located between the second target device 520 and the second interface 115. If the breakpoint is the former case, then the second target device 520 will not receive any message. The second interface 115 does not receive the second control command after the first time has elapsed. The master 110 drives the second interface 115 to send a second control command to the second target device 520 after a third time interval, as shown in fig. 5C. In other words, the host 110 issues the second control command to the first interface 114 and the second interface 115 at different time points, respectively. In the case of a break in the ring network 130, the second target device 520 returns a third response message according to the second control command.
Alternatively, the ring network 130 between the second target device 520 and the second interface 115 is interrupted. Generally, if the second interface 115 does not receive the second control command after the first time, the host 110 determines that the ring network 130 is interrupted. With one exception, however, the second target device 520 may complete the second control command within a first time. The command processing time is too short due to the difference in the content type of the second control command or the proximity of the second target device 520 to the first interface 114. It may occur that the second target device 520 completes the second control command within the first time.
If the host 110 detects that the ring network 130 is interrupted, the host 110 detects that the second target device 520 completes the second control command and returns the third response message to the first interface 114 within the fourth time period, and the host 110 stops the second interface 115 from issuing the second control command again. The fourth time is the sum of the processing time Ta when the second target device 520 completes the second control command and twice the transmission time Tb × 2 from the first interface 114 to the second target device 520 (i.e., Ta +2 × Tb). If the master control end 110 receives the third response message in the fourth time
The backup processing method and the system of the RS485 ring network can provide the access control of the main control end to the target equipment under various conditions of the connection, the interruption or the connection recovery of the ring network. The backup processing method and system of RS485 ring network of the present application can realize the relevant measures of backup between the master control end and the ring network without increasing additional hardware cost.
The device corresponds to the description of the method flow, and the description of the method flow is referred for the deficiency, and is not repeated. The foregoing description shows and describes several preferred embodiments of the present application, but as aforementioned, it is to be understood that the application is not limited to the forms disclosed herein, but is not to be construed as excluding other embodiments and is capable of use in various other combinations, modifications, and environments and is capable of changes within the scope of the inventive concept as expressed herein, commensurate with the above teachings, or the skill or knowledge of the relevant art. And that modifications and variations may be effected by those skilled in the art without departing from the spirit and scope of the application, which is to be protected by the claims appended hereto.

Claims (7)

1. A backup processing method of RS485 ring network is characterized in that the backup processing is performed when the RS485 ring network is abnormal, the backup processing method of RS485 ring network comprises the following steps:
a main control end is connected in series with a plurality of RS485 devices through a ring network;
when the main control end is in an initial stage, a first interface of the main control end sends out a first signal, and the first signal is received by a second interface of the main control end after passing through the ring network;
timing the first signal at a first time in the ring network;
the main control end sends a test signal to the second interface from the first interface at a second time interval for judging whether the ring network is interrupted or not;
if the ring network is not interrupted, the main control end sends a first control command to a first target device through the first interface, and the second interface receives the first control command after the first time;
after the first target equipment completes the first control command, the target equipment sends a first response message and a second response message to the master control end;
if the ring network is interrupted, the main control end drives the first interface to send a second control command to a second target device;
the master control end drives the second interface to send another second control command to the second target device at an interval of third time; and
the second target device returns a third response message and a fourth response message to the master control end according to any one of the second control commands.
2. The method as claimed in claim 1, wherein the step of connecting the master to the ring network comprises: and connecting the ring network in series from the first interface to the RS485 equipment and the second interface.
3. The method of claim 1 wherein the master determines the second time according to the first time and the number of RS485 devices.
4. A backup processing system of RS485 ring network, which is characterized in that the backup processing system of RS485 ring network is used for backup processing when abnormality occurs, the backup processing system of RS485 ring network comprises:
a ring network, which is connected with a plurality of RS485 equipment ends in series; and
a main control end having a processing unit, a storage unit, a path control program, a first interface and a second interface, wherein the processing unit is electrically connected to the storage unit, the first interface and the second interface, the processing unit runs the path control program recorded in the storage unit, the first interface and the second interface are respectively connected to two ends of the ring network, the main control end sends a first signal through the first interface and calculates a first time for the first signal to be transmitted in the ring network, and when the ring network is connected, the main control end sends a first control command to a first target device in the ring network through the first interface;
the main control end sends a test signal to the second interface from the first interface every second time interval, the main control end is used for judging whether the ring network is interrupted or not, the main control end monitors that the ring network is interrupted, the main control end drives the first interface to send a second control command to a second target device in the ring network, and the main control end drives the second interface to send another second control command to the second target device every third time interval.
5. The system of claim 4 wherein the first target device receives the first control command and then sends a first response signal and a second response signal to the first interface and the second interface, respectively.
6. A redundant processing system according to claim 4 wherein said master determines said second time according to the number of RS485 devices.
7. The system of claim 4 wherein if the ring network is interrupted, the master drives the second interface to send another second control command to the second target device at the third time interval.
CN202010906045.0A 2020-09-01 2020-09-01 Backup processing method and system for RS485 ring network Pending CN111901216A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010906045.0A CN111901216A (en) 2020-09-01 2020-09-01 Backup processing method and system for RS485 ring network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010906045.0A CN111901216A (en) 2020-09-01 2020-09-01 Backup processing method and system for RS485 ring network

Publications (1)

Publication Number Publication Date
CN111901216A true CN111901216A (en) 2020-11-06

Family

ID=73225642

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010906045.0A Pending CN111901216A (en) 2020-09-01 2020-09-01 Backup processing method and system for RS485 ring network

Country Status (1)

Country Link
CN (1) CN111901216A (en)

Similar Documents

Publication Publication Date Title
US4745597A (en) Reconfigurable local area network
US20110035180A1 (en) Diagnostic apparatus and system adapted to diagnose occurrence of communication error
EP0464014A2 (en) Communications systems using a fault tolerant protocol
JP4166939B2 (en) Active fault detection
US5140586A (en) Token associated data network communications protocol
US4488232A (en) Self-adjusting, distributed control, access method for a multiplexed single-signal data bus
Rufino et al. A Columbus' egg idea for CAN media redundancy
CN107948063B (en) Method for establishing aggregation link and access equipment
CN212343793U (en) Backup processing system of RS485 ring network
CN111901216A (en) Backup processing method and system for RS485 ring network
CN102238034A (en) Method and device for maintaining link connection status and network equipment
EP0076401B1 (en) Self adjusting, distributed control, access method for a multiplexed single signal data bus
CN110974204A (en) Method, system and device for realizing bidirectional heartbeat mechanism
CN114884767B (en) Synchronous dual-redundancy CAN bus communication system, method, equipment and medium
US5784274A (en) System and method for monitoring errors occurring in data processed by a duplexed communication apparatus
TWM608805U (en) Backup processing system of RS485 ring network
CN114095462B (en) Fault-tolerant method and system for SRIO communication system of radar processor
TW202209856A (en) The redundant method and system of the rs485 ring network therefor
CN109495463B (en) Link width negotiation method, device and computer readable storage medium
JP6762032B2 (en) Power receiving device and control method
CN104185204B (en) A kind of connection status inspection method and device
JP7417773B1 (en) Network interface card and transmission performance monitoring method
JP3604868B2 (en) System and error handling method
US7724642B2 (en) Method and apparatus for continuous operation of a point-of-sale system during a single point-of-failure
JP3606593B2 (en) Multiple data batch transfer control method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination