Industrial control industry 485 exchange redundancy communication device and method based on FPGA

Through FPGA programming and heartbeat pulse detection module, redundant communication between 485 electrical port and optical port is achieved, solving the problem that the electrical port lines require a large number of optical fibers in traditional methods, improving fault tolerance performance and construction efficiency, and ensuring redundant communication of 485 exchange stability and fault tolerance performance.

CN119324857APending Publication Date: 2025-01-17NANJING GUODIAN NANZI WEIMEIDE AUTOMATION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411168594.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2025-01-17

AI Technical Summary

Technical Problem

The traditional 485 electrical port and optical port mutual conversion device requires a large number of optical fiber deployment when there are many electrical port lines, resulting in increased construction costs and difficulty. The redundant communication method cannot achieve redundancy between electrical ports and optical ports at the same time, and the fault tolerance performance is poor.

Method used

Design a 485 switching redundant communication device based on FPGA. Through the FPGA programming module and the heartbeat pulse detection module, redundant communication between the electrical port and the optical port is realized, supporting single-mode and multi-mode optical communication, accurately switching optical channels, and reducing optical fiber usage and construction costs to enhance fault tolerance performance.

Benefits of technology

It realizes simultaneous redundant communication between electrical ports and optical ports, reduces the need for optical fiber deployment, improves fault tolerance, ensures communication stability and fault protection, and optimizes the 485 switching redundant communication method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119324857A_ABST
    Figure CN119324857A_ABST
Patent Text Reader

Abstract

The invention discloses an industrial control industry 485 exchange redundancy communication device and method based on an FPGA, and relates to the technical field of power systems and industrial control. The RS485 photoelectric conversion redundancy communication device comprises a board card 1, a board card 2, an optical transceiver, an FPGA programming module and a heartbeat pulse detection module. The invention solves the problems that one electric port is converted into one optical port in a traditional system, the electric ports and the optical ports appear in pairs, and simultaneous redundancy of the electric ports and the optical ports cannot be realized and the space required by deployment of the two devices is slightly large when two electric-to-optical devices are commonly adopted to work together to realize redundant communication in a traditional mode. And the problem of poor fault-tolerant performance caused by using two paths of optical ports on one single board to realize redundant communication is also solved. On the basis of the traditional technology, the 485 exchange redundancy communication device supports single-mode communication and multi-mode communication, optical channels are accurately switched by fitting an optical channel fault type system, and the 485 exchange redundancy communication device is optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of power system and industrial control technology, and in particular to a 485 exchange redundant communication device and method for industrial control industry based on FPGA. Background Art

[0002] 485 communication is often used in the field of power systems and industrial control. Under the premise of ideal environment, the transmission distance of 485 communication can theoretically reach 1200 meters. In power and industrial sites, 485 communication often exists over 2 kilometers. At this time, devices that convert electrical ports and optical ports are often used to achieve long-distance communication through optical fibers.

[0003] At present, the common 485 electrical port and optical port conversion devices on site generally convert one electrical port to one optical port, and the electrical port and optical port appear in pairs. When there are more electrical port 485 lines, the number of optical ports also increases, and the demand for on-site fiber optic deployment also increases greatly. More optical fibers increase the cost of construction materials and the difficulty of construction. For sites with high requirements for the stability of optical fiber remote communication, optical fiber redundant communication is generally used. When one optical path fails, it can be switched to another optical path communication. This type of redundant communication generally uses two 485 electrical ports and optical port conversion devices or uses two optical ports on a single board to achieve redundant communication. The first redundant communication method cannot achieve simultaneous redundancy of electrical ports and optical ports at the same time, and the space required for the deployment of two devices is slightly larger. In the second method, if the single board fails, the two redundant optical ports cannot work, and the fault tolerance performance is poor. Summary of the invention

[0004] In view of the above-mentioned problems, the present invention is proposed.

