CN110536467B - ZigBee networked industrial control system communication scheduling method and coordinator thereof - Google Patents

ZigBee networked industrial control system communication scheduling method and coordinator thereof Download PDF

Info

Publication number
CN110536467B
CN110536467B CN201910805640.2A CN201910805640A CN110536467B CN 110536467 B CN110536467 B CN 110536467B CN 201910805640 A CN201910805640 A CN 201910805640A CN 110536467 B CN110536467 B CN 110536467B
Authority
CN
China
Prior art keywords
coordinator
communication
polling
edge cluster
edge
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
Application number
CN201910805640.2A
Other languages
Chinese (zh)
Other versions
CN110536467A (en
Inventor
黄伟
赵亦欣
冉茂琪
段宝燕
杨佩
张丹阳
黄健桓
袁海波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Southwest University
Original Assignee
Southwest University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Southwest University filed Critical Southwest University
Publication of CN110536467A publication Critical patent/CN110536467A/en
Application granted granted Critical
Publication of CN110536467B publication Critical patent/CN110536467B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/418Total factory control, i.e. centrally controlling a plurality of machines, e.g. direct or distributed numerical control [DNC], flexible manufacturing systems [FMS], integrated manufacturing systems [IMS] or computer integrated manufacturing [CIM]
    • G05B19/4185Total factory control, i.e. centrally controlling a plurality of machines, e.g. direct or distributed numerical control [DNC], flexible manufacturing systems [FMS], integrated manufacturing systems [IMS] or computer integrated manufacturing [CIM] characterised by the network communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W72/00Local resource management
    • H04W72/12Wireless traffic scheduling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/18Self-organising networks, e.g. ad-hoc networks or sensor networks
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Automation & Control Theory (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Manufacturing & Machinery (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Small-Scale Networks (AREA)

Abstract

The invention provides a ZigBee networking industrial control system communication scheduling method, which comprises the following steps of S1: the coordinator combines each node of the bottom layer with an edge cluster; s2: the coordinator sets a polling sequence, initializes the total time T of communication polling and the polling time T of the control loop edge cluster queue-insertion into the communication polling queueq(ii) a S3: the coordinator polls each edge cluster in turn according to a polling sequence, wherein the control loop edge cluster controls the insertion of the loop edge cluster into a communication polling queue of a common edge cluster in a preemptive mode; the communication polling is started, firstly, the communication of an edge cluster of an initiating control loop is inserted, a coordinator and the edge cluster adopt a master-slave polling mechanism, the coordinator serves as a master station to initiate a communication request, and each edge cluster serves as a slave station to receive the request and execute corresponding operation; the invention can ensure the real-time performance of control, improve the utilization rate of bandwidth resources and improve the scale of the system.

Description

ZigBee networked industrial control system communication scheduling method and coordinator thereof
Technical Field
The invention relates to the field of automation control, in particular to a ZigBee networked industrial control system communication scheduling method and a coordinator thereof.
Background
In ZigBee wireless communication, network bandwidth resources and communication rate are limited, network collision can be caused by an event-triggered communication mode, network data delay is large, and contradiction exists between the network data delay and the real-time requirement of a networked control system. In the traditional means for solving the problems, a controlled object and a communication network are regarded as generalized objects from the control point of view, and the problems of uncertainty, nonlinearity, strong coupling and the like of the generalized objects cause the difficulty of object modeling; from the perspective of communication, the means of increasing network bandwidth and improving communication rate are difficult to meet the requirements of low power consumption in industrial field and system operation.
The traditional ZigBee network includes three topologies: the system comprises a star network, a tree network and a mesh network, wherein the number of bottom nodes in the star network is too large, and the total amount of data to be processed by a central coordinator is large; the tree network has more intermediate nodes for data transmission and obvious communication delay; the mesh network has high resource overhead, and the measurement information of the measurement node in the control loop may be forwarded to the control node via a plurality of nodes, so that the control instantaneity is difficult to be ensured.
Therefore, a communication scheduling method of the ZigBee networked industrial control system and a coordinator thereof need to be provided.
Disclosure of Invention
In view of this, the present invention provides a ZigBee networked industrial control system communication scheduling method, which can ensure real-time control, improve the utilization rate of bandwidth resources, and improve the system scale.
The invention provides a communication scheduling method of a ZigBee networked industrial control system, which comprises the following steps:
s1: the coordinator combines the edge clusters of all the nodes at the bottom layer to obtain a common edge cluster and a control loop edge cluster; the common edge cluster consists of measuring nodes serving as edge nodes and measuring nodes serving as an edge data center; the control loop edge cluster consists of a measurement combination as an edge node and a control node as an edge data center; at most one control loop edge cluster is arranged; only one measuring node serving as an edge data center is arranged in each common edge cluster; only one control node is used as an edge data center in the edge cluster of the control loop;
s2: the coordinator sets a polling sequence of communication, specifically: the coordinator sets a communication polling queue of a common edge cluster; setting a control loop edge cluster, and controlling the loop edge cluster to insert a queue into a communication polling queue in a preemption mode; setting communication polling start, firstly inserting and initiating communication of a control loop edge cluster; the coordinator and the edge clusters adopt a master-slave polling mechanism, the coordinator serves as a master station to initiate a communication request, and each edge cluster serves as a slave station to receive the request and execute corresponding operation;
the coordinator initializes the total communication polling time T and the polling time T for controlling the insertion of the edge cluster of the loop into the communication polling queueq
S3: the coordinator polls each edge cluster in turn according to the polling sequence, and specifically comprises:
s31: when communication polling is started, the coordinator inserts and sends a polling communication request frame to the control loop edge cluster; wherein, the control loop edge cluster is used as the current edge cluster;
at the same time, the coordinator starts timing T1And T2
S32: the coordinator judges whether a communication response frame sent by the current edge cluster is received, if so, the coordinator reads the data of the communication receiving buffer area to a temporary variable, the received data counter accumulates the data, and the step S33 is entered; if not, repeating the step S32;
s33: the analyzing, by the coordinator, the received communication response frame sent by the current edge cluster specifically includes: the coordinator judges whether the temporary variable is required effective data or not according to the receiving interrupt flag bit, and if so, the data currently received by the coordinator is stored in other data cache regions; if not, the received data counter is cleared, other data cache regions are cleared, and the coordinator exits from receiving;
s34: judging whether an edge cluster which is not polled exists in the communication polling queue, if not, entering the step S35; if yes, go to step S36;
s35: judging and timing T1Whether the total communication polling time T is reached; if yes, entering next communication polling and returning to the step S31; if not, returning to the step S35;
s36: judging and timing T2Whether or not to equal TqIf not, the process proceeds to step S37; if yes, timing T2Clearing, and proceeding to step S38;
s37: the coordinator judges whether the 1 st byte data of the currently received data is required effective data, if so, the next common edge cluster of the current edge cluster in the communication polling queue is used as a new current edge cluster according to the polling sequence of communication; the coordinator sends a polling communication request frame to the new current edge cluster, and then proceeds to step S32; if not, the received data timer is cleared, the first-level data cache area is cleared, the coordinator exits the received data interruption, and the step S37 is returned;
s38: the coordinator inserts the control loop edge cluster into a communication polling queue to enable the control loop edge cluster to be positioned at the position of the next communication polling queue of the current edge cluster; at the same time, the coordinator restarts the timing T2Then, the process proceeds to step S37.
Further, when the coordinator sends a polling communication request frame to the current edge cluster, the coordinator enters into sending interruption and sending data; and when the coordinator finishes sending the polling communication request frame to the current edge cluster, the coordinator returns back to receive the interrupt.
Further, when the coordinator sends a polling communication request frame to the current edge cluster, the coordinator enters into sending interruption to send data, and the method specifically includes:
step 1: the coordinator acquires the data address and the length of a polling communication request frame sent to a current edge cluster;
step 2: the coordinator judges whether the sending register is empty, if so, the coordinator sends data in the polling communication request frame to the current edge cluster, and the data pointer points to the address of the next data; if not, waiting.
Further, the sending of data in the interrupt by the coordinator specifically includes: the coordinator judges whether the value of a data transmission counter is equal to the length value of a polling communication request frame to be transmitted or not, if so, the coordinator exits from a data transmission terminal, the data transmission counter is cleaned, a data pointer is released, and a transmission completion interrupt flag bit is set; if not, the data counter is sent to accumulate, and the data pointer points to the address of the next data.
Further, the returning of the reception interrupt by the coordinator specifically includes:
and the coordinator judges whether all the polling communication request frames sent to the current edge cluster are sent completely according to the sending completion interrupt flag bit, if so, the coordinator returns to the receiving interrupt when the sending interrupt is started, and continues to receive the data sent by the current edge cluster.
Further, T > Tq;Tq≤100ms。
Further, the coordinator sends a polling communication request frame to the node with the lowest address code in the edge cluster; and the coordinator receives a response frame sent by the node with the largest address code in the edge cluster.
Further, the polling communication request frame structure of the coordinator write command is as follows: node address code + function code + write register address + write value; the polling communication request frame structure of the coordinator read command is as follows: the address of the first node of the current edge cluster + function code.
Correspondingly, the invention also provides a coordinator of the ZigBee networked industrial control system, which comprises
The communication module is communicated with the ZigBee module and used for sending a communication message to the edge cluster and receiving a communication response frame of the edge cluster by the coordinator;
the queue grouping module is used for combining edge clusters of all nodes at the bottom layer to obtain a common edge cluster and a control loop edge cluster; the common edge cluster consists of measuring nodes serving as edge nodes and measuring nodes serving as an edge data center; the control loop edge cluster consists of a measurement combination as an edge node and a control node as an edge data center; at most one control loop edge cluster is arranged; only one measuring node serving as an edge data center is arranged in each common edge cluster; only one control node is used as an edge data center in the edge cluster of the control loop;
the polling module is used for sequentially polling each edge cluster according to a set polling sequence of communication; setting a communication polling queue of a common edge cluster; setting a control loop edge cluster, and controlling the loop edge cluster to insert a queue into a communication polling queue in a preemption mode; setting communication polling start, firstly inserting and initiating communication of a control loop edge cluster; the coordinator and the edge clusters adopt a master-slave polling mechanism, the coordinator serves as a master station to initiate a communication request, and each edge cluster serves as a slave station to receive the request and execute corresponding operation;
wherein the communication module comprises
The ZigBee communication unit is used for packaging user data or analyzing a ZigBee protocol by wirelessly receiving an original message to obtain an application layer communication message;
and the self-defined communication protocol analysis and encapsulation unit is used for analyzing the communication message frame of the application layer, correctly identifying the command and executing corresponding operation.
Further, the coordinator performs communication scheduling by adopting the following method:
s1: the coordinator combines the edge clusters of all the nodes at the bottom layer to obtain a common edge cluster and a control loop edge cluster; the common edge cluster consists of measuring nodes serving as edge nodes and measuring nodes serving as an edge data center; the control loop edge cluster consists of a measurement combination as an edge node and a control node as an edge data center; at most one control loop edge cluster is arranged; only one measuring node serving as an edge data center is arranged in each common edge cluster; only one control node is used as an edge data center in the edge cluster of the control loop;
s2: the coordinator sets a polling sequence of communication, specifically: the coordinator sets a communication polling queue of a common edge cluster; setting a control loop edge cluster, and controlling the loop edge cluster to insert a queue into a communication polling queue in a preemption mode; setting communication polling start, firstly inserting and initiating communication of a control loop edge cluster; the coordinator and the edge clusters adopt a master-slave polling mechanism, the coordinator serves as a master station to initiate a communication request, and each edge cluster serves as a slave station to receive the request and execute corresponding operation;
the coordinator initializes the total communication polling time T and the polling time T for controlling the insertion of the edge cluster of the loop into the communication polling queueq
S3: the coordinator polls each edge cluster in turn according to the polling sequence, and specifically comprises:
s31: when communication polling is started, the coordinator inserts and sends a polling communication request frame to the control loop edge cluster; wherein, the control loop edge cluster is used as the current edge cluster;
at the same time, the coordinator starts timing T1And T2
S32: the coordinator judges whether a communication response frame sent by the current edge cluster is received, if so, the coordinator reads the data of the communication receiving buffer area to a temporary variable, the received data counter accumulates the data, and the step S33 is entered; if not, repeating the step S32;
s33: the analyzing, by the coordinator, the received communication response frame sent by the current edge cluster specifically includes: the coordinator judges whether the temporary variable is required effective data or not according to the receiving interrupt flag bit, and if so, the data currently received by the coordinator is stored in other data cache regions; if not, the received data counter is cleared, other data cache regions are cleared, and the coordinator exits from receiving;
s34: judging whether an edge cluster which is not polled exists in the communication polling queue, if not, entering the step S35; if yes, go to step S36;
s35: judging and timing T1Whether the total communication polling time T is reached; if yes, entering next communication polling and returning to the step S31; if not, returning to the step S35;
s36: judging and timing T2Whether or not to equal TqIf not, the process proceeds to step S37; if yes, timing T2Clearing, and proceeding to step S38;
s37: the coordinator judges whether the 1 st byte data of the currently received data is required effective data, if so, the next common edge cluster of the current edge cluster in the communication polling queue is used as a new current edge cluster according to the polling sequence of communication; the coordinator sends a polling communication request frame to the new current edge cluster, and then proceeds to step S32; if not, the received data timer is cleared, the first-level data buffer area is cleared, the coordinator exits the received data interruption, and the step S37 is returned.
S38: the coordinator inserts the control loop edge cluster into a communication polling queue to enable the control loop edge cluster to be positioned at the position of the next communication polling queue of the current edge cluster; at the same time, the coordinator restarts the timing T2Then, the process proceeds to step S37.
The invention has the beneficial effects that:
1. the real-time control of a control loop is ensured under the limited bandwidth resources and communication rate of the ZigBee wireless network;
2. under the limited bandwidth resources and communication rate of the ZigBee wireless network, the nodes are grouped, and the edge clusters are regarded as a whole to carry out the request and response of communication transactions, so that the communication transaction time required for sequentially polling all bottom-layer nodes is reduced;
3. according to the user-defined protocol, the analog quantity and the digital quantity can be read only by needing a plurality of communication messages originally and are integrated into one communication message for reading, and the analog quantity and the digital quantity can be simultaneously written in only one communication message for writing. Because the ZigBee protocol stack stipulates a short response frame of 11 bytes which can be replied when data is received, the write response frame of an application layer is reduced in a write operation instruction, the time occupied by a write command is reduced, and the time available for polling a bottom layer node is maximized.
4. And the coordinator judges the 1 st byte data in the current polling edge cluster communication message in the interruption receiving process, and immediately enters into sending interruption to send a request frame to the next edge cluster when the judgment result is yes, without waiting for the completion of the analysis of all data in the response frame of the current polling edge cluster, and then executes an instruction for sending the request frame to the edge cluster j. The problems of large number of bytes of received data, long data processing time and the like in the prior art are solved.
Drawings
The invention is further described below with reference to the following figures and examples:
FIG. 1 is a flow chart of the present invention;
FIG. 2 is a network topology diagram of a polling process according to an embodiment of the present invention;
fig. 3 is a network topology diagram of an embodiment in which a node in an edge cluster fails to communicate.
Detailed Description
The invention is explained in detail below with reference to the drawings in the specification, and as shown in fig. 1, the communication scheduling method for the ZigBee networked industrial control system provided by the invention comprises the following steps:
s1: the coordinator combines the edge clusters of all the nodes at the bottom layer to obtain a common edge cluster and a control loop edge cluster; the common edge cluster consists of measuring nodes serving as edge nodes and measuring nodes serving as an edge data center; the control loop edge cluster consists of a measurement combination as an edge node and a control node as an edge data center; at most one control loop edge cluster is arranged; only one measuring node serving as an edge data center is arranged in each common edge cluster; only one control node is used as an edge data center in the edge cluster of the control loop; in the control loop edge cluster, a measurement node is used as an edge node to sample the output of a controlled object, carry out engineering quantity conversion, convert the output into a dimensionless number and execute partial control operation, a control node is used as an edge data center to receive sampling information, then carry out the rest part of the control operation and output the result of the control operation to an execution mechanism, and the control node is also used in the edge clusterThe node with the largest address code; in the common edge cluster, a measuring node is used as an edge node, and a node with the largest address code in the edge cluster is used as an edge data center; in this embodiment, each node on the bottom layer is combined with an edge cluster, and the number of nodes that can be accommodated by the system is 2i × (T)z-m × (3T '/2))/((i +1) T') +2m, where T iszRepresents the total time that the coordinator polls all the underlying nodes; m represents the number of control loops, m is a positive integer, T' is the time required for separately polling a node for requesting a response, and i represents the number of nodes in an edge cluster, and is a positive integer; under the limited bandwidth resources and communication rate of the ZigBee wireless network, the nodes are grouped, and the edge clusters are regarded as a whole to carry out the request and response of communication transactions, so that the communication transaction time required for sequentially polling all the bottom nodes is reduced.
S2: the coordinator sets a polling sequence of communication, specifically: the coordinator sets a communication polling queue of a common edge cluster; setting a control loop edge cluster, and controlling the loop edge cluster to insert a queue into a communication polling queue in a preemption mode; setting communication polling start, firstly inserting and initiating communication of an edge cluster of a control loop, wherein the setting can ensure the real-time performance of the control loop; the coordinator and the edge clusters adopt a master-slave polling mechanism, the coordinator serves as a master station to initiate a communication request, and each edge cluster serves as a slave station to receive the request and execute corresponding operation;
the coordinator initializes the total communication polling time T and the polling time T for controlling the insertion of the edge cluster of the loop into the communication polling queueq(ii) a The initialization value of the total communication polling time T is initialized according to the existing master-slave polling mechanism, so that all the bottom-layer nodes (each edge cluster) can be polled in the total communication polling time T.
S3: the coordinator polls each edge cluster in turn according to the polling sequence, and specifically comprises:
s31: when communication polling is started, the coordinator inserts and sends a polling communication request frame to the control loop edge cluster; wherein, the control loop edge cluster is used as the current edge cluster;
at the same time, the coordinator starts timing T1And T2;T1For timing the total time of communication polling, T2And controlling the polling time of the circuit edge cluster queue-inserting into the communication polling queue to be timed.
S32: the coordinator judges whether a communication response frame sent by the current edge cluster is received, if so, the coordinator reads the data of the communication receiving buffer area to a temporary variable, the received data counter accumulates the data, and the step S33 is entered; if not, repeating the step S32;
s33: the analyzing, by the coordinator, the received communication response frame sent by the current edge cluster specifically includes: the coordinator judges whether the temporary variable is required effective data or not according to the receiving interrupt flag bit, and if so, the data currently received by the coordinator is stored in other data cache regions; if not, the received data counter is cleared, other data cache regions are cleared, and the coordinator exits from receiving; wherein the interrupt flag bit marks whether the temporary variable is valid data.
S34: judging whether an edge cluster which is not polled exists in the communication polling queue, if not, entering the step S35; if yes, go to step S36;
s35: judging and timing T1Whether the total communication polling time T is reached; if yes, entering next communication polling and returning to the step S31; if not, returning to the step S35; returning to step S35, i.e. keeping the timer T1Until a time T1The total communication polling time T is reached.
S36: judging and timing T2Whether or not to equal TqIf not, the process proceeds to step S37; if yes, timing T2Clearing, and proceeding to step S38; in the method, when the time T is counted2To reach TqIf the current edge cluster is not polled, then it is necessary to poll the current edge cluster first to complete T2Zero clearing and re-entering next TqAt the next TqAt the beginning, a polling communication request frame is sent to a control loop edge cluster in a preemptive mode; so that the time T is counted here2To reach TqThen directly inserting the control loop edge cluster into the communication polling queue of the common edge cluster, and sending a round to the control loop edge cluster in a preemptive modeA poll communication request frame. In addition, the method only schedules the normal polling condition of the edge cluster, and if the edge cluster fails to feed back a communication response frame to the coordinator for a long time, another fault-tolerant mechanism (fault-tolerant method) needs to be started to deal with the condition, and the fault-tolerant mechanism does not belong to the protection content of the application, and is not described herein.
S37: the coordinator judges whether the 1 st byte data of the currently received data is required effective data, if so, the next common edge cluster of the current edge cluster in the communication polling queue is used as a new current edge cluster according to the polling sequence of communication; the coordinator sends a polling communication request frame to the new current edge cluster, and then proceeds to step S32; if not, the received data timer is cleared, the first-level data buffer area is cleared, the coordinator exits the received data interruption, and the step S37 is returned. After the validity judgment is carried out on whether the 1 st byte data of the currently received data is the required valid data or not, the polling operation is executed according to the judgment result, so that the problems of large number of bytes of the received data, long data processing time and the like in the prior art are solved, and the polling efficiency is improved.
S38: the coordinator inserts the control loop edge cluster into a communication polling queue to enable the control loop edge cluster to be positioned at the position of the next communication polling queue of the current edge cluster; at the same time, the coordinator restarts the timing T2(i.e., the polling time T for entering the next communication poll queueq) Then, the process proceeds to step S37. By the method, the real-time performance of ZigBee networked industrial control can be guaranteed, the time occupied by the write command is reduced, the available time for polling the bottom node is maximized, the utilization rate of bandwidth resources is improved, and the system scale is improved.
In this embodiment, each node inside the edge cluster performs information transmission in a communication hidden token manner, so as to avoid the problem of communication collision caused by simultaneous communication of multiple nodes. Specifically, the method for each node in the edge cluster to adopt the communication invisible token comprises the following steps:
the method comprises the following steps: the node with the minimum address code in the current edge cluster is used as an initial node and receives a polling request sent by a coordinator;
step two: the initial node judges whether the function code in the communication message receiving the polling request is a write command request or a read command request, if the function code is the write command request, the step III is carried out, and if the function code is the read command request, the initial node is taken as the current node, and the step IV is carried out;
step three: the starting node actively initiates an 11-byte short frame response by the MAC layer without uploading response of application data; therefore, after the execution is finished, the uploading response of the application data is not needed, the writing operation can be performed in a single writing mode or in batch mode, the analog quantity and the digital quantity can be written in only one communication message at the same time, the operation is performed only on a single node, the writing response frame of an application layer is reduced in the writing operation instruction, the time occupied by the writing command is reduced, and the available time for polling the bottom node is maximized. In the polling process, a write command generation process preferentially executes the write command operation in a polling queue 'insertion' mode, and the coordinator write command request frame structure is as follows: node address code + function code + write register address + write value.
Step four: judging whether the current node is an edge data center or not, if not, entering a fifth step, and if so, entering a sixth step;
step five: adding the current node information to the end of the received communication message frame to form a new communication message, forwarding the new communication message to a next node of which the address code is 1 greater than the address code of the current node in the current polling edge cluster, taking the next node as a new current node, and returning to the fourth step; the length of the added node information is a fixed value, so that in the network configuration process, the address codes in the same edge cluster are configured to be continuously increased and cannot generate random jump;
step six: judging whether the current node is a control node, if so, integrating the node data which is subjected to control operation in the current polling edge cluster to form a final control operation result, executing control output, and entering a seventh step; if not, directly entering the step seven;
step seven: and integrating the information of all the nodes in the current polling edge cluster, uniformly packaging to form a response frame, and sending the response frame to the coordinator to complete the communication transaction of the current polling edge cluster. Wherein the response frame has a structure that: address code I + address code II + function code + data of each node; in the structure of the response frame, an address code I is an address code of an edge data center in the current polling edge cluster, an address code II is an address code in a request message frame in the current polling edge cluster, and node data are arranged from low to high according to the size of a node address. In the read operation, a plurality of communication messages are originally needed to read the analog quantity and the digital quantity, and the analog quantity and the digital quantity are integrated into one communication message for reading. The polling communication request frame structure when reading information is as follows: address code (address of first node of edge cluster) + function code. When a read command request is received, the length of a received message is L1+ a x (numi-numj), wherein L1 is the length of a communication message of a polling request sent by a coordinator and is a fixed constant; a is the data length which needs to be added by each edge node and is a fixed constant; numi represents the address code of the node; numj represents an address code in the communication packet frame.
Further, each node in the edge cluster is also provided with a fault tolerance mechanism, specifically, when the current edge cluster receives a polling request message for the first time, the step five returns to the step four and simultaneously needs to start to judge whether a new current node fails to communicate, once the node is judged to fail to communicate, the subsequent operation of the step four is stopped to be executed, and the fault tolerance recovery operation is started; and if no node fails and cannot communicate, continuing to execute the subsequent operation of the step four. In this way, the first node in the edge cluster does not need to start a fault-tolerant mechanism, the abnormality of the coordinator itself is judged by the upper monitoring software, whether the abnormality is the address code in the polling instruction that the first node in the edge cluster should have the coordinator, and the abnormality is judged by the address code of the node itself, if the abnormality is equal to the address code, the abnormality is the first node in the edge cluster, otherwise, the fault-tolerant mechanism is started, that is, the fault-tolerant module of the edge node is started.
Specifically, the judgment of whether the new current node fails to communicate is performed, and once the node is judged to fail to communicate, the subsequent operation of the fourth step is stopped to enter the fault-tolerant recovery operation; if no node fails and cannot communicate, continuing to execute the subsequent operation of the fourth step, specifically comprising:
s4-1: starting a request timeout register, and setting the timing length of the request timeout register to be Tc;Tc>Tz;TzRepresents the total time to poll all the underlying nodes;
s4-2: is judged at TcIf so, the new current node transmits a request frame together with self information to a next node of which the address code is 1 greater than that of the new current node in the current polling edge cluster in a token mode, and restarts a request timeout timer; if not, the new current node actively forms a request message and sends the request message to the next node which is forwarded to the current polling edge cluster and has the address code which is 1 more than the address code of the new current node. By the method, data transmission in an invisible token mode in the edge cluster is realized, the coordinator can conveniently and quickly locate the edge cluster with abnormal communication and the corresponding node through the response frame of the edge data center, and diagnosis and report are carried out, so that maintenance is facilitated.
Further, the request message structure actively formed by the new current node in step S4-2 is: address code III + function code II + new current node self information; the address code III is the address of the new current node, and the function code II is the function code of the polling request received by the new current node. The polling request function code is used to indicate a write command function request or a read command function request.
Further, in the seventh step, the structure of the response frame is: the method comprises the following steps that (1) an address code I + an address code II + a function code I + each node data; in the structure of the response frame, an address code I is an address code of an edge data center in the current polling edge cluster, an address code II is an address code in a request message frame in the current polling edge cluster, and node data are arranged from low to high according to the size of a node address. According to the fault-tolerant mechanism, when a certain node has a communication fault, the remaining nodes in the same edge cluster can still transmit data in an invisible token mode, and the coordinator can quickly locate the edge cluster with abnormal communication and the corresponding node through the response frame of the edge data center to diagnose and report, so that the maintenance is facilitated. If the edge data center is in failure, the address 1 and the address 2 in the response frame are both address codes of the edge data center, so that the coordinator can judge whether a node is in failure according to the two addresses and quickly detect the failed node, meanwhile, the coordinator also needs to set a response timeout timer, and if the node is in failure, the edge data center is judged to be in failure; such an arrangement facilitates the coordinator to diagnose the health status of the underlying edge clusters. Specifically, the coordinator can judge whether the node in the network is abnormal according to the two address codes in the response frame, and judge that the address code of the abnormal node is uploaded for monitoring interface display. The coordinator judges the health state of the edge cluster according to the address code, and the method comprises the following steps: the coordinator judges whether the absolute value of the difference value of the two address codes is equal to the number of edge nodes in the edge cluster stored in the coordinator, and if so, the coordinator proves that no node in the edge cluster has abnormal communication; if the judgment result is negative, at least the edge node with the address code 1 smaller than the address code 2 can be judged, and communication abnormity exists; the coordinator also needs to set a response timeout timer, and if a response frame transmitted by the edge data center data is not received within a specified time, the edge data center has communication abnormity; the coordinator can also set a response timeout timer, and if the response timeout timer is overtime, the border data center is judged to be in fault.
Further, when the coordinator sends a polling communication request frame to the current edge cluster, the coordinator enters into sending interruption and sending data; and when the coordinator finishes sending the polling communication request frame to the current edge cluster, the coordinator returns back to receive the interrupt. When the coordinator does not send the polling communication request frame, other main tasks are executed, so that the task execution efficiency and the polling efficiency of the coordinator are improved.
Further, when the coordinator sends a polling communication request frame to the current edge cluster, the coordinator enters into sending interruption to send data, and the method specifically includes:
step 1: the coordinator acquires the data address and the length of a polling communication request frame sent to a current edge cluster;
step 2: the coordinator judges whether the sending register is empty, if so, the coordinator sends data in the polling communication request frame to the current edge cluster, and the data pointer points to the address of the next data; if not, waiting.
Further, the sending of data in the interrupt by the coordinator specifically includes: the coordinator judges whether the value of a data transmission counter is equal to the length value of a polling communication request frame to be transmitted or not, if so, the coordinator exits from a data transmission terminal, the data transmission counter is cleaned, a data pointer is released, and a transmission completion interrupt flag bit is set; the coordinator can start to execute other tasks, so that the efficiency of the coordinator in executing the tasks is improved, and waste and task queuing caused by long-time occupation of the coordinator are avoided; if not, the data counter is sent to accumulate, and the data pointer points to the address of the next data.
Further, the returning of the reception interrupt by the coordinator specifically includes:
and the coordinator judges whether all the polling communication request frames sent to the current edge cluster are sent completely according to the sending completion interrupt flag bit, if so, the coordinator returns to the receiving interrupt when the sending interrupt is started, and continues to receive the data sent by the current edge cluster.
Further, T > Tq;Tq≤100ms;0<t0≤10ms。TqThe value setting is related to the control cycle of the control loop, and in order to ensure that the sampling data of the edge node in the control loop is transmitted to the control node in real time, control operation and execution control output are carried out, and the real-time performance of control is ensured, the value within 100ms is taken. In this example, t0Preferably 10 ms.
Further, the coordinator sends a polling communication request frame to the node with the lowest address code in the edge cluster; and the coordinator receives a response frame sent by the node with the largest address code in the edge cluster. Therefore, each node in the edge cluster can conveniently transmit information in a token mode, the coordinator can diagnose the health state of the nodes in the edge cluster according to the response frame fed back by the edge cluster, the utilization rate of bandwidth resources is improved, and the scale of the system is improved.
Further, the polling communication request frame structure of the coordinator write command is as follows: node address code + function code + write register address + write value; the polling communication request frame structure of the coordinator read command is as follows: the address of the first node of the current edge cluster + function code. The function code is used to mark whether a write command or a read command.
Correspondingly, the invention also provides a coordinator of the ZigBee networked industrial control system, which comprises
The communication module is communicated with the ZigBee module and used for sending a communication message to the edge cluster and receiving a communication response frame of the edge cluster by the coordinator;
the queue grouping module is used for combining edge clusters of all nodes at the bottom layer to obtain a common edge cluster and a control loop edge cluster; the common edge cluster consists of measuring nodes serving as edge nodes and measuring nodes serving as an edge data center; the control loop edge cluster consists of a measurement combination as an edge node and a control node as an edge data center; at most one control loop edge cluster is arranged; only one measuring node serving as an edge data center is arranged in each common edge cluster; only one control node is used as an edge data center in the edge cluster of the control loop;
the polling module is used for sequentially polling each edge cluster according to a set polling sequence of communication; setting a communication polling queue of a common edge cluster; setting a control loop edge cluster, and controlling the loop edge cluster to insert a queue into a communication polling queue in a preemption mode; setting communication polling start, firstly inserting and initiating communication of a control loop edge cluster; the coordinator and the edge clusters adopt a master-slave polling mechanism, the coordinator serves as a master station to initiate a communication request, and each edge cluster serves as a slave station to receive the request and execute corresponding operation;
because each node in the edge cluster is also provided with a fault-tolerant mechanism, the coordinator can judge the health state of the edge cluster according to the response frame sent by the edge cluster. The coordinator further includes
And the diagnosis module is used for diagnosing the health state of the edge cluster according to the analysis of the communication message and uploading response abnormal information for monitoring and displaying.
Wherein the communication module comprises
The ZigBee communication unit is used for packaging user data or analyzing a ZigBee protocol by wirelessly receiving an original message to obtain an application layer communication message;
and the self-defined communication protocol analysis and encapsulation unit is used for analyzing the communication message frame of the application layer, correctly identifying the command and executing corresponding operation. By the coordinator, the real-time performance of ZigBee networked industrial control can be guaranteed, the time occupied by a write command is reduced, the time available for polling a bottom node is maximized, the utilization rate of bandwidth resources is improved, and the system scale is improved.
Further, the coordinator performs communication scheduling by adopting the following method:
s1: the coordinator combines the edge clusters of all the nodes at the bottom layer to obtain a common edge cluster and a control loop edge cluster; the common edge cluster consists of measuring nodes serving as edge nodes and measuring nodes serving as an edge data center; the control loop edge cluster consists of a measurement combination as an edge node and a control node as an edge data center; at most one control loop edge cluster is arranged; only one measuring node serving as an edge data center is arranged in each common edge cluster; only one control node is used as an edge data center in the edge cluster of the control loop;
s2: the coordinator sets a polling sequence of communication, specifically: the coordinator sets a communication polling queue of a common edge cluster; setting a control loop edge cluster, and controlling the loop edge cluster to insert a queue into a communication polling queue in a preemption mode; setting communication polling start, firstly inserting and initiating communication of a control loop edge cluster; the coordinator and the edge clusters adopt a master-slave polling mechanism, the coordinator serves as a master station to initiate a communication request, and each edge cluster serves as a slave station to receive the request and execute corresponding operation;
the coordinator initializes the total communication polling time T and the polling time T for controlling the insertion of the edge cluster of the loop into the communication polling queueq;T>Tq;Tq≤100ms;0<t0≤10ms。
S3: the coordinator polls each edge cluster in turn according to the polling sequence, and specifically comprises:
s31: when communication polling is started, the coordinator inserts and sends a polling communication request frame to the control loop edge cluster; wherein, the control loop edge cluster is used as the current edge cluster;
at the same time, the coordinator starts timing T1And T2
S32: the coordinator judges whether a communication response frame sent by the current edge cluster is received, if so, the coordinator reads the data of the communication receiving buffer area to a temporary variable, the received data counter accumulates the data, and the step S33 is entered; if not, repeating the step S32; the polling communication request frame structure of the coordinator write command is as follows: node address code + function code + write register address + write value; the polling communication request frame structure of the coordinator read command is as follows: the address of the first node of the current edge cluster + function code.
S33: the analyzing, by the coordinator, the received communication response frame sent by the current edge cluster specifically includes: the coordinator judges whether the temporary variable is required effective data or not according to the receiving interrupt flag bit, and if so, the data currently received by the coordinator is stored in other data cache regions; if not, the received data counter is cleared, other data cache regions are cleared, and the coordinator exits from receiving;
s34: judging whether an edge cluster which is not polled exists in the communication polling queue, if not, entering the step S35; if yes, go to step S36; (ii) a
S35: judging and timing T1Whether the total communication polling time T is reached; if yes, entering next communication polling and returning to the step S31; if not, returning to the step S35;
s36: judging and timing T2Whether or not to equal TqIf not, the process proceeds to step S37; if yes, timing T2Clearing, and proceeding to step S38;
s37: the coordinator judges whether the 1 st byte data of the currently received data is required effective data, if so, the next common edge cluster of the current edge cluster in the communication polling queue is used as a new current edge cluster according to the polling sequence of communication; the coordinator sends a polling communication request frame to the new current edge cluster, and then proceeds to step S32; if not, the received data timer is cleared, the first-level data buffer area is cleared, the coordinator exits the received data interruption, and the step S37 is returned.
S38: the coordinator inserts the control loop edge cluster into a communication polling queue to enable the control loop edge cluster to be positioned at the position of the next communication polling queue of the current edge cluster; at the same time, the coordinator restarts the timing T2Then, the process proceeds to step S37.
When the coordinator sends a polling communication request frame to the current edge cluster, the coordinator enters into sending interruption and sending data; and when the coordinator finishes sending the polling communication request frame to the current edge cluster, the coordinator returns back to receive the interrupt. When the coordinator sends a polling communication request frame to the current edge cluster, the coordinator enters into sending interruption sending data, and the method specifically includes:
step 1: the coordinator acquires the data address and the length of a polling communication request frame sent to a current edge cluster;
step 2: the coordinator judges whether the sending register is empty, if so, the coordinator sends data in the polling communication request frame to the current edge cluster, and the data pointer points to the address of the next data; if not, waiting.
The method for sending data in the interrupt sent by the coordinator specifically includes: the coordinator judges whether the value of a data transmission counter is equal to the length value of a polling communication request frame to be transmitted or not, if so, the coordinator exits from a data transmission terminal, the data transmission counter is cleaned, a data pointer is released, and a transmission completion interrupt flag bit is set; if not, the data counter is sent to accumulate, and the data pointer points to the address of the next data. The returning of the coordinator to receive the interrupt specifically includes:
and the coordinator judges whether all the polling communication request frames sent to the current edge cluster are sent completely according to the sending completion interrupt flag bit, if so, the coordinator returns to the receiving interrupt when the sending interrupt is started, and continues to receive the data sent by the current edge cluster. The coordinator sends a polling communication request frame to the node with the lowest address code in the edge cluster; and the coordinator receives a response frame sent by the node with the largest address code in the edge cluster.
Specifically, fig. 2 is a network topology diagram of a polling process according to an embodiment of the present method. Fig. 3 is a network topology diagram of an embodiment in which a node in an edge cluster fails to communicate. Referring to fig. 3, the fault tolerance mechanism implemented in the present application is specifically as follows:
and 2-1, when the polling is started, the edge cluster receives a polling request message for the first time and starts a request timeout timer.
Step 2-2, if the timeout timer is requested, when the counting overflow occurs, at this moment, the edge node and the fault-tolerant module start to start framing, and the frame structure is as follows: and sending the frame to the next corresponding node in the cluster.
Step 2-3, if the edge data center requests the overtime timer, starting to encapsulate the response frame, wherein the frame structure is as follows: address code 1 (edge data center address code) + address code 2 (edge data center address code) + function code + edge data center information.
And 2-4, if the node receives the polling instruction request in the request timeout timer or the fault-tolerant module carries out a fault-tolerant mechanism in real time, resetting and restarting the request timeout timer of the node. Request frame structure 01+ 03; the response frame structure is 05+03+03+ XX + XX + XX; and if the 02 node has no communication abnormality, responding to the frame structure of 05+01+03+ XX + XX + XX + XX + XX.
It should be noted that the first node in the edge cluster does not need to start the fault-tolerant module, and the coordinator itself should be determined by the upper monitoring software whether the first node in the edge cluster should have the address code in the polling instruction issued by the coordinator, and the address code is determined to be equal to the address code of the node itself, and then the first node in the edge cluster is determined, otherwise, the fault-tolerant module should be started.
Finally, the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all of them should be covered in the claims of the present invention.

Claims (9)

1. A ZigBee networking industrial control system communication scheduling method is characterized in that: the method comprises the following steps:
s1: the coordinator combines the edge clusters of all the nodes at the bottom layer to obtain a common edge cluster and a control loop edge cluster; in the control loop edge cluster, a measurement node is used as an edge node, the output of a controlled object is sampled, engineering quantity conversion is carried out, the engineering quantity conversion is carried out, a dimensionless number is converted, partial control operation is executed, the control node is used as an edge data center, after sampling information is received, the rest part of the control operation is carried out, the result of the control operation is output to an execution mechanism, and the control node is also the node with the largest address code in the edge cluster; in the common edge cluster, a measuring node is used as an edge node, and a node with the largest address code in the edge cluster is used as an edge data center;
s2: the coordinator sets a polling sequence of communication, specifically: the coordinator sets a communication polling queue of a common edge cluster; setting a control loop edge cluster, and controlling the loop edge cluster to insert a queue into a communication polling queue in a preemption mode; setting communication polling start, firstly inserting and initiating communication of a control loop edge cluster; the coordinator and the edge clusters adopt a master-slave polling mechanism, the coordinator serves as a master station to initiate a communication request, and each edge cluster serves as a slave station to receive the request and execute corresponding operation;
the coordinator initializes the total communication polling time T and the polling time T for controlling the insertion of the edge cluster of the loop into the communication polling queueq(ii) a Initializing an initialization value of the total communication polling time T according to the existing master-slave polling mechanism so as to ensure that all edge clusters can be polled in the total communication polling time T;
s3: the coordinator polls each edge cluster in turn according to the polling sequence, and specifically comprises:
s31: when communication polling is started, the coordinator inserts and sends a polling communication request frame to the control loop edge cluster; wherein, the control loop edge cluster is used as the current edge cluster;
at the same time, the coordinator starts timing T1And T2
S32: the coordinator judges whether a communication response frame sent by the current edge cluster is received, if so, the coordinator reads the data of the communication receiving buffer area to a temporary variable, the received data counter accumulates the data, and the step S33 is entered; if not, repeating the step S32;
s33: the analyzing, by the coordinator, the received communication response frame sent by the current edge cluster specifically includes: the coordinator judges whether the temporary variable is required effective data or not according to the receiving interrupt flag bit, and if so, the data currently received by the coordinator is stored in other data cache regions; if not, the received data counter is cleared, other data cache regions are cleared, and the coordinator exits from receiving; wherein, the interrupt flag bit marks whether the temporary variable is valid data;
s34: judging whether an edge cluster which is not polled exists in the communication polling queue, if not, entering the step S35; if yes, go to step S36;
s35: judging and timing T1Whether the total communication polling time T is reached; if yes, entering next communication polling and returning to the step S31; if not, returning to the step S35;
s36: judging and timing T2Whether or not to equal TqIf not, the process proceeds to step S37; if yes, timing T2Clearing, and proceeding to step S38;
s37: the coordinator judges whether the 1 st byte data of the currently received data is required effective data, if so, the next common edge cluster of the current edge cluster in the communication polling queue is used as a new current edge cluster according to the polling sequence of communication; the coordinator sends a polling communication request frame to the new current edge cluster, and then proceeds to step S32; if not, the received data timer is cleared, the first-level data cache area is cleared, the coordinator exits the received data interruption, and the step S37 is returned;
s38: the coordinator inserts the control loop edge cluster into the communication polling queue to make the control loop edge cluster positioned at the next communication polling queue of the current edge clusterA column position; at the same time, the coordinator restarts the timing T2Then, the process proceeds to step S37.
2. The ZigBee networking industrial control system communication scheduling method of claim 1, wherein: when the coordinator sends a polling communication request frame to the current edge cluster, the coordinator enters into sending interruption and sending data; and when the coordinator finishes sending the polling communication request frame to the current edge cluster, the coordinator returns back to receive the interrupt.
3. The ZigBee networking industrial control system communication scheduling method of claim 2, wherein: when the coordinator sends a polling communication request frame to the current edge cluster, the coordinator enters into sending interruption sending data, and the method specifically includes:
step 1: the coordinator acquires the data address and the length of a polling communication request frame sent to a current edge cluster;
step 2: the coordinator judges whether the sending register is empty, if so, the coordinator sends data in the polling communication request frame to the current edge cluster, and the data pointer points to the address of the next data; if not, waiting.
4. The ZigBee networking industrial control system communication scheduling method of claim 3, wherein: the method for sending data in the interrupt sent by the coordinator specifically includes: the coordinator judges whether the value of a data transmission counter is equal to the length value of a polling communication request frame to be transmitted or not, if so, the coordinator exits from a data transmission terminal, the data transmission counter is cleaned, a data pointer is released, and a transmission completion interrupt flag bit is set; if not, the data counter is sent to accumulate, and the data pointer points to the address of the next data.
5. The ZigBee networking industrial control system communication scheduling method of claim 2, wherein: the returning of the coordinator to receive the interrupt specifically includes:
and the coordinator judges whether all the polling communication request frames sent to the current edge cluster are sent completely according to the sending completion interrupt flag bit, if so, the coordinator returns to the receiving interrupt when the sending interrupt is started, and continues to receive the data sent by the current edge cluster.
6. The ZigBee networking industrial control system communication scheduling method of claim 1, wherein: t > Tq;Tq≤100ms。
7. The ZigBee networking industrial control system communication scheduling method of claim 1, wherein: the coordinator sends a polling communication request frame to the node with the lowest address code in the edge cluster; and the coordinator receives a response frame sent by the node with the largest address code in the edge cluster.
8. The ZigBee networking industrial control system communication scheduling method of claim 1, wherein: the polling communication request frame structure of the coordinator write command is as follows: node address code + function code + write register address + write value; the polling communication request frame structure of the coordinator read command is as follows: the address of the first node of the current edge cluster + function code.
9. A coordinator of a ZigBee networked industrial control system is characterized in that: comprises that
The communication module is communicated with the ZigBee module and used for sending a communication message to the edge cluster and receiving a communication response frame of the edge cluster by the coordinator;
the queue grouping module is used for combining edge clusters of all nodes at the bottom layer to obtain a common edge cluster and a control loop edge cluster; the common edge cluster consists of measuring nodes serving as edge nodes and measuring nodes serving as an edge data center; the control loop edge cluster consists of a measurement combination as an edge node and a control node as an edge data center; at most one control loop edge cluster is arranged; only one measuring node serving as an edge data center is arranged in each common edge cluster; only one control node is used as an edge data center in the edge cluster of the control loop;
the polling module is used for sequentially polling each edge cluster according to a set polling sequence of communication; setting a communication polling queue of a common edge cluster; setting a control loop edge cluster, and controlling the loop edge cluster to insert a queue into a communication polling queue in a preemption mode; setting communication polling start, firstly inserting and initiating communication of a control loop edge cluster; the coordinator and the edge clusters adopt a master-slave polling mechanism, the coordinator serves as a master station to initiate a communication request, and each edge cluster serves as a slave station to receive the request and execute corresponding operation;
wherein the communication module comprises
The ZigBee communication unit is used for packaging user data or analyzing a ZigBee protocol by wirelessly receiving an original message to obtain an application layer communication message;
the self-defined communication protocol analysis and encapsulation unit is used for analyzing the application layer communication message frame, correctly identifying the command and executing corresponding operation;
the coordinator adopts the following method to carry out communication scheduling:
s1: the coordinator combines the edge clusters of all the nodes at the bottom layer to obtain a common edge cluster and a control loop edge cluster; in the control loop edge cluster, a measurement node is used as an edge node, the output of a controlled object is sampled, engineering quantity conversion is carried out, the engineering quantity conversion is carried out, a dimensionless number is converted, partial control operation is executed, the control node is used as an edge data center, after sampling information is received, the rest part of the control operation is carried out, the result of the control operation is output to an execution mechanism, and the control node is also the node with the largest address code in the edge cluster; in the common edge cluster, a measuring node is used as an edge node, and a node with the largest address code in the edge cluster is used as an edge data center;
s2: the coordinator sets a polling sequence of communication, specifically: the coordinator sets a communication polling queue of a common edge cluster; setting a control loop edge cluster, and controlling the loop edge cluster to insert a queue into a communication polling queue in a preemption mode; setting communication polling start, firstly inserting and initiating communication of a control loop edge cluster; the coordinator and the edge clusters adopt a master-slave polling mechanism, the coordinator serves as a master station to initiate a communication request, and each edge cluster serves as a slave station to receive the request and execute corresponding operation;
the coordinator initializes the total communication polling time T and the polling time T for controlling the insertion of the edge cluster of the loop into the communication polling queueq(ii) a Initializing an initialization value of the total communication polling time T according to the existing master-slave polling mechanism so as to ensure that all edge clusters can be polled in the total communication polling time T;
s3: the coordinator polls each edge cluster in turn according to the polling sequence, and specifically comprises:
s31: when communication polling is started, the coordinator inserts and sends a polling communication request frame to the control loop edge cluster; wherein, the control loop edge cluster is used as the current edge cluster;
at the same time, the coordinator starts timing T1And T2
S32: the coordinator judges whether a communication response frame sent by the current edge cluster is received, if so, the coordinator reads the data of the communication receiving buffer area to a temporary variable, the received data counter accumulates the data, and the step S33 is entered; if not, repeating the step S32;
s33: the analyzing, by the coordinator, the received communication response frame sent by the current edge cluster specifically includes: the coordinator judges whether the temporary variable is required effective data or not according to the receiving interrupt flag bit, and if so, the data currently received by the coordinator is stored in other data cache regions; if not, the received data counter is cleared, other data cache regions are cleared, and the coordinator exits from receiving; wherein, the interrupt flag bit marks whether the temporary variable is valid data;
s34: judging whether an edge cluster which is not polled exists in the communication polling queue, if not, entering the step S35; if yes, go to step S36;
s35: judging and timing T1Whether the total communication polling time T is reached; if yes, entering next communication polling and returning to the step S31; if not, returning to the step S35;
s36: judging and timing T2Whether or not to equal TqIf not, the process proceeds to step S37; if yes, timing T2Clearing, and proceeding to step S38;
s37: the coordinator judges whether the 1 st byte data of the currently received data is required effective data, if so, the next common edge cluster of the current edge cluster in the communication polling queue is used as a new current edge cluster according to the polling sequence of communication; the coordinator sends a polling communication request frame to the new current edge cluster, and then proceeds to step S32; if not, the received data timer is cleared, the first-level data cache area is cleared, the coordinator exits the received data interruption, and the step S37 is returned;
s38: the coordinator inserts the control loop edge cluster into a communication polling queue to enable the control loop edge cluster to be positioned at the position of the next communication polling queue of the current edge cluster; at the same time, the coordinator restarts the timing T2Then, the process proceeds to step S37.
CN201910805640.2A 2019-08-28 2019-08-29 ZigBee networked industrial control system communication scheduling method and coordinator thereof Active CN110536467B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910804211 2019-08-28
CN2019108042113 2019-08-28

Publications (2)

Publication Number Publication Date
CN110536467A CN110536467A (en) 2019-12-03
CN110536467B true CN110536467B (en) 2021-06-01

Family

ID=68664941

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910805640.2A Active CN110536467B (en) 2019-08-28 2019-08-29 ZigBee networked industrial control system communication scheduling method and coordinator thereof

Country Status (1)

Country Link
CN (1) CN110536467B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114800492A (en) * 2022-04-11 2022-07-29 深圳市大族机器人有限公司 Method, system, computer device and storage medium for controlling slave station terminal

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106304235A (en) * 2016-08-22 2017-01-04 广东工业大学 A kind of collaborative clustering routing communication means divided based on hierarchical region in WSN
CN107347201A (en) * 2017-07-07 2017-11-14 云南大学 A kind of wireless sensor network polling system control method based on priority
CN107682906A (en) * 2017-10-26 2018-02-09 国网黑龙江省电力有限公司信息通信公司 Inspection data communications method and system in computer room
CN108541018A (en) * 2018-03-09 2018-09-14 成都世纪光合作用科技有限公司 The generation cluster head selection method of extensive ad hoc wireless communication Cluster Networks
CN109739849A (en) * 2019-01-02 2019-05-10 山东省科学院情报研究所 A kind of network sensitive information of data-driven excavates and early warning platform
CN109788444A (en) * 2019-02-25 2019-05-21 武汉晟联智融微电子科技有限公司 Applied to the node networking method in high density multihop network
CN109842500A (en) * 2017-11-24 2019-06-04 阿里巴巴集团控股有限公司 A kind of dispatching method and system, working node and monitoring node

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9226305B2 (en) * 2011-11-07 2015-12-29 Nokia Technologies Oy Medium access control method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106304235A (en) * 2016-08-22 2017-01-04 广东工业大学 A kind of collaborative clustering routing communication means divided based on hierarchical region in WSN
CN107347201A (en) * 2017-07-07 2017-11-14 云南大学 A kind of wireless sensor network polling system control method based on priority
CN107682906A (en) * 2017-10-26 2018-02-09 国网黑龙江省电力有限公司信息通信公司 Inspection data communications method and system in computer room
CN109842500A (en) * 2017-11-24 2019-06-04 阿里巴巴集团控股有限公司 A kind of dispatching method and system, working node and monitoring node
CN108541018A (en) * 2018-03-09 2018-09-14 成都世纪光合作用科技有限公司 The generation cluster head selection method of extensive ad hoc wireless communication Cluster Networks
CN109739849A (en) * 2019-01-02 2019-05-10 山东省科学院情报研究所 A kind of network sensitive information of data-driven excavates and early warning platform
CN109788444A (en) * 2019-02-25 2019-05-21 武汉晟联智融微电子科技有限公司 Applied to the node networking method in high density multihop network

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"The Application of Chaotic Encryption in Industrial Control Based on ZigBee Wireless Network";Qiang He, Qian Qi, Yixin Zhao@, Wei Huang, Qiaoli Huang;《IEEE》;20090206;全文 *
"网络控制***中改进型模糊反馈调度策略研究";苏晓贝,赵亦欣,吴小军,彭正福;《西南大学学报 自然科学版》;20151228;全文 *

Also Published As

Publication number Publication date
CN110536467A (en) 2019-12-03

Similar Documents

Publication Publication Date Title
CN110519374B (en) Edge computing method of ZigBee networked industrial control system and edge node thereof
WO2019056899A1 (en) Oam message transmission method and transmission device, and storage medium
EP4254826A2 (en) Method and device for transmitting and receiving network management information, transmitting apparatus and receiving apparatus
CN109547162B (en) Data communication method based on two sets of one-way boundaries
CN111800226B (en) Sideband management circuit and method based on hardware arbitration
CN110166378B (en) Communication system and method for debugging and maintaining distribution network terminal
CN110138490A (en) A kind of method and apparatus of clock competition
CN100430847C (en) Method and device for determining time in a bus system and corresponding bus system
CN110536467B (en) ZigBee networked industrial control system communication scheduling method and coordinator thereof
CN114040368A (en) Data transmission method and system based on BLE Bluetooth and Bluetooth module
CN111327476B (en) Bandwidth dynamic adjustment system and method based on frame reservation
EP0589509B1 (en) Polling-type digital communications system having pseudo-balanced mode
CN113992609B (en) Method and system for processing multilink service data disorder
CN115733759A (en) Simulation model system for TTFC message scheduling
JP6161006B2 (en) Meter reading device
CN101127677A (en) A barrier operating network system, device and method based on fat tree topology
CN109586978B (en) Bus topology network ad hoc network method
KR100609493B1 (en) Method for transmitting multiple sensors data with a CAN message
Pan et al. Design and Performance Analysis of Protocol Conversion between 5G and Modbus TCP
CN111343589A (en) Communication networking method, sub-node equipment and main node equipment
JPH08106306A (en) Data transmitter
CN113672545B (en) Method and device for transmitting power data between dual processors
CN113949600B (en) Method and device for triggering network by 1553B bus access time
CN110505641B (en) Method for improving ZigBee master-slave communication polling efficiency by utilizing full-duplex UART communication and coordinator thereof
CN113179552B (en) Communication method for avoiding conflict in wireless single-channel communication network

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