CN115473761B - Communication method, system, equipment and medium of CAN bus based on DCS system - Google Patents
Communication method, system, equipment and medium of CAN bus based on DCS system Download PDFInfo
- Publication number
- CN115473761B CN115473761B CN202211115884.6A CN202211115884A CN115473761B CN 115473761 B CN115473761 B CN 115473761B CN 202211115884 A CN202211115884 A CN 202211115884A CN 115473761 B CN115473761 B CN 115473761B
- Authority
- CN
- China
- Prior art keywords
- protocol stack
- protocol
- bus
- monitoring result
- dcs
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000004891 communication Methods 0.000 title claims abstract description 74
- 238000000034 method Methods 0.000 title claims abstract description 44
- 238000012544 monitoring process Methods 0.000 claims abstract description 95
- 230000003993 interaction Effects 0.000 claims abstract description 17
- 230000002452 interceptive effect Effects 0.000 claims abstract description 15
- 238000004590 computer program Methods 0.000 claims description 10
- 230000005540 biological transmission Effects 0.000 description 8
- 238000010586 diagram Methods 0.000 description 5
- 230000009977 dual effect Effects 0.000 description 5
- 238000012545 processing Methods 0.000 description 4
- 238000011161 development Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/40169—Flexible bus arrangements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/407—Bus networks with decentralised control
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/18—Multiprotocol handlers, e.g. single devices capable of handling multiple protocols
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L2012/40208—Bus networks characterized by the use of a particular bus standard
- H04L2012/40215—Controller Area Network CAN
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/02—Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Environmental & Geological Engineering (AREA)
- Computer Security & Cryptography (AREA)
- Communication Control (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a communication method, a system, equipment and a medium of a CAN bus based on a DCS system, wherein a plurality of protocol stacks are arranged on the CAN bus, the protocol stacks comprise a first protocol stack and a second protocol stack, the first protocol stack is used for acquiring interactive data of the DCS system, the second protocol stack is used for monitoring the data interaction of the first protocol stack and outputting monitoring results, and the communication method comprises the following steps: acquiring a monitoring result of the second protocol stack; setting the first protocol stack according to the monitoring result; and communicating with the DCS according to the interactive data of the first protocol stack. The first protocol stack is monitored by setting the second protocol stack to obtain a monitoring result, and the first protocol stack is set according to the monitoring result, so that the reliable first protocol stack can acquire interactive data of the DCS system to communicate with the DCS system, the reliability and fault tolerance of communication are ensured, and high-reliability application scenes such as a power plant are met.
Description
Technical Field
The invention belongs to the technical field of distributed industrial control, and particularly relates to a communication method, a system, equipment and a medium of a CAN bus based on a DCS (distributed control system).
Background
With the development of information science and computer technology, digital control is realized in most industrial fields at present, and the development is proceeding towards intelligence. Among them, intelligent instruments such as intelligent sensors and intelligent actuators based on a CAN bus (controller area network) are increasingly used in industrial control fields such as power plants.
With the increase of the instrument loading of the CAN bus, the DCS system (distributed control system) needs to be changed from the original closed system to the open system. Therefore, the DCS system needs a data interaction interface with the CAN bus intelligent instrument. The DCS system not only CAN acquire real-time data (including switching value data or analog value data) of the input and output of the CAN bus intelligent instrument from the interface, but also CAN acquire other important information such as CAN bus working state information, diagnostic information and the like from the data. The CAN communication module needs to have higher reliability requirements, and if the CAN communication module (CAN master station) fails to cause CAN communication failure, the DCS system CAN lose the monitoring and management of all CAN intelligent instruments (CAN slave stations) on the CAN bus. Such fault conditions can have serious consequences if they occur in important facilities in a power plant scenario. In the prior art, the data interaction between the DCS system and the CAN bus is generally implemented using a CAN bus protocol stack chip, which depends on a specific chip vendor.
Disclosure of Invention
The invention aims to overcome the defects that CAN bus communication based on a DCS system depends on a chip and has poor reliability in the prior art, and provides a communication method, a system, equipment and a medium of the CAN bus based on the DCS system.
The invention solves the technical problems by the following technical scheme:
as a first aspect of the present invention, there is provided a communication method of a CAN bus based on a DCS system, the CAN bus being provided with a plurality of protocol stacks, the protocol stacks including a first protocol stack for acquiring interaction data of the DCS system and a second protocol stack for monitoring the first protocol stack data interaction and outputting a monitoring result, the communication method comprising:
acquiring a monitoring result of the second protocol stack;
setting the first protocol stack according to the monitoring result;
and communicating with the DCS according to the interactive data of the first protocol stack.
Preferably, the step of obtaining the monitoring result of the second protocol stack includes:
selecting one protocol stack from a plurality of protocol stacks as the first protocol stack;
and selecting one or more protocol stacks from a plurality of protocol stacks as the second protocol stack.
Preferably, before the step of obtaining the monitoring result of the second protocol stack, the method further includes:
receiving protocol stack configuration information of the DCS system;
and configuring the first protocol stack and the second protocol stack according to the protocol stack configuration information.
Preferably, if a plurality of protocol stacks are selected from the plurality of protocol stacks as the second protocol stack, the step of obtaining the monitoring result of the second protocol stack includes:
counting monitoring results of the second protocol stack;
and if the same number of the monitoring results reaches a preset threshold, outputting the monitoring results.
Preferably, the step of setting the first protocol stack according to the monitoring result includes:
judging the online state of the first protocol stack according to the monitoring result;
and setting the first protocol stack according to the online state.
Preferably, the monitoring result includes a heartbeat time interval and a heartbeat loss number, and the step of judging the online state of the first protocol stack according to the monitoring result includes:
if the heartbeat time interval is lower than a preset interval threshold value and the heartbeat loss times are lower than a preset times threshold value, judging that the state of the first protocol stack is online;
and if the heartbeat time interval is higher than a preset interval threshold value and/or the heartbeat loss times are higher than a preset times threshold value, judging that the state of the first protocol stack is offline.
Preferably, the step of setting the first protocol stack according to the presence status includes:
and when the online state of the first protocol stack is offline, selecting one protocol stack from the second protocol stack to be set as the first protocol stack.
As a second aspect of the present invention, there is provided a communication system based on a CAN bus of a DCS system, the CAN bus being provided with a plurality of protocol stacks, the protocol stacks including a first protocol stack for acquiring interaction data of the DCS system and a second protocol stack for monitoring the first protocol stack data interaction and outputting a monitoring result, the communication system comprising:
the acquisition module is used for acquiring the monitoring result of the second protocol stack;
a protocol stack setting module, configured to set the first protocol stack according to the monitoring result;
and the communication module is used for communicating with the DCS according to the interactive data of the first protocol stack.
As a third aspect of the present invention, there is provided an electronic device including a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the above-described DCS-system-based CAN bus communication method when executing the computer program.
As a fourth aspect of the present invention, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the DCS-system-based CAN bus communication method described above.
The invention has the positive progress effects that:
according to the communication method, the system, the equipment and the medium of the CAN bus based on the DCS system, the second protocol stack is arranged to monitor the first protocol stack to obtain the monitoring result, and the first protocol stack is arranged according to the monitoring result, so that the reliable first protocol stack CAN acquire the interactive data of the DCS system to communicate with the DCS system, the reliability and the fault tolerance of the CAN bus communication are ensured, and the high-reliability application scenes of a power plant and the like are met. Furthermore, the method uses a software method to replace the traditional method of using a protocol stack chip to carry out data interaction between the DCS system and the CAN bus, thereby getting rid of the dependence on specific suppliers.
Drawings
Fig. 1 is a flow chart of a communication method based on a DCS system based CAN bus of embodiment 1 of the present invention;
fig. 2 is a schematic sub-flowchart of a communication method of a DCS system-based CAN bus of embodiment 1 of the present invention;
FIG. 3 is another sub-flowchart of the communication method of the CAN bus based on the DCS system in embodiment 1 of the invention;
fig. 4 is a hardware configuration diagram of a communication method of a DCS system-based CAN bus according to embodiment 1 of the present invention;
FIG. 5 is a diagram showing the address space of a memory in the communication method based on the CAN bus of the DCS system in embodiment 1 of the invention;
fig. 6 is a schematic block diagram of a communication system based on a CAN bus of a DCS system according to embodiment 2 of the present invention;
fig. 7 is a schematic structural diagram of an electronic device in embodiment 3 of the present invention.
Detailed Description
The invention is further illustrated by means of the following examples, which are not intended to limit the scope of the invention.
Example 1
The embodiment provides a communication method of a CAN bus based on a DCS system, wherein a plurality of protocol stacks are arranged on the CAN bus, each protocol stack comprises a first protocol stack and a second protocol stack, the first protocol stack is used for acquiring interaction data of the DCS system, the second protocol stack is used for monitoring the data interaction of the first protocol stack and outputting a monitoring result, and as shown in fig. 1, the communication method comprises the following steps:
and step 101, acquiring a monitoring result of the second protocol stack.
Step 102, setting the first protocol stack according to the monitoring result.
And step 103, communicating with the DCS according to the interactive data of the first protocol stack.
The second protocol stack is arranged to monitor the first protocol stack to obtain a monitoring result, and the first protocol stack is arranged according to the monitoring result, so that the reliable first protocol stack CAN acquire the interactive data of the DCS system to communicate with the DCS system, the reliability and fault tolerance of CAN bus communication are ensured, and the high-reliability application scenes of a power plant and the like are met. Furthermore, the method uses a software method to replace the traditional method of using a protocol stack chip to carry out data interaction between the DCS system and the CAN bus, thereby getting rid of the dependence on specific suppliers.
Specifically, as shown in fig. 2, step 101 includes, before:
step 1001, selecting a protocol stack as a first protocol stack.
In this step, a plurality of protocol stacks on the CAN bus are selected, and one protocol stack is selected from the plurality of protocol stacks as a first protocol stack.
Step 1002, selecting one or more protocol stacks as a second protocol stack.
In this step, one or more protocol stacks may be selected from the plurality of protocol stacks and set as the second protocol stack, so that a plurality of protocol stack scenarios may be satisfied.
After the selection is finished, the following steps are executed:
step 1003, receiving protocol stack configuration information of the DCS system.
Step 1004, configuring the first protocol stack and the second protocol stack according to the protocol stack configuration information.
In one embodiment, the protocol stack configuration information includes an operating mode of the CAN bus protocol stack: the main working mode or the hot backup working mode, the main working mode protocol stack is a first protocol stack, and the hot backup working mode protocol stack is a second protocol stack. The protocol stack configuration information also comprises CAN bus baud rate, CAN master station heartbeat time interval setting, CAN master station heartbeat allowable loss times setting, CAN slave station heartbeat time interval setting and CAN slave station heartbeat loss times setting. Taking the first protocol stack as an example, writing a configuration event ID in a mailbox space of a memory of the first protocol stack, sending an interrupt signal by the memory to trigger the first protocol stack to generate interrupt processing, and reading a message in a mailbox space received in the memory. If the message is the configuration event ID, the first protocol stack reads the configuration data space of the memory, acquires the protocol stack configuration message, configures the receiving and transmitting mode of the communication request baud rate, and configures the heartbeat time interval and the heartbeat loss times by sending the CAN message. The second protocol stack is configured to monitor only the first protocol stack through the protocol configuration information, and obtain a monitoring result, and does not send any CAN message to any slave station on the CAN bus. And after the first protocol stack and the second protocol stack are configured according to the protocol stack configuration information, monitoring the first protocol stack by the second protocol stack to set the first protocol stack to communicate with the DCS.
In one embodiment, if a plurality of protocol stacks are selected from the plurality of protocol stacks as the second protocol stack, step 101 includes:
and counting the monitoring result of the second protocol stack.
If the number of the same monitoring results reaches a preset threshold, outputting the monitoring results, and outputting the monitoring results when the number of the same monitoring results exceeds half of the number of all the monitoring results, so that errors of the final results caused by different monitoring results of a plurality of second protocol stacks are prevented, the setting of the first protocol stack is influenced, and the accuracy of the monitoring results is ensured.
Specifically, as shown in fig. 3, step 102 further includes:
and 1021, judging the online state of the first protocol stack according to the monitoring result.
In this step, the monitoring result includes a heartbeat time interval and the number of heartbeat losses. If the heartbeat time interval is lower than a preset interval threshold value and the heartbeat loss times are lower than a preset times threshold value, judging that the state of the first protocol stack is online;
and if the heartbeat time interval is higher than a preset interval threshold value and/or the heartbeat loss times are higher than a preset times threshold value, judging that the state of the first protocol stack is offline.
The second protocol stack judges the online state of the first protocol stack by monitoring the heartbeat time interval and the heartbeat loss times, so that the first protocol stack is convenient to set subsequently.
Step 1022, setting up a first protocol stack according to the presence status.
In the step, when the online state of the first protocol stack is offline, one protocol stack is selected from the second protocol stack and is set as the first protocol stack, so that the offline first protocol stack is replaced, normal communication between the first protocol stack and the DCS is ensured, and the reliability and fault tolerance of communication are improved.
The following further describes the DCS system-based CAN bus communication method in this embodiment in combination with an example of a dual redundancy CAN bus composed of one first protocol stack and one second protocol stack:
as shown in fig. 4, the hardware architecture of this example specifically includes: the system comprises a dual redundant power supply module, a main control module, a communication transmission module 0, a communication transmission module 1, a dual-port RAM module 0, a dual-port RAM module 1, a CAN bus protocol stack module 0 and a CAN bus protocol stack module 1.
Specifically, the input end of the dual-redundancy power supply module is connected with two paths of external power supplies, the external power supplies are converted into a main control module, a communication transmission module 0 and a communication transmission module 1, and rated voltages required by the dual-port RAM module 0, the dual-port RAM module 1, the CAN bus protocol stack module 1 and the CAN bus protocol stack module 2 are supplied to hardware of all modules.
The communication transmission module 0 and the communication transmission module 1 are connected with the port of the main controller module through communication ports and are used for receiving control instructions of the DCS control unit and forwarding the control instructions to the main control module and sending data or information of the main control module to the DCS control unit.
The dual-port RAM module 0 and the dual-port RAM module 1 are used for enabling the main control module to interact with the CAN bus protocol stack module 0 and the CAN bus protocol stack module 1. As shown in fig. 5, the address space of the dual port RAM module 0 and the dual port RAM module 1 should be divided into at least 8 address space regions. The main control module can read and write data and information in any address stored in the dual-port RAM module 0 and the dual-port RAM module 1. The CAN bus protocol stack module 0, namely the first protocol stack CAN read the data and information stored in the dual-port RAM module 0 and CAN write the data and information into any address stored in the dual-port RAM module 0; the CAN bus protocol stack module 1, namely the second protocol stack, CAN read the data and information stored in the dual-port RAM module 1 and CAN write the data and information into any address stored in the dual-port RAM module 1.
The main control module acquires DCS system protocol stack configuration information received by the communication transmission module 0 and the communication transmission module 1, and accordingly configures a CAN bus protocol stack module 0, namely a first protocol stack and the CAN bus protocol stack module 1, namely the CAN bus communication baud rate of a second protocol stack. If the CAN bus protocol stack module 0 is configured to be in a CAN master station working mode, the CAN bus protocol stack module 1 is configured to be in a CAN monitoring station working mode.
The communication method of the CAN bus based on the DCS system is realized by the CAN bus protocol stack module 0 and the CAN bus protocol stack module 1. Specifically, if the CAN bus protocol stack is of a dual redundancy design, then: the dual-redundancy CAN bus communication module needs to be provided with a first protocol stack to realize communication and control of intelligent instruments on the CAN bus. Meanwhile, the CAN bus communication module also needs a silent second protocol stack for monitoring the heartbeat information of the CAN master station on the CAN bus, wherein the heartbeat information comprises the heartbeat time interval and the heartbeat loss times.
In one embodiment, the hardware of the main control module may be a microcontroller (single chip microcomputer/MCU) or a Microprocessor (MPU), and the hardware of the CAN protocol stack module 0 and the hardware of the CAN protocol stack module 1 may be a microcontroller (single chip microcomputer/MCU) or a Microprocessor (MPU), wherein the architecture of the microcontroller may be ARM and AVR (both are microcontroller architectures). The microprocessor architecture may be ARM, X86, powerPC, MIPS (all microprocessor architectures).
The specific communication method comprises the following steps: the protocol stack of the CAN bus performs step 1003, receiving CAN protocol stack configuration information by waiting for an interrupt. Taking CAN bus protocol stack module 0 as an example, when the main control module sends a mailbox space writing configuration event ID to the dual-port RAM module 0, the dual-port RAM module 0 sends an interrupt signal to trigger the CAN bus protocol stack 0 module to generate interrupt processing, and reads the message in the mailbox space from the dual-port RAM module 0 in the embedded software interrupt processing function of the CAN bus protocol stack. And if the message is the configuration event ID, the CAN bus protocol stack module 0 reads the configuration data space of the dual-port RAM module 0 to acquire a protocol stack configuration message.
After the protocol stack configuration information is obtained, step 1004 is executed, and the first protocol stack and the second protocol stack are configured according to the protocol stack configuration information. If the CAN protocol stack module 0 is configured into a main working mode, namely, is set into a first protocol stack, CAN communication is initialized into a transceiving mode with the configuration requirement baud rate, and a CAN slave station is configured by sending a CAN message, and the heartbeat time interval of the CAN slave station is configured. If the interrupt generated by the dual-port RAM module 0 is generated, the message acquired in the receiving mailbox of the dual-port RAM module 0 is the output event ID, and the CAN bus protocol stack module 0 reads the output data from the CAN slave station output address space of the dual-port RAM module 0 and sends the output data to the appointed CAN slave station through the CAN message. The CAN bus protocol stack embedded software running on the CAN bus protocol module 0 receives the CAN message from the CAN slave station in the CAN receiving interrupt, if the CAN message is the input real-time data, the input real-time data is written into the CAN slave station input real-time data space of the dual-port RAM module 0; if the CAN message is alarm information, the alarm information is written into the CAN slave station alarm information space of the port RAM module 0.
If the CAN bus protocol stack 0 module is configured to be in a hot standby working mode, namely, is set to be in a second protocol stack, CAN communication is initialized to be in a receiving mode with a configuration requirement baud rate, only step 101 is executed, CAN messages on the CAN bus are monitored, specifically including heartbeat time intervals and heartbeat loss times, and no CAN messages are sent to any CAN slave station on the CAN bus.
Step 102 is executed, and the first protocol stack is set according to the monitoring result, specifically including: and 1021, judging the online state of the first protocol stack according to the monitoring result. If the number of the second protocol stacks is more than one, firstly counting the monitoring results of the second protocol stacks, if the number of the same monitoring results reaches a preset threshold, outputting the monitoring results, and normally outputting the monitoring results when the number of the same monitoring results exceeds one half of the number of all the monitoring results.
If the first protocol stack is in the offline state, step 1022 is executed to set the first protocol stack according to the online state. And writing a master station fault event ID in a sending mailbox of the dual-port RAM module 0. And switching the working mode into a main working mode, namely a first protocol stack, reinitializing CAN communication into a transceiving mode with the configuration requirement on the baud rate, and sending the heartbeat of the main station to the CAN bus according to the heartbeat time interval of the main station with the configuration requirement.
After the first protocol stack is set, step 103 is executed, the first protocol stack periodically reads the information in the dual-port RAM module 0 and sends the information to the DCS according to the interaction data of the first protocol stack to communicate with the DCS.
In one embodiment, the method is applicable to a plurality of CAN application layer protocols including: CANopen protocol, iCAN protocol, deviceNet protocol, J1939 protocol (both CAN application layer protocols), etc. The method can analyze and package protocol messages such as CANopen protocol messages, iCAN protocol messages, deviceNet protocol messages, J1939 protocol messages (all protocol messages) and the like.
According to the communication method of the CAN bus based on the DCS system, the second protocol stack is arranged to monitor the first protocol stack to obtain the monitoring result, and the first protocol stack is arranged according to the monitoring result, so that the reliable first protocol stack CAN acquire the interactive data of the DCS system to communicate with the DCS system, the reliability and fault tolerance of the CAN bus communication are guaranteed, and the high-reliability application scenes of a power plant and the like are met. Furthermore, the method uses a software method to replace the traditional method of using a protocol stack chip to carry out data interaction between the DCS system and the CAN bus, thereby getting rid of the dependence on specific suppliers.
Example 2
The embodiment provides a communication system based on a CAN bus of a DCS system, wherein a plurality of protocol stacks are arranged on the CAN bus, each protocol stack comprises a first protocol stack and a second protocol stack, the first protocol stack is used for acquiring interaction data of the DCS system, the second protocol stack is used for monitoring the data interaction of the first protocol stack and outputting a monitoring result, and as shown in fig. 6, the communication system comprises:
the obtaining module 201 is configured to obtain a monitoring result of the second protocol stack.
The protocol stack setting module 202 is configured to set a first protocol stack according to the monitoring result.
And the communication module 203 is used for communicating with the DCS system according to the interactive data of the first protocol stack.
The second protocol stack is arranged to monitor the first protocol stack to obtain a monitoring result, and the first protocol stack is arranged according to the monitoring result, so that the reliable first protocol stack CAN acquire the interactive data of the DCS system to communicate with the DCS system, the reliability and fault tolerance of CAN bus communication are ensured, and the high-reliability application scenes of a power plant and the like are met. Furthermore, the method uses a software method to replace the traditional method of using a protocol stack chip to carry out data interaction between the DCS system and the CAN bus, thereby getting rid of the dependence on specific suppliers.
Specifically, the method comprises the following steps:
a selecting unit 2001, configured to select one protocol stack as a first protocol stack and one or more protocol stacks as a second protocol stack.
And the receiving unit 2002 is used for receiving the protocol stack configuration information of the DCS system.
A configuration unit 2003, configured to configure the first protocol stack and the second protocol stack according to the protocol stack configuration information.
In one embodiment, if a plurality of protocol stacks are selected from the plurality of protocol stacks as the second protocol stack, the obtaining module 201 further includes:
the statistics unit 2011 is configured to count a monitoring result of the second protocol stack.
If the number of the same monitoring results reaches a preset threshold, outputting the monitoring results, and outputting the monitoring results when the number of the same monitoring results exceeds one half of the number of all the monitoring results.
Specifically, the protocol stack setting module 202 includes:
the judging unit 2021 is configured to judge an online state of the first protocol stack according to the listening result.
The monitoring result comprises a heartbeat time interval and the heartbeat loss times, and if the heartbeat time interval is lower than a preset interval threshold value and the heartbeat loss times are lower than a preset times threshold value, the state of the first protocol stack is judged to be online;
and if the heartbeat time interval is higher than a preset interval threshold value and/or the heartbeat loss times are higher than a preset times threshold value, judging that the state of the first protocol stack is offline.
The second protocol stack judges the online state of the first protocol stack by monitoring the heartbeat time interval and the heartbeat loss times, so that the first protocol stack is convenient to set subsequently.
A setting unit 2022, configured to set the first protocol stack according to the presence status.
When the on-line state of the first protocol stack is off-line, one protocol stack is selected from the second protocol stack and is set as the first protocol stack, so that the off-line first protocol stack is replaced, normal communication between the first protocol stack and the DCS is ensured, and the reliability and fault tolerance of communication are improved.
It should be noted that, the working principle of the communication system based on the CAN bus of the DCS system in this embodiment is the same as that of the communication method based on the CAN bus of the DCS system in embodiment 1, and thus will not be described herein.
Example 3
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, where the electronic device includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor, and the processor implements the above-mentioned communication method based on the DCS system CAN bus when executing the program. The electronic device 30 shown in fig. 7 is only an example and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
The electronic device 30 may be in the form of a general purpose computing device, which may be a server device, for example. Components of electronic device 30 may include, but are not limited to: the at least one processor 31, the at least one memory 32, a bus 33 connecting the different system components, including the memory 32 and the processor 31.
The bus 33 includes a data bus, an address bus, and a control bus.
Memory 32 may include volatile memory such as Random Access Memory (RAM) 321 and/or cache memory 322, and may further include Read Only Memory (ROM) 323.
Memory 32 may also include a program/utility 325 having a set (at least one) of program modules 324, such program modules 324 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
The processor 31 executes various functional applications and data processing, such as the above-described DCS system-based CAN bus communication method, by running a computer program stored in the memory 32.
The electronic device 30 may also communicate with one or more external devices 34 (e.g., keyboard, pointing device, etc.). Such communication may be through an input/output (I/O) interface 35. Also, model-generating device 30 may also communicate with one or more networks, such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet, via network adapter 36. As shown, network adapter 36 communicates with the other modules of model-generating device 30 via bus 33. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in connection with the model-generating device 30, including, but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, data backup storage systems, and the like.
It should be noted that although several units/modules or sub-units/modules of an electronic device are mentioned in the above detailed description, such a division is merely exemplary and not mandatory. Indeed, the features and functionality of two or more units/modules described above may be embodied in one unit/module in accordance with embodiments of the present invention. Conversely, the features and functions of one unit/module described above may be further divided into ones that are embodied by a plurality of units/modules.
Example 4
The present embodiment provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the DCS system-based CAN bus communication method as in the above embodiments.
More specifically, among others, readable storage media may be employed including, but not limited to: portable disk, hard disk, random access memory, read only memory, erasable programmable read only memory, optical storage device, magnetic storage device, or any suitable combination of the foregoing.
In a possible embodiment, the invention may also be implemented in the form of a program product comprising program code for causing a terminal device to carry out the communication method implementing the DCS system based CAN bus of the above embodiments, when said program product is run on the terminal device.
Wherein the program code for carrying out the invention may be written in any combination of one or more programming languages, which program code may execute entirely on the user device, partly on the user device, as a stand-alone software package, partly on the user device and partly on the remote device or entirely on the remote device.
While specific embodiments of the invention have been described above, it will be appreciated by those skilled in the art that this is by way of example only, and the scope of the invention is defined by the appended claims. Various changes and modifications to these embodiments may be made by those skilled in the art without departing from the principles and spirit of the invention, but such changes and modifications fall within the scope of the invention.
Claims (5)
1. The communication method of the CAN bus based on the DCS system, a plurality of protocol stacks are arranged on the CAN bus, the protocol stacks comprise a first protocol stack and a second protocol stack, the first protocol stack is used for acquiring interactive data of the DCS system, the second protocol stack is used for monitoring the data interaction of the first protocol stack and outputting monitoring results, and the communication method is characterized by comprising the following steps:
acquiring a monitoring result of the second protocol stack;
setting the first protocol stack according to the monitoring result;
communicating with the DCS according to the interactive data of the first protocol stack;
the step of obtaining the monitoring result of the second protocol stack includes:
selecting one protocol stack from a plurality of protocol stacks as the first protocol stack;
selecting a plurality of protocol stacks from a plurality of protocol stacks as the second protocol stack, wherein the step of obtaining the monitoring result of the second protocol stack comprises the following steps:
counting monitoring results of the second protocol stack;
if the same number of the monitoring results reaches a preset threshold, outputting the monitoring results;
the step of setting the first protocol stack according to the monitoring result includes:
judging the online state of the first protocol stack according to the monitoring result;
setting the first protocol stack according to the online state;
the monitoring result comprises a heartbeat time interval and a heartbeat loss number, and the step of judging the online state of the first protocol stack according to the monitoring result comprises the following steps:
if the heartbeat time interval is lower than a preset interval threshold value and the heartbeat loss times are lower than a preset times threshold value, judging that the state of the first protocol stack is online;
if the heartbeat time interval is higher than a preset interval threshold value and/or the heartbeat loss times are higher than a preset times threshold value, judging that the state of the first protocol stack is offline;
the step of setting the first protocol stack according to the presence state includes:
and when the online state of the first protocol stack is offline, selecting one protocol stack from the second protocol stack to be set as the first protocol stack.
2. The DCS system-based CAN bus communication method of claim 1, wherein the step of obtaining the monitoring result of the second protocol stack further comprises, before:
receiving protocol stack configuration information of the DCS system;
and configuring the first protocol stack and the second protocol stack according to the protocol stack configuration information.
3. The utility model provides a communication system based on CAN bus of DCS, be equipped with a plurality of protocol stack on the CAN bus, the protocol stack includes first protocol stack and second protocol stack, first protocol stack is used for acquireing the interactive data of DCS, the second protocol stack is used for monitoring first protocol stack data is mutual to output monitoring result, its characterized in that, communication system includes:
the acquisition module is used for acquiring the monitoring result of the second protocol stack;
a protocol stack setting module, configured to set the first protocol stack according to the monitoring result;
the communication module is used for communicating with the DCS according to the interactive data of the first protocol stack;
a selecting unit, configured to select one of the protocol stacks as the first protocol stack and select a plurality of protocol stacks from a plurality of the protocol stacks as the second protocol stack, where the obtaining module further includes:
the statistics unit is used for counting the monitoring result of the second protocol stack; if the number of the same monitoring results reaches a preset threshold, outputting the monitoring results;
the protocol stack setting module comprises:
the judging unit is used for judging the online state of the first protocol stack according to the monitoring result;
the monitoring result comprises a heartbeat time interval and a heartbeat loss number, and if the heartbeat time interval is lower than a preset interval threshold value and the heartbeat loss number is lower than a preset number threshold value, the state of the first protocol stack is judged to be online; if the heartbeat time interval is higher than a preset interval threshold value and/or the heartbeat loss times are higher than a preset times threshold value, judging that the state of the first protocol stack is offline;
the setting unit is used for setting the first protocol stack according to the online state;
and when the online state of the first protocol stack is offline, selecting one protocol stack from the second protocol stack to be set as the first protocol stack.
4. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the DCS-based CAN bus communication method of claim 1 or claim 2 when executing the computer program.
5. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the DCS-system-based CAN-bus communication method of claim 1 or claim 2.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211115884.6A CN115473761B (en) | 2022-09-14 | 2022-09-14 | Communication method, system, equipment and medium of CAN bus based on DCS system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211115884.6A CN115473761B (en) | 2022-09-14 | 2022-09-14 | Communication method, system, equipment and medium of CAN bus based on DCS system |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN115473761A CN115473761A (en) | 2022-12-13 |
| CN115473761B true CN115473761B (en) | 2024-03-15 |
Family
ID=84333606
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211115884.6A Active CN115473761B (en) | 2022-09-14 | 2022-09-14 | Communication method, system, equipment and medium of CAN bus based on DCS system |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN115473761B (en) |
Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR20110082430A (en) * | 2010-01-11 | 2011-07-19 | 한국해양대학교 산학협력단 | Protocol converter for network monitoring |
| CN103197652A (en) * | 2013-04-12 | 2013-07-10 | 北京四方继保自动化股份有限公司 | Profibus communication control device for heat-engine plant integrated system |
| CN105743755A (en) * | 2016-04-19 | 2016-07-06 | 上海君协光电科技发展有限公司 | Dual-redundant CAN bus communication system |
| CN105785905A (en) * | 2016-04-15 | 2016-07-20 | 北京开疆智能自动化科技有限公司 | Configurable field bus system and configuration method thereof |
| KR101813067B1 (en) * | 2017-09-06 | 2017-12-28 | 홍석민 | SCADA MAINTENANCE MANAGING SYSTEM AND A GATEWAY WITH IoT MONITORING FUNCTION |
| CN108599986A (en) * | 2015-11-24 | 2018-09-28 | 广东欧珀移动通信有限公司 | Processing method, application processor and the mobile terminal of network communicating function exception |
| CN114697194A (en) * | 2022-02-17 | 2022-07-01 | 清华大学 | Blocking type event notification method and device |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108270813B (en) * | 2016-12-30 | 2021-02-12 | 华为技术有限公司 | Heterogeneous multi-protocol stack method, device and system |
-
2022
- 2022-09-14 CN CN202211115884.6A patent/CN115473761B/en active Active
Patent Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR20110082430A (en) * | 2010-01-11 | 2011-07-19 | 한국해양대학교 산학협력단 | Protocol converter for network monitoring |
| CN103197652A (en) * | 2013-04-12 | 2013-07-10 | 北京四方继保自动化股份有限公司 | Profibus communication control device for heat-engine plant integrated system |
| CN108599986A (en) * | 2015-11-24 | 2018-09-28 | 广东欧珀移动通信有限公司 | Processing method, application processor and the mobile terminal of network communicating function exception |
| CN105785905A (en) * | 2016-04-15 | 2016-07-20 | 北京开疆智能自动化科技有限公司 | Configurable field bus system and configuration method thereof |
| CN105743755A (en) * | 2016-04-19 | 2016-07-06 | 上海君协光电科技发展有限公司 | Dual-redundant CAN bus communication system |
| KR101813067B1 (en) * | 2017-09-06 | 2017-12-28 | 홍석민 | SCADA MAINTENANCE MANAGING SYSTEM AND A GATEWAY WITH IoT MONITORING FUNCTION |
| CN114697194A (en) * | 2022-02-17 | 2022-07-01 | 清华大学 | Blocking type event notification method and device |
Non-Patent Citations (2)
| Title |
|---|
| DCS在电厂控制系统的应用及展望;许宁;;电站系统工程(第01期);第60-61页 * |
| 一种新型冗余CAN网络通信协议栈的研制;陈娅娟;孙汉旭;贾庆轩;叶平;;测控技术(11);第4-48页 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN115473761A (en) | 2022-12-13 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US7861110B2 (en) | System, method, and adapter for creating fault-tolerant communication busses from standard components | |
| CN102035862B (en) | Configuration node fault transfer method and system in SVC cluster | |
| CN107347018B (en) | Three-redundancy 1553B bus dynamic switching method | |
| CN111767244B (en) | Dual-redundancy computer equipment based on domestic Loongson platform | |
| JPH09508483A (en) | Networking module and method for fault tolerant transmission of system management information | |
| JP2004021556A (en) | Memory control device and control process thereof | |
| CN116699964B (en) | Redundant operation method and system for industrial process controller | |
| CN112583683B (en) | A master-slave CAN FD bus application layer communication method and system, and electronic equipment | |
| CN109271330A (en) | General BMC system based on integrated information system | |
| CN105159851A (en) | Multi-controller storage system | |
| CN108333527A (en) | Battery management system loop interlock and from control address setting method | |
| CN111740879A (en) | Data acquisition and data forwarding gateway implementation method | |
| CN108616428A (en) | A kind of mobile APP implementations of remote management RACK computer rooms | |
| CN115061453A (en) | Nuclear power plant DCS fault processing method and device, electronic equipment and storage medium | |
| CN115705267A (en) | Monitoring acquisition equipment, and main/standby switching method and system based on monitoring acquisition equipment | |
| CN107872361A (en) | Processing device, network device, processing device control method, network device control method, and recording medium | |
| CN104243172A (en) | Expanded input/output device of decentralized control system, and method thereof | |
| CN112015600B (en) | Log information processing system, log information processing method and device and switch | |
| CN115473761B (en) | Communication method, system, equipment and medium of CAN bus based on DCS system | |
| CN102638306A (en) | 1394b optical bus monitor and monitoring method thereof | |
| CN115616891A (en) | Hot standby redundancy control system and method of front-end processor based on OPC UA technology | |
| JP2015127926A (en) | Communication system and communication control method | |
| CN107347070A (en) | A kind of data transmission security control device of medium voltage distribution network | |
| CN106789495B (en) | A single-controller master-slave network bus controller online switching method | |
| KR100775982B1 (en) | Guaranteed Distributed Control System |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |