CN113067880B - Distributed control system chain type time-sharing communication method and storage medium - Google Patents
Distributed control system chain type time-sharing communication method and storage medium Download PDFInfo
- Publication number
- CN113067880B CN113067880B CN202110332622.4A CN202110332622A CN113067880B CN 113067880 B CN113067880 B CN 113067880B CN 202110332622 A CN202110332622 A CN 202110332622A CN 113067880 B CN113067880 B CN 113067880B
- Authority
- CN
- China
- Prior art keywords
- node
- bus
- task
- time
- synchronization
- 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
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1095—Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
-
- 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/40006—Architecture of a communication node
-
- 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
- H04L12/40176—Flexible bus arrangements involving redundancy
- H04L12/40195—Flexible bus arrangements involving redundancy by using a plurality of nodes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1097—Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/146—Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
-
- 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)
- Multi Processors (AREA)
Abstract
The invention relates to a chain type time-sharing communication method of a distributed control system, which comprises the following steps: setting nodes meeting the condition of presetting a first-occupied bus as main nodes of the system, and setting other nodes as slave nodes; setting a bus occupation time window of each node, and determining a synchronization period; the master node executes the synchronization task: in a synchronization period, the main node sends a synchronization frame instruction and executes a task when the main node occupies a bus time window; the slave node executes the synchronization task: and each slave node executes tasks when receiving the synchronous frame instruction sent by the master node and reaching the respective bus occupation time window. The method adopts the periodic task synchronization frame to carry out multi-CPU synchronization, ensures the consistency of the task time of the distributed safety system and ensures the safety of the system. The invention also discloses a storage medium for the chain type time-sharing communication of the distributed control system.
Description
Technical Field
The invention belongs to the technical field of distributed system control, and particularly relates to a chain type time-sharing communication method and a storage medium for a distributed control system.
Background
The distributed design of multitask processing and multi-CPU units is generally adopted for a train control system. However, due to the defects of electronic components and uncertainty factors in the operation process, a safety design is generally required in the design of a train control system, that is, each node in the distributed control system is designed by using a safety computer, the nodes communicate with each other through a communication bus, and a communication protocol is a safety communication protocol. Each node runs a respective unique task, including a logical operation or algorithm.
In actual design, in order to simplify the design complexity of the system, each node in the system usually adopts single task design, and the nodes communicate based on the CAN/CANFD, so as to effectively support the requirements of distributed control such as instantaneity, reliability, flexibility, etc. However, this communication design method has the following problems:
1) The bus communication efficiency is low, and the packet loss rate is high. When a node in the system sends out a communication request, one or more of the other nodes are using the bus, and the bus enters an arbitration state, so that the communication efficiency of the bus is low. And when the bus is in an arbitration state, the nodes with low priority cannot get the chance of occupying the bus, so that the communication packet loss is caused. In addition, if the node needs to send multi-frame data, the bus processing arbitration or busy state is limited by the limitation of the CAN/CANFD sending buffer capacity, and the sent data is easily covered, so that the communication packet loss is caused.
2) The communication function has high CPU occupancy rate. A certain node in the system sends out a data communication request, and a communication target node may be in the task processing process at the moment and cannot respond to the communication request, so that a CPU of the node sending out the data request is always in a communication state and cannot process a core task of the CPU.
3) The hardware design is complex, and each node in the security system needs to be added with a periodic synchronization channel.
Therefore, there is a need for an improvement in the communication method of the distributed system.
Disclosure of Invention
The invention provides a chain type time-sharing communication method and a storage medium for a distributed control system.
In order to achieve the above object, the present invention provides a chain type time-sharing communication method for a distributed control system, wherein each node of the system adopts a distributed design, and the communication based on CAN/CANFD comprises:
setting nodes meeting the condition of presetting a first-occupied bus as main nodes of the system, and setting other nodes as slave nodes;
setting a bus occupation time window of each node, and determining a synchronization period;
the master node executes the synchronization task: in a synchronization period, the main node sends a synchronization frame instruction and executes a task when the main node occupies a bus time window;
the slave node executes the synchronization task: and each slave node executes tasks when receiving the synchronous frame instruction sent by the master node and reaching the respective bus occupation time window.
Preferably, the bus occupation condition is set according to the initialization start time of each node, the importance of the task responsible for each node, or the CPU performance of each node, and the maximum initialization start time, the main task responsible, or the highest CPU performance is set as the first bus occupation condition.
Preferably, the bus occupation time window of each node is a sending time window, which includes the time required by data sending and the delay time of each node.
Preferably, the method for the master node to execute the synchronization task specifically includes:
judging whether the bus is in a first synchronous period or whether bus release identifiers of all slave nodes are received;
if yes, the main node sends a synchronization frame;
when the time sending window reaching the main node is judged, the main node sends task data;
and after the task data of the main node is sent, sending a bus release identifier of the main node.
Preferably, the method for the slave node to execute the synchronization task specifically includes:
after judging that a synchronization frame instruction sent by a main node is received, starting to execute a slave node synchronization task;
each slave node executes task data sending when judging that the bus release identification of the previous node is received and the respective sending time window is reached;
and each slave node sends the bus release identification after the task data of the slave node is sent.
Preferably, the bus release identifier sent by each node is a broadcast frame, and each node in the system can receive the bus release identifiers of the other nodes.
Preferably, after the master node sends the synchronization frame instruction, the time counter starts to count; and after judging that the synchronous frame instruction sent by the main node is received, resetting the time counter and starting to accumulate time.
A storage medium storing a computer program comprising program instructions which, when executed by a processor, cause the processor to perform the distributed control system chained time division communication method.
Compared with the prior art, the invention has the advantages and positive effects that:
the invention provides a chain type time-sharing communication method of a distributed control system aiming at the communication setting of the distributed control system, based on a CAN/CANFD chain type time-sharing communication mechanism, a periodic task synchronization frame is adopted to carry out multi-CPU synchronization, nodes meeting the preset condition of a first-occupied bus are set as main nodes of the system, other nodes are set as slave nodes, and occupied bus time windows of all the nodes are set to determine a synchronization period; the main node sends a synchronous frame instruction and executes a task when the main node occupies a bus time window; and each slave node executes tasks when receiving the synchronous frame instruction sent by the master node and reaching the respective bus occupation time window. The method can perform multiple times of synchronization in one period according to project requirements, ensure the task time consistency of the distributed safety system and ensure the safety of the system; meanwhile, a CAN/CANFD chain-based time-sharing communication mechanism is adopted, so that the bus utilization rate CAN be improved, the bus arbitration is reduced, the system packet loss rate is reduced, the CPU occupancy rate of a communication function module is reduced, and the safety and the usability of the system are improved; the method is realized through software and algorithm, does not need to change a hardware structure, has high portability, and CAN be widely used for a distributed security system using CAN/CAN FD communication.
Drawings
FIG. 1 is a schematic diagram of a distributed control system of the present invention;
FIG. 2 is a general flowchart of a distributed control system chain time-sharing communication method according to the present invention;
FIG. 3 is a schematic diagram of bus allocation occupied by each node;
FIG. 4 is a detailed flow chart of the master node performing synchronization tasks;
fig. 5 is a detailed flowchart of the slave node performing the synchronization task.
Detailed Description
The following further describes embodiments of the present invention with reference to the accompanying drawings.
Each node in the distributed control system adopts a safe computer design, including but not limited to a 2OO2 design and a 1OO1D design. As to which safety design is adopted, it depends on the requirements of the safety level of the train control system, and there is no requirement in the present invention. A schematic diagram of a system structure is shown in fig. 1, and an embodiment of the present invention provides a chain type time-sharing communication method for a distributed control system, which is based on CAN/CANFD communication, and which is implemented by using a distributed design for each node of the system, and as shown in fig. 2, the method includes:
(1) And setting the nodes meeting the preset condition of the first-occupied bus as main nodes of the system, and setting the other nodes as slave nodes. Specifically, the setting of the bus occupation condition in the present application is not unique, and the bus occupation condition may be set according to the initialization start time of each node, the importance of the task in charge of each node, or the CPU performance of each node, and the maximum initialization start time, the main task in charge, or the highest CPU performance may be set as the most preemptive bus condition. In this embodiment, bus occupation conditions are specifically set according to the initialization start time of each node, that is, the time from power-on of each node to start execution of a task, the initialization start time of each node is marked as IT1, IT2, IT3 \8230, \/8230and ITn, for convenience of description, IT is assumed that IT1> IT2> IT3> \/8230and ITn are greater, the node 1 with the largest initialization start time is selected as the primary node first-occupied bus, the remaining nodes 2.. N are selected as slave nodes, the primary node is responsible for sending a synchronization frame in which each node starts execution of the task in the system, and the slave nodes start task processing after receiving the synchronization frame of the master node. Meanwhile, in order to ensure that tasks in the security system can be executed synchronously, a corresponding node needs to add a delay function.
(2) And setting a bus occupation time window of each node and determining a synchronization period. Specifically, the time required for the tasks to run by each node within the computing system is labeled LT1, LT2, LT3, \8230;. LTn, assuming LT1< LT2< LT3< \8230; < LTn. The time required for data transmission of each node is ST1, ST2, ST3, \8230;, STn, respectively. Due to the characteristics of the CAN/CANFD bus, whether the received data is received by interruption or polling, the received data does not occupy the system bus and does not cause system bus conflict, so that the time window of each node in the system for occupying the bus only comprises a sending time window. The bus allocation schematic diagram occupied by each node is shown in fig. 3, the time sequence of the bus occupied by each node is set as node 1, node 2, node 3 \8230 \ 8230;, node n, the time consumed by data transmission is not strongly correlated with the task execution time of the node, in this embodiment, the time periods occupied by each node on the bus are set to be different, the time window setting includes but is not limited to the design method based on the task time length, the bus occupied time window of each node is a transmission time window, which includes the time required by data transmission and the delay time of each node, and the synchronization period is set as shown in the following table:
node point | Time | Rules are set |
Node 1 | (Ts1)~(Ts1+ST1+ΔT) | Ts>LT1 |
Node 2 | (Ts2)~(Ts2+ST2+ΔT) | Ts2>LT2,Ts2>Ts1+ST1+ΔT |
Node 3 | (Ts3)~(Ts3+ST3+ΔT) | Ts3>LT3,Ts3>Ts2+ST2+ΔT |
…… | …… | …… |
Node n | (Tsn)~(Tsn+STn+ΔT) | Tsn>LTn,Tsn>Tsn-1+STn-1+ΔT |
And the delta T is the delay time of the running task of each node, and an actual value can be determined through debugging.
(3) The main node executes the synchronization task: in a synchronization period, the master node sends a synchronization frame instruction and executes a task when the bus occupying time window of the master node is reached. The specific flow of the master node is shown in fig. 4, that is:
judging whether the bus is in a first synchronous period or whether bus release identifiers of all slave nodes are received;
if so, the main node sends a synchronization frame to assist the system to start task circulation, and meanwhile, the time counter starts counting;
when the time sending window reaching the main node is judged, the main node sends task data;
and after the task data of the main node is sent, sending a bus release identifier of the main node.
(4) The slave node executes the synchronization task: and each slave node executes tasks when receiving the synchronous frame instruction sent by the master node and reaching the respective bus occupation time window. The specific flow of the slave node is shown in fig. 5, that is:
and after judging that a synchronous frame instruction sent by the master node is received, starting to execute the slave node synchronous task, and simultaneously resetting the time counter to start time accumulation.
Each slave node sends task data when judging that the bus release identification of the previous node is received and the respective sending time window is reached;
and each slave node sends the bus release identification of the slave node after the task data of the slave node is sent.
In this embodiment, the bus release identifier sent by each node is a broadcast frame, and each node in the system can receive the bus release identifiers of the other nodes.
Meanwhile, the present invention provides a storage medium storing a computer program including program instructions which, when executed by a processor, cause the processor to execute the distributed control system chain type time division communication method, according to the distributed control system chain type time division communication method described above.
To sum up, the chain type time-sharing communication method of the distributed control system of the invention is based on a CAN/CANFD chain type time-sharing communication mechanism, adopts a periodic task synchronization frame to carry out multi-CPU synchronization, sets a node meeting the preset condition of the first-occupied bus as a main node of the system, sets the other nodes as slave nodes, sets the occupied bus time window of each node, and determines the synchronization period; the main node sends a synchronous frame instruction and executes a task when the main node occupies a bus time window; and each slave node executes tasks when receiving the synchronous frame instruction sent by the master node and reaching the respective bus occupation time window. The method can perform multiple times of synchronization in one period according to project requirements, ensure the task time consistency of the distributed safety system and ensure the safety of the system; meanwhile, a CAN/CANFD chain-based time-sharing communication mechanism is adopted, so that the bus utilization rate CAN be improved, the bus arbitration is reduced, the system packet loss rate is reduced, the CPU occupancy rate of a communication function module is reduced, and the safety and the usability of the system are improved; the method is realized through software and algorithm, does not need to change a hardware structure, has high portability, and CAN be widely used for a distributed security system using CAN/CAN FD communication.
While the invention has been described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes may be made and equivalents may be substituted for elements thereof without departing from the scope of the invention.
Claims (5)
1. A distributed control system chain type time-sharing communication method is characterized in that each node of the system adopts a distributed design and is based on CAN/CAN FD communication, and the method comprises the following steps:
setting nodes meeting the preset condition of the first-occupied bus as main nodes of the system, and setting other nodes as slave nodes;
setting the time sequence of bus occupation of each node, setting a bus occupation time window of each node based on the task time length, and determining a synchronization period; the bus occupation time window of each node is a sending time window, and comprises the time required by data sending of each node and delay time;
the master node executes the synchronization task: in a synchronization period, the main node sends a synchronization frame instruction and executes a task when the main node occupies a bus time window;
the slave node executes the synchronization task: each slave node executes tasks when receiving a synchronous frame instruction sent by the master node and reaching respective bus occupation time windows;
the method for the master node to execute the synchronization task specifically comprises the following steps:
judging whether the bus is in a first synchronous period or whether bus release identifiers of all slave nodes are received;
if yes, the main node sends a synchronous frame;
when the time sending window reaching the main node is judged, the main node sends task data;
after the task data of the main node is sent, a bus release identifier of the main node is sent;
the method for the slave node to execute the synchronization task specifically comprises the following steps:
after judging that a synchronous frame instruction sent by a master node is received, starting to execute a slave node synchronous task, and simultaneously resetting a time counter to start time accumulation;
each slave node executes task data sending when judging that the bus release identification of the previous node is received and the respective sending time window is reached;
and each slave node sends the bus release identification to other nodes after the task data of the slave node is sent.
2. The method according to claim 1, wherein the bus occupation condition is set according to an initialization start time of each node, an importance of a task in charge of each node, or a CPU performance of each node, and a maximum initialization start time, a task in charge, or a highest CPU performance is set as a most preemptive bus condition.
3. The method according to claim 2, wherein the bus release id sent by each node is a broadcast frame, and each node in the system can receive the bus release ids of the other nodes.
4. The method according to claim 3, wherein the time counter starts counting after the master node sends the synchronization frame command; and after judging that the synchronous frame instruction sent by the main node is received, resetting the time counter and starting to accumulate time.
5. A storage medium, characterized in that the storage medium stores a computer program comprising program instructions that, when executed by a processor, cause the processor to perform the distributed control system chained time division communication method of any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110332622.4A CN113067880B (en) | 2021-03-29 | 2021-03-29 | Distributed control system chain type time-sharing communication method and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110332622.4A CN113067880B (en) | 2021-03-29 | 2021-03-29 | Distributed control system chain type time-sharing communication method and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113067880A CN113067880A (en) | 2021-07-02 |
CN113067880B true CN113067880B (en) | 2022-11-18 |
Family
ID=76564106
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110332622.4A Active CN113067880B (en) | 2021-03-29 | 2021-03-29 | Distributed control system chain type time-sharing communication method and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113067880B (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101626334A (en) * | 2009-08-10 | 2010-01-13 | 中兴通讯股份有限公司 | Method and device for controlling communication bus |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9098816B2 (en) * | 2009-01-14 | 2015-08-04 | GM Global Technology Operations LLC | Message loss prevention in can systems |
CN106656711B (en) * | 2016-12-26 | 2019-06-18 | 中核控制***工程有限公司 | A kind of predefined method of token bus time slot |
CN109395418B (en) * | 2018-11-13 | 2022-02-11 | 上海葡萄纬度科技有限公司 | Bus master-slave equipment determining method and system, medium thereof and bus equipment |
CN110943795B (en) * | 2019-10-22 | 2021-05-14 | 清华大学 | Time synchronization method suitable for bus communication system |
CN112532496A (en) * | 2020-11-30 | 2021-03-19 | 西安爱生技术集团公司 | CAN bus communication network design method for avoiding conflict |
-
2021
- 2021-03-29 CN CN202110332622.4A patent/CN113067880B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101626334A (en) * | 2009-08-10 | 2010-01-13 | 中兴通讯股份有限公司 | Method and device for controlling communication bus |
Also Published As
Publication number | Publication date |
---|---|
CN113067880A (en) | 2021-07-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10020958B2 (en) | Can fd | |
US4560985A (en) | Dual-count, round-robin distributed arbitration technique for serial buses | |
KR102445344B1 (en) | Receive clock calibration for a serial bus | |
US9692613B2 (en) | Data transmitting and receiving method, data transmitting and receiving system, master device, and slave device | |
US20030131171A1 (en) | Method and device for exchange of data between at least two users linked by means of a bus system | |
US10884786B2 (en) | Switch device, switching method, and computer program product | |
JP2014053741A (en) | Communication system | |
US7428608B2 (en) | Communication system, communication circuit and communication method | |
US20200133721A1 (en) | Semiconductor device and systems using the same | |
US9921981B2 (en) | Method to minimize the number of IRQ lines from peripherals to one wire | |
CN111090600A (en) | Bus sharing method | |
CN113067880B (en) | Distributed control system chain type time-sharing communication method and storage medium | |
JPH0652900B2 (en) | Multi-master communication bus | |
CN113785538B (en) | Media access for time-sensitive and best effort data packets and related systems, methods and devices | |
US5706430A (en) | Method and system for sequentially broadcasting data according to pre-assigned time slots with and without the reception of a synchronization packet | |
JPH06337843A (en) | Data transfer control method | |
US20120224591A1 (en) | Vehicle-Mounted Network Device | |
CN113904762B (en) | Full duplex 485 bus communication system with annular buffer zone and method | |
US20140105081A1 (en) | Communication network system | |
CN115884229B (en) | Transmission delay management method, electronic device and storage medium | |
CN113934671B (en) | Interface control chip and network equipment | |
EP3971721A1 (en) | Information processing device | |
CN116032451B (en) | Three-wire half-duplex multi-machine communication system and three-wire half-duplex multi-machine communication method | |
US20240039756A1 (en) | Can communication controller and method of operating can communication controller | |
CN117544441A (en) | Message sending control method and device, vehicle and storage medium |
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 |