[0005] Therefore, the technical problem solved by the present invention is: it solves the problem that in the traditional method, one electrical port is converted to one optical port, and the electrical port and the optical port appear in pairs, when there are many electrical port 485 lines, more optical transceivers and more optical fibers are required. It solves the problem that when two electrical-to-optical devices are often used to work together to achieve redundant communication in the traditional method, it is impossible to achieve redundancy of both the electrical port and the optical port at the same time, and the space required for the deployment of the two devices is slightly larger. It also solves the problem that when two optical ports are used on a single board to achieve redundant communication, if the single board fails, the two redundant optical ports cannot work, and the fault tolerance performance is poor.

[0006] To solve the above technical problems, the present invention provides the following technical solutions: a FPGA-based industrial control industry 485 exchange redundant communication device, which includes the following steps:

[0007] RS485 photoelectric conversion redundant communication device; the RS485 photoelectric conversion redundant communication device includes board 1, board 2, optical transceiver, FPGA programming module, and heartbeat pulse detection module; the board 1 and board 2 lead out signal transmission lines through the I / O pins of the FPGA programming module to perform data redundancy interaction; the optical transceiver determines whether the optical channel is normal based on the optical signal.

[0008] As a preferred solution of the FPGA-based industrial control industry 485 switching redundant communication device described in the present invention, the board 1 and the board 2 each have 4 485 electrical ports and one 485 optical port, the 485 rate of each electrical port is 1.8432Mbps, and the rate of the optical port is 10Mbps.

[0009] As a preferred solution of the FPGA-based industrial control industry 485 exchange redundant communication device described in the present invention, wherein: the board 1 and board 2 work redundantly. When there is no fault, only board 1 works, and board 2 exists as a redundant single board. The two single board power supplies are independently powered. When either board 1 or board 2 fails, the other single board is powered normally.

[0010] When the electrical port communication of board 1 fails, the signal transmission line is brought out through the I / O pins of the two single-board FPGAs, and the signal is communicated through the optical port of board 2. Similarly, when the optical port communication of board 1 fails, the FPGAs on the two boards judge based on data calculations, and transmit the data to board 2 through the signal transmission line of board 1, and communicate through the optical port of board 2.

[0011] As a preferred solution of the FPGA-based industrial control industry 485 switching redundant communication device described in the present invention, the interface of the optical transceiver is compatible with single-mode optical transceivers and multi-mode optical transceivers, and the corresponding optical transceiver is selected according to the needs of the engineering site.

[0012] As a preferred solution of the FPGA-based industrial control industry 485 exchange redundant communication device described in the present invention, the FPGA programming module adds 2 bits to each byte of the 485 data received by the electrical port, which is the channel identification number, indicating the source of the data, and sends it through the optical port. The FPGA module simultaneously receives the 485 data received by the optical port, analyzes the channel identification number in the data, and sends the data to the corresponding electrical port according to the channel identification number, and sends the 485 data through the four electrical ports respectively.

[0013] The channel identifier is composed of 1 parity bit and the first stop bit of 2 stop bits in the standard UART data format, which are combined into 2 bits. The 2 bits are used as special identification positions through FPGA programming to represent the channel identification number.

[0014] As a preferred solution of the FPGA-based industrial control industry 485 exchange redundant communication device described in the present invention, the heartbeat pulse detection module adopts a heartbeat pulse method to send and receive heartbeat pulses through an optical transceiver to detect whether the optical channel is normal. When the receiving end can receive periodic heartbeat pulses, it indicates that this optical path can communicate normally. When the optical transceiver cannot receive periodic heartbeat pulses, it indicates that this line has a fault and needs to switch to another optical port of the RS485 optoelectronic conversion redundant communication device for communication.

[0015] The RS485 photoelectric conversion redundant communication device gives priority to ensuring that the optical port of the board that receives data at the local electrical port performs optical communication. When the optical path of the board that receives data at the local electrical port fails, the data that needs to be sent by this board is sent to the FPGA on the other board through the signal transmission line between the I / O pins of the FPGA between the two boards, and communication is performed through the optical port of the other board. When the optical path of the main line returns to normal, the optical communication automatically switches to the optical port communication of board 1.

[0016] The board 1 is a single board that receives data through a local electrical port.

[0017] When the optical port of the remote board receives normal data, board 1 is used as the main working board, and electrical port data communication is performed through the electrical port of board 1. When the electrical port communication of board 1 is abnormal, the data that needs to be sent by this board is sent to the FPGA on board 2 through the signal transmission line between the I / O pins of the FPGA between the two boards, and communication is performed through the electrical port of board 2.

[0018] When the electrical port link of this board returns to normal, it will automatically switch to the electrical port of board 1 for communication.

[0019] As a preferred solution of the FPGA-based 485 exchange redundant communication device for industrial control industry described in the present invention, wherein: the RS485 photoelectric conversion redundant communication device switches the optical channel by fitting the optical channel fault type system.

[0020] Another object of the present invention is to provide a 485 switching redundant communication method for the industrial control industry based on FPGA, which can accurately switch optical channels by fitting the optical channel fault type method, optimize the 485 switching redundant communication method from many aspects, and solve the problem of poor fault tolerance performance.

[0021] As a preferred solution of the FPGA-based industrial control industry 485 exchange redundant communication method described in the present invention, it is characterized in that: the fitting optical channel fault type system switching optical channel includes analyzing the optical channel fault type. When the fault type is that the optical path is blocked due to optical fiber disconnection or manual plugging and unplugging, during the time when the optical fiber is manually connected and the optical path returns to normal, there is a stable time interval without optical signal, a time interval of optical signal jitter when the optical fiber is plugged in, and a stable time interval with optical signal after the line is restored. The stable time interval without optical signal is 1.5 seconds, and the stable time interval with optical signal after the line is restored is 2 seconds. The total time limit of the intermediate jitter time and the later stabilization time is completed within 6 seconds.

[0022] When the fault type is a fiber optic fault or the fiber optic connector is not properly plugged in, through FPGA programming detection, there is no previous stable time period without optical signal and no stable time period with optical signal after the line is restored, and the device does not perform redundant switching of the optical path.

[0023] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the above-mentioned FPGA-based industrial control industry 485 exchange redundant communication device are implemented.

[0024] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the FPGA-based industrial control industry 485 exchange redundant communication device as described above.

[0025] Beneficial effects of the present invention: The present invention proposes a 485 exchange redundant communication device and method based on an FPGA-based industrial control industry, which solves the problem that the traditional method converts one electrical port to one optical port, and the electrical port and the optical port appear in pairs. When there are more electrical port 485 lines, more optical transceivers and more optical fibers are required. It solves the problem that when two electrical-to-optical devices are often used to work together to achieve redundant communication in the traditional way, it is impossible to achieve redundancy of both the electrical port and the optical port at the same time, and the space required for the deployment of the two devices is slightly larger. At the same time, it also solves the problem that two optical ports are used on a single board to achieve redundant communication. If the single board fails, the two redundant optical ports cannot work and the fault tolerance performance is poor. On the basis of traditional technology, the present invention supports both single-mode and multi-mode communications, facilitates the reuse of on-site optical fibers, strengthens the protection of optical port communication faults, replaces the diagnosis of the presence or absence of optical signals with heartbeat pulses, prevents redundant mis-switching, can ensure the communication of the main line, reduce line failure links, and accurately switch optical channels by fitting the optical channel fault type system, optimizes the 485 exchange redundant communication device from many aspects, and improves the fault tolerance performance of the device. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0027] Figure 1 A schematic diagram of an RS485 photoelectric conversion redundant communication device in a 485 exchange redundant communication device in the industrial control industry based on FPGA is provided as a first embodiment of the present invention.

[0028] Figure 2 The first embodiment of the present invention provides an RS485 exchange redundant communication data format in a 485 exchange redundant communication device in the industrial control industry based on FPGA.

[0029] Figure 3 A flowchart of fitting optical channel fault processing of RS485 photoelectric conversion redundant communication device in 485 exchange redundant communication device of industrial control industry based on FPGA is provided for the second embodiment of the present invention. DETAILED DESCRIPTION

[0030] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.

[0031] Example 1, reference Figure 1-2 , which is an embodiment of the present invention, provides an industrial control industry 485 exchange redundant communication device based on FPGA, characterized in that it includes: an RS485 photoelectric conversion redundant communication device.

[0032] The 485 long-distance communication in the power system or industrial control system adopts the RS485 photoelectric conversion redundant communication device, and realizes long-distance communication through optical fiber. First, the data exchange function between multiple electrical ports and a single optical port is realized through FPGA programming, which reduces the use of optical transceivers, saves the use of optical fiber, and simplifies the on-site installation and construction. Secondly, redundant communication of electrical ports, optical ports, and dual-board hardware is realized through two single boards, which increases the reliability of system communication. On the basis of traditional technology, the present invention supports both single-mode and multi-mode optical communication modes, facilitates the reuse of on-site optical fibers, strengthens the optical port communication fault protection, replaces the diagnosis of the presence or absence of optical signals with heartbeat pulses, prevents redundant mis-switching, can ensure the main line communication, reduce line failure links, and accurately switch optical channels by fitting the optical channel fault type system, thereby optimizing the 485 exchange redundant communication device from many aspects and improving the fault tolerance performance of the device.

[0033] Figure 1 The device schematic diagram of the RS485 photoelectric conversion redundant communication device provided in this embodiment, taking the DCS system as an example, in some application occasions, it is necessary to support remote I / O modules, and the I / O modules connected to the expansion board can be configured at a remote location. The local controller baseboard and the expansion board of the remote I / O module communicate via 485. Since the 485 interfaces of the local controller baseboard and the expansion board of the remote I / O module are both electrical ports, the RS485 photoelectric conversion redundant communication device can be deployed to achieve long-distance 485 communication through optical fiber.

[0034] The RS485 photoelectric conversion redundant communication device optical transceiver interface designed by the present invention is compatible with single-mode optical transceivers and multi-mode optical transceivers, and the corresponding optical transceiver can be selected according to the needs of the project site. There may be renovation projects at the power system and industrial control site. When there are old optical fibers at the site, they may be single-mode or multi-mode optical fibers. This device can select single-mode or multi-mode optical transceiver modules for communication according to the stock of old optical fibers at the site, realizing the reuse of on-site optical fibers without the need to redeploy optical fibers, which can effectively save the cost of on-site deployment of optical fiber materials and on-site construction costs.

[0035] The RS485 photoelectric conversion redundant communication device consists of two boards. The two independent boards work redundantly. The electrical port and the optical port can realize redundant communication respectively, thus realizing redundancy of three degrees of freedom. Under normal circumstances, only one board is working, and the other board exists as a redundant board. The two boards are powered independently. When one of the two boards fails, it does not affect the normal communication of the other board, so as to achieve hardware redundancy of the communication board. There are 4 electrical ports on each board. When the electrical port communication fails, the local controller baseboard or the expansion board of the remote I / O module has two sets of redundant 485 electrical ports, which can be switched to another set of 485 electrical ports to communicate with the 4 electrical ports on the other board, so as to achieve redundant communication of the electrical ports. The two boards lead out the signal transmission line through the I / O pin of the FPGA to realize the redundant data interaction between the two boards. The transmission line has signal isolation on both boards, which enhances the anti-interference of the signal and can also realize the protection of components on the line. When a problem occurs in the optical port communication of one of the two boards, the FPGAs on the two boards can judge based on data calculations, transmit data to the other board through the signal transmission line between the boards, and realize communication through the optical port of the other board, thereby achieving redundant communication of the optical ports.

[0036] The RS485 photoelectric conversion redundant communication device supports optical port communication fault protection, and replaces the diagnosis of the presence or absence of optical signals with heartbeat pulses to prevent redundant mis-switching. In order to save costs, the device does not perform 485 data-level analysis at the FPGA level. Whether the optical channel is normal is generally determined by whether the optical transceiver receives the optical signal. However, there is a situation where the optical fiber is not plugged in tightly, and the optical transceiver can receive light but cannot receive data, which easily leads to misjudgment of whether the optical channel is normal. This patent adopts the heartbeat pulse method, and sends and receives heartbeat pulses by the optical transceiver to detect whether the optical channel is normal. When the receiving end can periodically receive the heartbeat pulse, it indicates that this optical path can communicate normally. When the optical transceiver cannot receive the periodic heartbeat pulse, it indicates that this line is faulty and needs to switch to another optical port of the device for communication. This method replaces the traditional simple judgment of whether light is received, and can make up for the misjudgment of the channel status when the light intensity is weak, such as the abnormal situation that the optical module receives light but cannot receive data, and more accurately realizes the judgment of whether the optical channel is normal, preventing redundant mis-switching. Through the delayed judgment of the optical line fault jitter, the optical redundant line is switched only after confirming that the optical line is completely stable, preventing redundant false switching and protecting the normal communication link.

[0037] The RS485 photoelectric conversion redundant communication device gives priority to ensuring that the optical port of the single board that receives data at the local electrical port performs optical communication. When the optical path of this single board fails, the data that this board needs to send is sent to the FPGA on another single board through the signal transmission line between the I / O pins of the FPGA between the two single boards, and communication is performed through the optical port of the other single board. When the optical path of the main line returns to normal, the optical communication automatically switches to the optical port communication of this board. The hardware links through which data is transmitted in this way are fewer than the hardware links through which data is transmitted across boards through the optical module of another single board. The probability of failure is lower during long-term operation. The communication of the remote single board is similar. When the optical port of the remote single board receives normal data, this board is used as the main working single board, and electrical port data communication is performed through the electrical port of this board. When the electrical port communication of this single board is abnormal, the data that this board needs to send is sent to the FPGA on another single board through the signal transmission line between the I / O pins of the FPGA between the two single boards, and communication is performed through the electrical port of another single board. When the electrical port link of this board returns to normal, it will automatically switch to the electrical port of this board for communication, reducing the problem of high failure rate during long-term operation due to the large number of hardware line links.

[0038] Through the above-mentioned processing system, the present invention proposes a 485 exchange redundant communication device and method based on an FPGA-based industrial control industry, which solves the problem that the traditional method converts one electrical port to one optical port, and the electrical port and the optical port appear in pairs. When there are more electrical port 485 lines, more optical transceivers and more optical fibers are required. It solves the problem that when two electrical-to-optical devices are often used to work together to achieve redundant communication in the traditional way, it is impossible to achieve redundancy of both the electrical port and the optical port at the same time, and the space required for the deployment of the two devices is slightly larger. At the same time, it also solves the problem that two optical ports are used on a single board to achieve redundant communication. If the single board fails, the two redundant optical ports cannot work and the fault tolerance performance is poor. On the basis of traditional technology, the present invention supports both single-mode and multi-mode communications, facilitates the reuse of on-site optical fibers, increases optical port communication fault protection, prevents redundant mis-switching, can ensure main line communication, reduce line failure links, and accurately switch optical channels by fitting the optical channel fault type system, optimizes the 485 exchange redundant communication device from many aspects, and improves the fault tolerance performance of the system.

[0039] The data exchange between the electrical port and the optical port includes FPGA adding 2 bits to each byte of the 485 data received by the electrical port, which is the channel identification number, indicating the source of the data, and sending it through the optical port. At the same time, FPGA receives the 485 data received by the optical port, analyzes the channel identification number in the data, and sends the data to the corresponding electrical port according to the channel identification number, and sends the 485 data through the four electrical ports respectively.

[0040] The channel identifier is composed of 1 parity bit and the first stop bit of 2 stop bits in the standard UART data format. Through FPGA programming, 2 bits are used as special identification positions to indicate the channel identification number.

[0041] This new system uses UART borrowing, which does not occupy extra communication data overhead. It uses 1 parity bit in the standard UART data format and the first stop bit of 2 stop bits to form 2 bits. Through programming, these 2 bits are used as special identification positions to indicate the channel identification number. It does not occupy extra communication data overhead and improves data transmission efficiency. For the RS485 exchange redundant communication data format, see Figure 2 Through FPGA programming, data exchange between four electrical ports and one optical port can be realized. Compared with the traditional transmission mode where electrical ports correspond one to one with optical ports, the use of optical transceivers can be greatly reduced, saving the cost of using optical transceivers on the equipment, reducing the cost of on-site deployment of optical fiber materials and on-site construction costs.

[0042] Example 2, reference Figure 3 , is an embodiment of the present invention, and provides a method for FPGA-based industrial control industry 485 switching redundant communication device, characterized in that it includes: RS485 photoelectric conversion redundant communication device can accurately switch optical channels by fitting the optical channel fault type system, and the RS485 photoelectric conversion redundant communication device fitting optical channel fault processing flow chart is as shown Figure 3As shown. The optical path is blocked, there are situations such as artificial plugging and unplugging, line disconnection, fiber failure, or fiber connector not plugged in properly. This patent uses a simple fitting system to analyze the type of optical path failure. When the optical path is blocked due to fiber disconnection or artificial plugging and unplugging, during the period when the optical fiber is manually connected and the optical path returns to normal, there will be a stable time interval without optical signal, a time interval of optical signal jitter after the optical fiber is plugged in, and a stable time interval with optical signal after the line is restored. This device sets a stable time interval without optical signal in the early stage to 1.5 seconds, and a stable time interval with optical signal after the line is restored to 2 seconds in the later stage. In the middle, a jitter time is allowed for artificial plugging of optical fiber. The total time of the middle jitter time and the later stable time is limited to within 6 seconds. Through FPGA programming detection, if these three intervals are met, if the main line optical path is restored from being blocked to being normal and stable, the line can switch the main line redundantly. The three times here have been verified by experiments and meet the expected results, and these three times can also be optimized. When the optical fiber fails or the optical fiber connector is not properly plugged in, the optical line signal is disturbed and will be intermittent. At this time, within a period of time, without manual troubleshooting, it is difficult to have a stable time interval without optical signal, a time interval of optical signal jitter after the optical fiber is plugged in, and a stable time interval with optical signal after the line is restored. Through FPGA programming detection, there is no stable time interval of no optical signal of 1.5s in the early stage and a stable time interval of optical signal of 2s after the line is restored in the later stage within 6s. The device does not perform redundant switching of the optical path to prevent the optical line signal from accidentally jittering, causing frequent switching of redundant lines and affecting normal communication.

[0043] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the system described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.

[0044] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0045] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0046] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or systems can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0047] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A 485 exchange redundant communication device for industrial control industry based on FPGA, characterized in that: include: RS485 photoelectric conversion redundant communication device; The RS485 photoelectric conversion redundant communication device includes board 1, board 2, optical transceiver, FPGA programming module, and heartbeat pulse detection module; The board 1 and the board 2 use the I / O pins of the FPGA programming module to lead out a signal transmission line to perform data redundancy interaction; The optical transceiver determines whether the optical channel is normal according to the optical signal.

2. The FPGA-based 485 redundant communication device for industrial control industry as claimed in claim 1, characterized in that: The board 1 and the board 2 each have four 485 electrical ports and one 485 optical port. The 485 rate of each electrical port is 1.8432Mbps, and the rate of the optical port is 10Mbps.

3. The FPGA-based 485 redundant communication device for industrial control industry as claimed in claim 2, characterized in that: The board 1 and the board 2 work redundantly. When there is no fault, only the board 1 works, and the board 2 exists as a redundant single board. The two single board power supplies are independently powered. When either the board 1 or the board 2 fails, the other single board is powered normally. When the electrical port communication of board 1 fails, a signal transmission line is brought out through the I / O pins of the two-board FPGAs, and the signal is communicated through the optical port of board 2. Similarly, when there is a problem with the optical port communication of board 1, the FPGAs on the two boards judge based on data calculations, and transmit the data to board 2 through the signal transmission line of board 1, and communicate through the optical port of board 2.

4. The FPGA-based 485 redundant communication device for industrial control industry as claimed in claim 3, characterized in that: The interface of the optical transceiver is compatible with single-mode optical transceivers and multi-mode optical transceivers. The corresponding optical transceiver is selected according to the needs of the engineering site.

5. The FPGA-based 485 redundant communication device for industrial control industry as claimed in claim 4, characterized in that: The FPGA programming module adds 2 bits to each byte of the 485 data received by the electrical port, which is the channel identification number, indicating the source of the data, and sends it through the optical port. The FPGA module also receives the 485 data received by the optical port, analyzes the channel identification number in the data, and sends the data to the corresponding electrical port according to the channel identification number, and sends the 485 data through the four electrical ports respectively; The channel identifier is composed of 1 parity bit and the first stop bit of 2 stop bits in the standard UART data format, which are combined into 2 bits. The 2 bits are used as special identification positions through FPGA programming to represent the channel identification number.

6. The FPGA-based 485 redundant communication device for industrial control industry as claimed in claim 5, characterized in that: The heartbeat pulse detection module uses a heartbeat pulse method to send and receive heartbeat pulses through an optical transceiver to detect whether the optical channel is normal. When the receiving end can receive periodic heartbeat pulses, it indicates that this optical path can communicate normally. When the optical transceiver cannot receive periodic heartbeat pulses, it indicates that this line has a fault and needs to switch to another optical port of the RS485 photoelectric conversion redundant communication device for communication; The RS485 photoelectric conversion redundant communication device gives priority to ensuring that the optical port of the board receiving data at the local electrical port performs optical communication. When the optical path of the board receiving data at the local electrical port fails, the data to be sent by the board is sent to the FPGA on the other board through the signal transmission line between the I / O pins of the FPGA between the two boards, and the communication is performed through the optical port of the other board. When the optical path of the main line returns to normal, the optical communication automatically switches to the optical port communication of board 1. The board 1 is a single board for receiving data via a local electrical port; When the optical port of the remote board receives normal data, board 1 is used as the main working board, and the electrical port data communication is carried out through the electrical port of board 1. When the electrical port communication of board 1 is abnormal, the data to be sent by this board is sent to the FPGA on board 2 through the signal transmission line between the I / O pins of the FPGA between the two boards, and communication is carried out through the electrical port of board 2. When the link of board 1 electrical port returns to normal, it automatically switches to board 1 electrical port for communication.

7. The FPGA-based 485 redundant communication device for industrial control industry as claimed in claim 6, characterized in that: The RS485 photoelectric conversion redundant communication device switches the optical channel by fitting the optical channel fault type system.

8. A method for using a FPGA-based 485 redundant communication device for industrial control industry as claimed in any one of claims 1 to 7, characterized in that: The fitting optical channel fault type system switches the optical channel, including analyzing the optical channel fault type. When the fault type is that the optical path is blocked due to the optical fiber not being connected or being manually unplugged, there is a stable time interval without optical signal, a time interval of optical signal jitter after the optical fiber is plugged in, and a stable time interval with optical signal after the line is restored, during the time when the optical fiber is manually connected and the optical path is restored to normal. The stable time interval without optical signal is 1.5 seconds, the stable time interval with optical signal after the line is restored is 2 seconds, and the total time limit of the intermediate jitter time and the later stable time is completed within 6 seconds; When the fault type is a fiber optic fault or the fiber optic connector is not properly plugged in, through FPGA programming detection, there is no previous stable time period without optical signal and no stable time period with optical signal after the line is restored, and the device does not perform redundant switching of the optical path.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of an FPGA-based industrial control industry 485 switching redundant communication device as described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of an FPGA-based industrial control industry 485 switching redundant communication device as described in any one of claims 1 to 7 are implemented.