技术领域Technical Field
本发明概括而言涉及工业控制领域,更具体地,涉及一种用于EPA网络的组态配置的方法、控制设备和计算机可读存储介质。The present invention generally relates to the field of industrial control, and more specifically, to a method, a control device and a computer-readable storage medium for configuring an EPA network.
背景技术Background Art
近些年来随着控制系统向数字化、智能化快速转型,在控制系统中应用各类自动化系统和信息化系统,导致控制系统对通信的要求越来越高。In recent years, with the rapid transformation of control systems towards digitalization and intelligence, various automation systems and information systems are applied in control systems, resulting in higher and higher requirements for communication in control systems.
EPA(Ethernet for Plant Automation)工厂自动化以太网是一种由中国自主研发的面向控制系统的实时以太网技术,已经被现场总线国际标准IEC61158和实时以太网标准IEC61784收录,目前,EPA已经被广泛应用于电力、化工、机械、采矿、石油等多个领域。在EPA网络中为了适应不同的应用场景,EPA设备节点之间的连接会有不同的网络拓扑结构。与之对应的,不同的网络拓扑结构以及不同的节点数量和不同的控制要求下,各个EPA设备节点中的包括宏周期、周期等组态参数都会有所不同。EPA (Ethernet for Plant Automation) is a real-time Ethernet technology for control systems independently developed by China. It has been included in the fieldbus international standard IEC61158 and the real-time Ethernet standard IEC61784. At present, EPA has been widely used in many fields such as electricity, chemical industry, machinery, mining, and petroleum. In order to adapt to different application scenarios in the EPA network, the connection between EPA device nodes will have different network topologies. Correspondingly, under different network topologies, different node numbers, and different control requirements, the configuration parameters including macrocycles and cycles in each EPA device node will be different.
由此可见,现有技术中,只能通过人工方式对EPA网络中的EPA设备逐台进行组态配置,当网络中存在很多设备节点时,会产生巨大的工作量,且容易发生错误。本发明为EPA网络提供了自动化组态方案。It can be seen that in the prior art, the EPA devices in the EPA network can only be configured manually one by one, which will generate a huge workload and easily cause errors when there are many device nodes in the network. The present invention provides an automated configuration solution for the EPA network.
发明内容Summary of the invention
针对上述问题,本发明提供了一种自动确定EPA网络的各种组态配置参数以对EPA网络进行组态配置的方法。In view of the above problems, the present invention provides a method for automatically determining various configuration parameters of an EPA network to configure the EPA network.
根据本发明的一个方面,提供了一种用于EPA网络的组态配置的方法。该方法包括:获取所述EPA网络所包含的EPA节点的数量和每个EPA节点的用户数据量;基于所述EPA网络所包含的EPA节点的数量和每个EPA节点的用户数据量确定所述EPA网络的组态配置参数,所述组态配置参数至少包括所述EPA网络的宏周期长度、周期时间段长度以及每个EPA节点在所述宏周期的发送偏移时间;以及基于所述组态配置参数对所述EPA网络进行组态配置。According to one aspect of the present invention, a method for configuring an EPA network is provided. The method includes: obtaining the number of EPA nodes included in the EPA network and the amount of user data of each EPA node; determining the configuration parameters of the EPA network based on the number of EPA nodes included in the EPA network and the amount of user data of each EPA node, the configuration parameters at least including the macrocycle length of the EPA network, the cycle time period length, and the sending offset time of each EPA node in the macrocycle; and configuring the EPA network based on the configuration parameters.
在一些实现中,确定所述EPA网络的组态配置参数包括:基于所述EPA网络所包含的EPA节点的数量和每个EPA节点的用户数据量确定所述周期时间段长度;基于所述周期时间段长度和非周期时间长度确定所述EPA网络的宏周期长度;以及对于所述EPA网络中的每个EPA节点,基于所述EPA节点的前一EPA节点的发送偏移时间和所述前一EPA节点占用的总时间确定所述EPA节点的发送偏移时间。In some implementations, determining the configuration parameters of the EPA network includes: determining the length of the periodic time period based on the number of EPA nodes included in the EPA network and the amount of user data of each EPA node; determining the macrocycle length of the EPA network based on the periodic time period length and the non-periodic time length; and for each EPA node in the EPA network, determining the send offset time of the EPA node based on the send offset time of the previous EPA node of the EPA node and the total time occupied by the previous EPA node.
在一些实现中,确定所述周期时间段长度包括:对于每个EPA节点,基于所述EPA节点的用户数据量确定所述EPA节点的报文占用时间;基于所述EPA节点的报文占用时间、传输整形时间和报文预留时间确定所述EPA节点的周期时间片长度;以及对所述EPA网络的所有EPA节点的周期时间片长度求和以确定所述EPA网络的周期时间段长度。In some implementations, determining the length of the periodic time period includes: for each EPA node, determining the message occupancy time of the EPA node based on the amount of user data of the EPA node; determining the periodic time slice length of the EPA node based on the message occupancy time, transmission shaping time and message reservation time of the EPA node; and summing the periodic time slice lengths of all EPA nodes of the EPA network to determine the periodic time period length of the EPA network.
在一些实现中,确定所述EPA网络的宏周期长度包括:基于预先设置的非周期预留时间片和时钟同步误差确定所述非周期时间长度;以及对所述周期时间段长度和所述非周期时间长度求和以确定所述EPA网络的宏周期长度。In some implementations, determining the macrocycle length of the EPA network includes: determining the non-periodic time length based on a preset non-periodic reserved time slice and a clock synchronization error; and summing the periodic time period length and the non-periodic time length to determine the macrocycle length of the EPA network.
在一些实现中,确定所述EPA节点的发送偏移时间包括:对于所述EPA网络中的第一个EPA节点,将所述第一个EPA节点的发送偏移时间设置为0;对于所述EPA网络中除了第一个EPA节点之外的其他每个EPA节点,至少基于所述EPA节点的前一EPA节点的节点间线路延时、节点转发延时和时钟同步误差确定所述EPA节点的传输整形时间;基于所述EPA节点的传输整形时间、所述EPA节点的前一EPA节点的报文占用时间和报文预留时间确定所述前一EPA节点占用的总时间;并且基于所述EPA节点的前一EPA节点的发送偏移时间和所述前一EPA节点占用的总时间确定所述EPA节点的发送偏移时间。In some implementations, determining the send offset time of the EPA node includes: for the first EPA node in the EPA network, setting the send offset time of the first EPA node to 0; for each EPA node other than the first EPA node in the EPA network, determining the transmission shaping time of the EPA node based at least on the inter-node line delay, node forwarding delay and clock synchronization error of a previous EPA node of the EPA node; determining the total time occupied by the previous EPA node based on the transmission shaping time of the EPA node, the message occupancy time and the message reservation time of the previous EPA node of the EPA node; and determining the send offset time of the EPA node based on the send offset time of the previous EPA node of the EPA node and the total time occupied by the previous EPA node.
在一些实现中,所述EPA网络的拓扑结构包括环形结构、线型结构或星型结构。In some implementations, the topology of the EPA network includes a ring structure, a linear structure, or a star structure.
在一些实现中,确定所述EPA节点的传输整形时间包括:基于所述EPA节点的前一EPA节点的节点间线路延时、节点转发延时、时钟同步误差和帧间隔确定所述EPA节点的传输整形时间。In some implementations, determining the transmission shaping time of the EPA node includes: determining the transmission shaping time of the EPA node based on the inter-node line delay, node forwarding delay, clock synchronization error and frame interval of a previous EPA node of the EPA node.
在一些实现中,每个EPA节点占用的总时间如下确定:t4= t1+t2+t3+t5+t6+t7,其中t4表示所述EPA节点的前一EPA节点占用的总时间,t1表示从所述EPA节点的前一EPA节点或交换机到所述EPA节点的节点间线路延时,t2表示所述前一EPA节点或交换机的节点转发延时,t3表示所述前一EPA节点的报文占用时间,t5表示帧间隔,t6表示所述EPA节点的报文预留时间,t7表示所述EPA网络的时钟同步误差。In some implementations, the total time occupied by each EPA node is determined as follows: t4 = t1+t2+t3+t5+t6+t7, where t4 represents the total time occupied by the previous EPA node of the EPA node, t1 represents the inter-node line delay from the previous EPA node or switch of the EPA node to the EPA node, t2 represents the node forwarding delay of the previous EPA node or switch, t3 represents the message occupancy time of the previous EPA node, t5 represents the frame interval, t6 represents the message reservation time of the EPA node, and t7 represents the clock synchronization error of the EPA network.
在一些实现中,所述发送偏移时间包括正向发送偏移时间和逆向发送偏移时间,并且所述正向发送偏移时间与所述逆向发送偏移时间被独立设置。In some implementations, the sending offset time includes a forward sending offset time and a reverse sending offset time, and the forward sending offset time and the reverse sending offset time are set independently.
在一些实现中,确定所述EPA节点的传输整形时间包括:基于节点间线路延时、节点转发延时、时钟同步误差和所述EPA网络所包含的EPA节点的数量确定所述EPA节点的传输整形时间。In some implementations, determining the transmission shaping time of the EPA node includes: determining the transmission shaping time of the EPA node based on inter-node line delay, node forwarding delay, clock synchronization error, and the number of EPA nodes included in the EPA network.
在一些实现中,第i个EPA节点占用的总时间如下确定:In some implementations, the total time occupied by the i-th EPA node is determined as follows:
,其中t1_i为从第i个EPA节点到第i+1个EPA节点或交换机的节点间线路延时,t2_i为第i个EPA节点的节点转发延时,t3_i为第i个EPA节点的报文占用时间,t4_i为第i个EPA节点占用的总时间,t6为报文预留时间,t7表示所述EPA网络的时钟同步误差,在所述EPA网络是环形结构的情况下,n为所述EPA网络所包含的EPA节点的数量。 , where t1_i is the node-to-node line delay from the i-th EPA node to the i+1-th EPA node or switch, t2_i is the node forwarding delay of the i-th EPA node, t3_i is the message occupancy time of the i-th EPA node, t4_i is the total time occupied by the i-th EPA node, t6 is the message reservation time, t7 represents the clock synchronization error of the EPA network, and when the EPA network is a ring structure, n is the number of EPA nodes contained in the EPA network.
在一些实现中,第i个EPA节点占用的总时间如下确定:In some implementations, the total time occupied by the i-th EPA node is determined as follows:
,其中t1_i为从第i个EPA节点到第i+1个EPA节点的节点间线路延时,t2_i为第i个EPA节点的节点转发延时,t3_i为第i个EPA节点的报文占用时间,t4_i为第i个EPA节点占用的总时间,t6为报文预留时间,t7表示所述EPA网络的时钟同步误差,在所述EPA网络是线型结构的情况下,n为所述EPA网络所包含的EPA节点的数量,在所述EPA网络是星型结构的情况下,n为所述EPA网络的最长链路设备数量。 , where t1_i is the inter-node line delay from the i-th EPA node to the i+1-th EPA node, t2_i is the node forwarding delay of the i-th EPA node, t3_i is the message occupancy time of the i-th EPA node, t4_i is the total time occupied by the i-th EPA node, t6 is the message reservation time, t7 represents the clock synchronization error of the EPA network, and when the EPA network is a linear structure, n is the number of EPA nodes contained in the EPA network, and when the EPA network is a star structure, n is the number of longest link devices in the EPA network.
在一些实现中,所述发送偏移时间包括正向发送偏移时间和逆向发送偏移时间,并且所述正向发送偏移时间被设置为与所述逆向发送偏移时间相等。In some implementations, the sending offset time includes a forward sending offset time and a reverse sending offset time, and the forward sending offset time is set to be equal to the reverse sending offset time.
根据本发明的另一个方面,提供了一种控制设备,包括:处理器和存储器,所述存储器包括可由所述处理器运行的指令,所述处理器被配置为使得所述节点设备执行如上所述的任一方法。According to another aspect of the present invention, a control device is provided, comprising: a processor and a memory, wherein the memory comprises instructions executable by the processor, and the processor is configured to enable the node device to execute any one of the methods described above.
根据本发明的另一个方面,提供了一种计算机可读存储介质,其上存储有计算机程序代码,该计算机程序代码在被运行时执行如上所述的方法。According to another aspect of the present invention, a computer-readable storage medium is provided, on which a computer program code is stored. When the computer program code is executed, the method described above is executed.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
通过参考下列附图所给出的本发明的具体实施方式的描述,将更好地理解本发明,并且本发明的其他目的、细节、特点和优点将变得更加显而易见。The present invention will be better understood and other objects, details, features and advantages of the present invention will become more apparent through the following description of specific embodiments of the present invention given with reference to the accompanying drawings.
图1A至图1D分别示出了根据本发明的实施例的不同拓扑结构的示例性EPA网络的示意图。1A to 1D are schematic diagrams of exemplary EPA networks of different topologies according to embodiments of the present invention.
图2示出了根据本发明实施例的EPA网络的宏周期的示意图。FIG. 2 is a schematic diagram showing a macrocycle of an EPA network according to an embodiment of the present invention.
图3示出了根据本发明的一些实施例的用于EPA网络的组态配置的方法的示例性流程图。FIG. 3 shows an exemplary flow chart of a method for configuring a configuration of an EPA network according to some embodiments of the present invention.
图4示出了根据本发明的实施例的用于确定EPA网络的组态配置参数的过程的示例性流程图。FIG. 4 shows an exemplary flow chart of a process for determining configuration parameters of an EPA network according to an embodiment of the present invention.
图5示出了根据本发明一些实施例的确定宏周期的周期时间段长度的过程的进一步详细流程图。FIG. 5 shows a further detailed flow chart of a process for determining the length of a cycle time period of a macrocycle according to some embodiments of the present invention.
图6A示出了EPA网络中的所有EPA节点的周期时间片的示意图。FIG. 6A is a schematic diagram showing the periodic time slices of all EPA nodes in the EPA network.
图6B示出了一个周期时间片的示例性示意图。FIG. 6B shows an exemplary schematic diagram of a cycle time slice.
图7A示出了根据本发明一些实施例的各个EPA节点的周期报文的传输示意图。FIG. 7A shows a schematic diagram of transmission of periodic messages of various EPA nodes according to some embodiments of the present invention.
图7B示出了根据本发明另一些实施例的各个EPA节点的周期报文的传输示意图。FIG. 7B shows a schematic diagram of transmission of periodic messages of various EPA nodes according to other embodiments of the present invention.
图7C示出了与图7B对应的根据本发明另一些实施例的各个EPA节点110的周期报文的传输示意图。FIG. 7C shows a schematic diagram of transmission of periodic messages of each EPA node 110 according to other embodiments of the present invention corresponding to FIG. 7B .
图7D和图7E分别示出了根据本发明再一些实施例的各个EPA节点的周期报文的传输示意图。7D and 7E respectively show schematic diagrams of transmission of periodic messages of various EPA nodes according to still other embodiments of the present invention.
图8示出了用于确定EPA节点的发送偏移时间的过程的更详细流程图。FIG8 shows a more detailed flow chart of a process for determining a transmit offset time for an EPA node.
图9示出了适合实现本公开的实施例的控制设备的方框图。FIG9 shows a block diagram of a control device suitable for implementing embodiments of the present disclosure.
具体实施方式DETAILED DESCRIPTION
下面将参照附图更详细地描述本发明的优选实施方式。虽然附图中显示了本发明的优选实施方式,然而应该理解,可以以各种形式实现本发明而不应被这里阐述的实施方式所限制。相反,提供这些实施方式是为了使本发明更加透彻和完整,并且能够将本发明的范围完整的传达给本领域的技术人员。The preferred embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the preferred embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to make the present invention more thorough and complete, and to fully convey the scope of the present invention to those skilled in the art.
在下文的描述中,出于说明各种发明的实施例的目的阐述了某些具体细节以提供对各种发明实施例的透彻理解。但是,相关领域技术人员将认识到可在无这些具体细节中的一个或多个细节的情况来实践实施例。在其它情形下,与本申请相关联的熟知的装置、结构和技术可能并未详细地示出或描述从而避免不必要地混淆实施例的描述。In the following description, certain specific details are set forth for the purpose of illustrating various embodiments of the invention to provide a thorough understanding of the various embodiments of the invention. However, those skilled in the relevant art will recognize that the embodiments may be practiced without one or more of these specific details. In other cases, well-known devices, structures, and techniques associated with the present application may not be shown or described in detail to avoid unnecessarily obscuring the description of the embodiments.
除非语境有其它需要,在整个说明书和权利要求中,词语“包括”和其变型,诸如“包含”和“具有”应被理解为开放的、包含的含义,即应解释为“包括,但不限于”。Unless the context requires otherwise, throughout the specification and claims, the word "comprise" and variations such as "include" and "have" should be construed in an open, inclusive sense, ie, should be interpreted as "including, but not limited to."
在整个说明书中对“一个实施例”或“一些实施例”的提及表示结合实施例所描述的特定特点、结构或特征包括于至少一个实施例中。因此,在整个说明书的各个位置“在一个实施例中”或“在一些实施例”中的出现不一定全都指相同实施例。另外,特定特点、结构或特征可在一个或多个实施例中以任何方式组合。References throughout the specification to "one embodiment" or "some embodiments" indicate that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment. Thus, the appearance of "in one embodiment" or "some embodiments" in various places throughout the specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any manner in one or more embodiments.
此外,说明书和权利要求中所用的第一、第二、第三等术语,仅仅出于描述清楚起见来区分各个对象,而并不限定其所描述的对象的大小或其他顺序等,除非另有说明。In addition, the terms "first", "second", "third", etc. used in the specification and claims are only used to distinguish each object for the sake of clarity of description, and do not limit the size or other order of the objects described, unless otherwise specified.
在EPA网络中,网络的各个节点采用时分复用的方式进行周期式通信,即确定工作在同一个时间基准的前提下,根据系统具体应用场景来制定一个指定时间长度的通信周期,也称为宏周期,系统中的所有节点的通信周期的起始与结束时间一致。通常,一个宏周期可以被分为周期时间段和非周期时间段,其中周期时间段可以用来传输每个节点的周期数据(即固定频率的周期性发送的数据),而非周期时间段可以被各个节点声明以发送一些突发数据或者发送系统自身产生的系统报文。In the EPA network, each node of the network uses time division multiplexing to communicate periodically, that is, under the premise of working on the same time base, a communication cycle of a specified time length is formulated according to the specific application scenario of the system, also known as a macro cycle, and the start and end time of the communication cycle of all nodes in the system are consistent. Usually, a macro cycle can be divided into a periodic time period and a non-periodic time period, where the periodic time period can be used to transmit the periodic data of each node (that is, data sent periodically at a fixed frequency), and the non-periodic time period can be declared by each node to send some burst data or send system messages generated by the system itself.
图1A至图1D分别示出了根据本发明的实施例的不同拓扑结构的示例性EPA网络100的示意图。EPA网络100可以包括多个EPA节点110(图1A至图1D中示意性地示出了4个EPA节点110-1、110-2、110-3和110-4)。其中,图1A的EPA网络100是环形拓扑结构,4个EPA节点110-1、110-2、110-3和110-4依次相连构成环形结构。图1B的EPA网络100是线型拓扑结构,4个EPA节点110-1、110-2、110-3和110-4依次相连,但是最后一个EPA节点110-4不再与第一个EPA节点110-1相连。图1C和图1D的EPA网络100都是星形拓扑结构,各个EPA节点110通过交换机120相连。不同之处在于,图1C的EPA网络100中,通过一个交换机120与4个EPA节点110-1、110-2、110-3和110-4分别相连,而图1D的EPA网络100中,通过三个(也可以是两个或者大于三个)交换机120(即交换机120-1、交换机120-2和交换机120-3)连接4个EPA节点110-1、110-2、110-3和110-4。其中,EPA节点110之间(以及与交换机120之间)通过基于EPA协议的EPA总线来进行通信。FIG. 1A to FIG. 1D respectively show schematic diagrams of exemplary EPA networks 100 of different topologies according to an embodiment of the present invention. The EPA network 100 may include multiple EPA nodes 110 (four EPA nodes 110-1, 110-2, 110-3 and 110-4 are schematically shown in FIG. 1A to FIG. 1D). Among them, the EPA network 100 of FIG. 1A is a ring topology structure, and the four EPA nodes 110-1, 110-2, 110-3 and 110-4 are connected in sequence to form a ring structure. The EPA network 100 of FIG. 1B is a linear topology structure, and the four EPA nodes 110-1, 110-2, 110-3 and 110-4 are connected in sequence, but the last EPA node 110-4 is no longer connected to the first EPA node 110-1. The EPA networks 100 of FIG. 1C and FIG. 1D are both star topologies, and each EPA node 110 is connected through a switch 120. The difference is that in the EPA network 100 of FIG1C , four EPA nodes 110-1, 110-2, 110-3 and 110-4 are respectively connected via one switch 120, while in the EPA network 100 of FIG1D , four EPA nodes 110-1, 110-2, 110-3 and 110-4 are connected via three (or two or more) switches 120 (i.e., switch 120-1, switch 120-2 and switch 120-3). The EPA nodes 110 communicate with each other (and with the switches 120) via an EPA bus based on the EPA protocol.
每个EPA节点110具有一个或多个发送(TX)端口(图1A至图1D中示例性地为每个EPA节点110示出了一个发送端口,即发送端口1A、2A、3A和4A)和一个或多个接收(RX)端口(图1A和图1B中示例性地为每个EPA节点110示出了一个接收端口,即接收端口1B、2B、3B和4B)。本领域技术人员可以理解,发送端口1A、2A、3A和4A和接收端口1B、2B、3B和4B可以分别是双向端口,或者,发送端口1A、2A、3A和4A处另外设置相应的接收端口(图中未示出)并且接收端口1B、2B、3B和4B处另外设置相应的发送端口(图中未示出),从而使得EPA网络100同时支持正向传输(图1A的顺时针方向或者图1B至图1D从EPA节点110-1到EPA节点110-4的方向)和逆向传输(图1A的逆时针方向或者图1B至图1D从EPA节点110-4到EPA节点110-1的方向)。Each EPA node 110 has one or more transmit (TX) ports (one transmit port is exemplarily shown for each EPA node 110 in FIGS. 1A to 1D , namely, transmit ports 1A, 2A, 3A, and 4A) and one or more receive (RX) ports (one receive port is exemplarily shown for each EPA node 110 in FIGS. 1A and 1B , namely, receive ports 1B, 2B, 3B, and 4B). Those skilled in the art will appreciate that sending ports 1A, 2A, 3A and 4A and receiving ports 1B, 2B, 3B and 4B may be bidirectional ports, respectively; or, corresponding receiving ports (not shown in the figure) may be additionally provided at sending ports 1A, 2A, 3A and 4A and corresponding sending ports (not shown in the figure) may be additionally provided at receiving ports 1B, 2B, 3B and 4B, so that the EPA network 100 simultaneously supports forward transmission (the clockwise direction of FIG. 1A or the direction from EPA node 110-1 to EPA node 110-4 in FIG. 1B to FIG. 1D) and reverse transmission (the counterclockwise direction of FIG. 1A or the direction from EPA node 110-4 to EPA node 110-1 in FIG. 1B to FIG. 1D).
在EPA网络100中,各个EPA节点110以相同的宏周期进行周期性通信。In the EPA network 100, each EPA node 110 performs periodic communication in the same macrocycle.
此外,图1A至图1D中还示出了控制设备20,该控制设备20可以通过以太网与EPA网络100相连,以用于对EPA网络100进行控制,如组态配置。注意,在控制设备20是以太网设备的情况下,控制设备20与EPA网络100之间还需要转换设备(图中未示出)以将控制设备20发送的以太网报文转换为EPA报文。In addition, FIG. 1A to FIG. 1D also show a control device 20, which can be connected to the EPA network 100 via Ethernet to control the EPA network 100, such as configuring the configuration. Note that in the case where the control device 20 is an Ethernet device, a conversion device (not shown in the figure) is also required between the control device 20 and the EPA network 100 to convert the Ethernet message sent by the control device 20 into an EPA message.
图2示出了根据本发明实施例的EPA网络100的宏周期T的示意图。如图2中所示,每个宏周期T可以包括周期时间段Tp和非周期时间段Tnp。Fig. 2 is a schematic diagram of a macrocycle T of the EPA network 100 according to an embodiment of the present invention. As shown in Fig. 2, each macrocycle T may include a periodic time period Tp and a non-periodic time period Tnp.
每个宏周期T的周期时间段Tp用于每个EPA节点110发送周期报文。其中,在给定的通信模式下,为EPA网络100中的每个EPA节点110分配了周期时间段Tp期间的固定的周期时间片以发送该EPA节点110的周期报文,该周期时间片的开始时间(即相对于宏周期开始时间的发送偏移时间)和长度对于每个EPA节点110是唯一的,不会与其他EPA节点110产生重叠和冲突。周期时间段Tp主要用来传输每个EPA节点110的用户数据,其是宏周期的主要数据传输时间。在本文中,可以指定EPA网络100中在宏周期T中第一个发送周期报文的EPA节点110,该EPA节点110也称为EPA网络100的第一个EPA节点。例如,可以将图1A和图1B中与控制设备20相连的EPA节点110-1指定为EPA网络100的第一个EPA节点,将图1C和图1D中与交换机120或交换机120-1相连的EPA节点110-1指定为EPA网络100的第一个EPA节点。The periodic time period Tp of each macrocycle T is used for each EPA node 110 to send periodic messages. Among them, under a given communication mode, a fixed periodic time slice during the periodic time period Tp is allocated to each EPA node 110 in the EPA network 100 to send the periodic message of the EPA node 110, and the start time (i.e., the transmission offset time relative to the start time of the macrocycle) and the length of the periodic time slice are unique for each EPA node 110, and will not overlap or conflict with other EPA nodes 110. The periodic time period Tp is mainly used to transmit the user data of each EPA node 110, which is the main data transmission time of the macrocycle. In this article, the EPA node 110 in the EPA network 100 that first sends a periodic message in the macrocycle T can be specified, and the EPA node 110 is also called the first EPA node of the EPA network 100. For example, the EPA node 110-1 connected to the control device 20 in Figures 1A and 1B can be designated as the first EPA node of the EPA network 100, and the EPA node 110-1 connected to the switch 120 or the switch 120-1 in Figures 1C and 1D can be designated as the first EPA node of the EPA network 100.
在以下的描述中,以正向传输为例来进行描述,例如,假设各个EPA节点110按照图1A至图1D中所示的EPA节点110-1→EPA节点110-2→EPA节点110-3→EPA节点110-4的顺序依次发送各自的周期报文P1、P2、P3和P4,即,每个周期报文依次经过一个EPA节点110的接收端口接收,然后通过该EPA节点110的发送端口转发给下一EPA节点110(或交换机120)。In the following description, forward transmission is taken as an example. For example, it is assumed that each EPA node 110 sends its own periodic messages P1, P2, P3 and P4 in the order of EPA node 110-1→EPA node 110-2→EPA node 110-3→EPA node 110-4 as shown in Figures 1A to 1D, that is, each periodic message is received by the receiving port of an EPA node 110 in turn, and then forwarded to the next EPA node 110 (or switch 120) through the sending port of the EPA node 110.
宏周期T的非周期时间段Tnp是所有EPA节点110共用的时间段,其可以由每个EPA节点110根据实际需要声明不同的传输时间片(例如在周期时间段Tp的周期报文中声明),例如声明不同的传输开始时间点和/或时长等。在非周期时间段Tnp期间,所有EPA节点110的传输时间片仍然不能重叠。这样,在非周期时间段Tnp,每个EPA节点110可以用来发送不等长的各种控制报文或少数关键信息。The non-periodic time period Tnp of the macrocycle T is a time period shared by all EPA nodes 110, and each EPA node 110 can declare different transmission time slices according to actual needs (for example, declare in the periodic message of the periodic time period Tp), for example, declare different transmission start time points and/or durations, etc. During the non-periodic time period Tnp, the transmission time slices of all EPA nodes 110 still cannot overlap. In this way, during the non-periodic time period Tnp, each EPA node 110 can be used to send various control messages of unequal length or a small amount of key information.
对于EPA网络100而言,需要预先对其各项运行参数进行配置,如上述宏周期长度、周期时间段长度和各个EPA节点110的发送偏移时间等,这被称为组态配置,这些参数也称为组态配置参数。当前,对EPA网络的组态配置主要通过人工方式进行计算和配置,尤其是,当网络拓扑结构或节点数量发生变化时,需要为每个EPA节点逐个地进行重计算和配置更新,这需要耗费大量的人力成本。For the EPA network 100, various operating parameters need to be configured in advance, such as the above-mentioned macrocycle length, cycle time period length, and the sending offset time of each EPA node 110, which is called configuration configuration, and these parameters are also called configuration configuration parameters. Currently, the configuration configuration of the EPA network is mainly calculated and configured manually. In particular, when the network topology or the number of nodes changes, each EPA node needs to be recalculated and updated one by one, which requires a lot of manpower costs.
针对上述问题,在本文中,在EPA网络开始运行之前或者发生改变时,由与EPA网络相连的控制设备(也称为上位机)自动根据EPA网络的信息(如拓扑结构、EPA节点的数量、用户数据量等)为该EPA网络计算一组或多组组态配置参数,并且控制设备可以基于所确定的或者所选择的组态配置参数,通过该控制设备与EPA网络之间的以太网传输(例如以UDP报文)的形式,对该EPA网络进行组态配置。In response to the above problems, in this article, before the EPA network starts running or when a change occurs, a control device (also called a host computer) connected to the EPA network automatically calculates one or more groups of configuration parameters for the EPA network based on information of the EPA network (such as topology, number of EPA nodes, amount of user data, etc.), and the control device can configure the EPA network based on the determined or selected configuration parameters through Ethernet transmission (for example, in the form of UDP packets) between the control device and the EPA network.
图3示出了根据本发明的一些实施例的用于EPA网络100的组态配置的方法300的示例性流程图。方法300例如可以由图1A和图1B中所示的控制设备20来实现。Fig. 3 shows an exemplary flow chart of a method 300 for configuring the EPA network 100 according to some embodiments of the present invention. The method 300 may be implemented by the control device 20 shown in Fig. 1A and Fig. 1B, for example.
在步骤310,控制设备20获取EPA网络100所包含的EPA节点的数量和每个EPA节点110的用户数据量。In step 310 , the control device 20 obtains the number of EPA nodes included in the EPA network 100 and the amount of user data of each EPA node 110 .
如上所述,本文的EPA网络100的拓扑结构可以是如图1A所述的环形结构、如图1B所示的线型结构或者如图1C和1D所示的星型结构。此外,本领域技术人员可以理解,除了下文中的部分具体描述(如发送偏移时间的具体计算方法)之外的其他本发明的思想,也可以等同地应用于其他拓扑结构。As described above, the topology of the EPA network 100 of this invention can be a ring structure as shown in FIG. 1A, a linear structure as shown in FIG. 1B, or a star structure as shown in FIG. 1C and 1D. In addition, those skilled in the art can understand that, in addition to some specific descriptions below (such as the specific calculation method of the sending offset time), other concepts of the present invention can also be equally applied to other topologies.
每个EPA节点110的用户数据量可以是本次组态调整期间各个EPA节点110要在每个宏周期的周期时间段期间固定发送的数据的量,例如要发送的与EPA节点110相连的传感器(图中未示出)周期性感测到的数据的量等。在EPA节点110在每个宏周期的周期时间段期间发送的数据的量发生变化时,可以重新执行本文所述的方法300以重新进行组态配置。The amount of user data of each EPA node 110 may be the amount of data that each EPA node 110 is to send during the periodic time period of each macrocycle during this configuration adjustment, such as the amount of data periodically sensed by a sensor (not shown) connected to the EPA node 110 to be sent. When the amount of data sent by the EPA node 110 during the periodic time period of each macrocycle changes, the method 300 described herein may be re-executed to reconfigure the configuration.
此外,在一些实施例中,在步骤310,控制设备20还可以获取EPA网络100的拓扑结构以用于EPA网络的组态配置参数的计算,即针对不同的拓扑结构计算不同的组态配置参数。但是本领域技术人员可以理解,EPA网络100的拓扑结构可以是固定的,或者可以由控制设备20提前得知,或者控制设备20可以不考虑拓扑结构而统一计算一组或多组组态配置参数。In addition, in some embodiments, in step 310, the control device 20 may also obtain the topology of the EPA network 100 for calculation of the configuration parameters of the EPA network, that is, different configuration parameters are calculated for different topologies. However, those skilled in the art will appreciate that the topology of the EPA network 100 may be fixed, or may be known in advance by the control device 20, or the control device 20 may uniformly calculate one or more groups of configuration parameters without considering the topology.
此外,如下所述,对于星型结构的EPA网络100,组态配置参数(更具体地,每个EPA节点110的周期时间片长度或者传输整形时间)不仅取决于EPA网络100所包含的EPA节点110的数量,还需要考虑EPA网络100所包含的交换机120的数量,即,组态配置参数还取决于EPA网络100中的最长链路设备数量,如下所详述。该最长链路设备数量也可以由控制设备20预先通过链路检测等得到或者由用户预先在控制设备20中配置。In addition, as described below, for the star-structured EPA network 100, the configuration parameters (more specifically, the cycle time slice length or transmission shaping time of each EPA node 110) not only depend on the number of EPA nodes 110 included in the EPA network 100, but also need to consider the number of switches 120 included in the EPA network 100, that is, the configuration parameters also depend on the number of the longest link devices in the EPA network 100, as described below in detail. The number of the longest link devices can also be obtained by the control device 20 in advance through link detection or the like, or can be configured in the control device 20 by the user in advance.
在步骤320,控制设备20可以基于步骤310获取的EPA网络100所包含的EPA节点110的数量和每个EPA节点110的用户数据量确定EPA网络100的组态配置参数。本文中,可以根据EPA网络100的用户需求(例如EPA网络100是否需要独立配置正向传输和逆向传输)为EPA网络100配置一组对应的组态配置参数,或者,可以为EPA网络100配置多组组态配置参数以供用户根据用户需求为EPA网络100选择一组组态配置参数以进行配置。例如,可以至少为EPA网络100的每个EPA节点110配置不同传输模式(如下文所述的第一传输模式和第二传输模式)下的最小发送偏移时间,从而分别计算一组组态配置参数,控制设备20可以根据用户需求从中选择一组组态配置参数来进行组态配置。In step 320, the control device 20 may determine the configuration parameters of the EPA network 100 based on the number of EPA nodes 110 included in the EPA network 100 and the amount of user data of each EPA node 110 obtained in step 310. Herein, a set of corresponding configuration parameters may be configured for the EPA network 100 according to the user requirements of the EPA network 100 (e.g., whether the EPA network 100 needs to independently configure forward transmission and reverse transmission), or multiple sets of configuration parameters may be configured for the EPA network 100 so that the user can select a set of configuration parameters for the EPA network 100 according to the user requirements for configuration. For example, the minimum transmission offset time under different transmission modes (such as the first transmission mode and the second transmission mode described below) may be configured for at least each EPA node 110 of the EPA network 100, thereby respectively calculating a set of configuration parameters, and the control device 20 may select a set of configuration parameters from them according to the user requirements for configuration configuration.
如上所述,组态配置参数包括EPA网络100的宏周期(T)长度、周期时间段(Tp)长度以及每个EPA节点110在宏周期T的发送偏移时间。其中,在一些具体实例中,组态配置参数中可以包含每个EPA节点110在不同传输模式下的发送偏移时间的最小值(即最小发送偏移时间)。此外,在一些实施例中,组态配置参数还可以包括每个EPA节点110在宏周期的周期时间段Tp的报文预留时间Tr。注意,该报文预留时间Tr可以由控制设备20为每个EPA节点110单独配置或统一配置,或者为预定值的情况下也可以预先存储在每个EPA节点110(和控制设备20)中。报文预留时间Tr的作用是防止EPA节点110发送的报文在网络中传输时,与其它EPA节点110发送的报文发生冲突。As described above, the configuration parameters include the length of the macrocycle (T) of the EPA network 100, the length of the periodic time period (Tp), and the sending offset time of each EPA node 110 in the macrocycle T. In some specific examples, the configuration parameters may include the minimum value of the sending offset time of each EPA node 110 in different transmission modes (i.e., the minimum sending offset time). In addition, in some embodiments, the configuration parameters may also include the message reservation time Tr of each EPA node 110 in the periodic time period Tp of the macrocycle. Note that the message reservation time Tr may be configured individually or uniformly for each EPA node 110 by the control device 20, or may be pre-stored in each EPA node 110 (and the control device 20) when it is a predetermined value. The function of the message reservation time Tr is to prevent the message sent by the EPA node 110 from conflicting with the messages sent by other EPA nodes 110 when the message is transmitted in the network.
在步骤330,控制设备20可以基于步骤320确定的组态配置参数对EPA网络100进行组态配置。例如,控制设备20可以将所确定的组态配置参数或者所选择的组态配置参数打包为UDP报文,并且通过其与EPA网络100之间的以太网链路发送给EPA网络100。更具体地,控制设备20可以将该UDP报文发送给转换设备(图中未示出)以由该转换设备通过协议转换将UDP报文转换为EPA报文,并将该EPA报文发送给每个EPA节点110以对这些EPA节点110进行组态配置。这里,该转换设备可以是单独的设备,也可以集成在EPA网络100的第一个EPA节点110(如EPA节点110-1)中。In step 330, the control device 20 may configure the EPA network 100 based on the configuration parameters determined in step 320. For example, the control device 20 may package the determined configuration parameters or the selected configuration parameters into a UDP message, and send it to the EPA network 100 via the Ethernet link between the control device 20 and the EPA network 100. More specifically, the control device 20 may send the UDP message to a conversion device (not shown in the figure) so that the conversion device converts the UDP message into an EPA message through protocol conversion, and sends the EPA message to each EPA node 110 to configure these EPA nodes 110. Here, the conversion device may be a separate device, or it may be integrated in the first EPA node 110 (such as EPA node 110-1) of the EPA network 100.
以下,将结合图4至图8详细描述根据本发明的实施例的用于确定EPA网络100的组态配置参数的过程(步骤320)。其中,图4示出了根据本发明的实施例的用于确定EPA网络100的组态配置参数的过程(步骤320)的示例性流程图。Hereinafter, the process (step 320) for determining the configuration parameters of the EPA network 100 according to an embodiment of the present invention will be described in detail in conjunction with Figures 4 to 8. Figure 4 shows an exemplary flow chart of the process (step 320) for determining the configuration parameters of the EPA network 100 according to an embodiment of the present invention.
如图4中所示,步骤320可以包括步骤322,其中控制设备20可以基于EPA网络100所包含的EPA节点110的数量和每个EPA节点110的用户数据量确定宏周期T的周期时间段(Tp)长度。As shown in FIG. 4 , step 320 may include step 322 , in which the control device 20 may determine the length of the cycle time period (Tp) of the macrocycle T based on the number of EPA nodes 110 included in the EPA network 100 and the amount of user data of each EPA node 110 .
如图2中所示以及如下结合图6A所详述,宏周期T的周期时间段Tp由分配给每个EPA节点110的周期时间片Tpi(i=1,2,……,m,其中m为EPA网络100所包含的EPA节点110的数量)组成,而分配给每个EPA节点110的周期时间片Tpi长度又主要取决于该EPA节点110的用户数据量。As shown in Figure 2 and described in detail below in conjunction with Figure 6A, the periodic time period Tp of the macro cycle T is composed of a periodic time slice Tpi (i=1, 2, ..., m, where m is the number of EPA nodes 110 included in the EPA network 100) allocated to each EPA node 110, and the length of the periodic time slice Tpi allocated to each EPA node 110 mainly depends on the amount of user data of the EPA node 110.
此外,为了保证EPA网络100中的所有EPA节点110之间的传输不发生冲突,每个EPA节点110的周期时间片长度还应当包含报文整形时间Tm,取决于不同传输模式,报文整形时间Tm可以按照不同的方式确定,如下所详述。In addition, in order to ensure that there is no conflict in the transmission between all EPA nodes 110 in the EPA network 100, the periodic time slice length of each EPA node 110 should also include the message shaping time Tm. Depending on different transmission modes, the message shaping time Tm can be determined in different ways, as described in detail below.
此外,每个EPA节点110的周期时间片长度还可以包括为该EPA节点110预设的报文预留时间Tr。报文预留时间Tr可以是控制设备20为每个EPA节点110单独设置的相同或不同的时间间隔,或者可以是预先存储在每个EPA节点110中或者EPA网络100的协议栈空间中的相同或不同的时间间隔。In addition, the periodic time slice length of each EPA node 110 may also include a message reservation time Tr preset for the EPA node 110. The message reservation time Tr may be the same or different time intervals individually set by the control device 20 for each EPA node 110, or may be the same or different time intervals pre-stored in each EPA node 110 or in the protocol stack space of the EPA network 100.
图5示出了根据本发明一些实施例的确定宏周期T的周期时间段(Tp)长度的过程(步骤322)的进一步详细流程图。图6A示出了EPA网络100中的所有EPA节点110的周期时间片(Tp1、Tp2、Tp3、Tp4)的示意图,并且图6B示出了一个周期时间片(例如Tp1)的示例性示意图。Figure 5 shows a further detailed flow chart of the process (step 322) of determining the length of the period time period (Tp) of the macrocycle T according to some embodiments of the present invention. Figure 6A shows a schematic diagram of the period time slices (Tp1, Tp2, Tp3, Tp4) of all EPA nodes 110 in the EPA network 100, and Figure 6B shows an exemplary schematic diagram of a period time slice (e.g., Tp1).
如图5中所示,在步骤3222,对于每个EPA节点110(例如EPA节点110-1),控制设备20可以基于该EPA节点110的用户数据量确定该EPA节点110-1的报文占用时间Ts1。As shown in FIG. 5 , in step 3222 , for each EPA node 110 (eg, EPA node 110 - 1 ), the control device 20 may determine the message occupancy time Ts1 of the EPA node 110 - 1 based on the amount of user data of the EPA node 110 .
其中,报文占用时间Ts1中可以包含一个或多个周期报文P1,用于承载该EPA节点110的用户数据量。本文中,假设周期报文P1是适合于EPA协议的FRT(Fast Real Time,快速实时)报文,因此在图6B中多个周期报文P1也被分别标记为FRT0、FRT1、……。The message occupation time Ts1 may include one or more periodic messages P1, which are used to carry the user data volume of the EPA node 110. In this article, it is assumed that the periodic message P1 is a FRT (Fast Real Time) message suitable for the EPA protocol, so in FIG6B, multiple periodic messages P1 are also marked as FRT0, FRT1, ... respectively.
在计算EPA节点110-1的报文占用时间Ts1时,可以先基于以太网的最大帧长度确定传输对应的用户数据量所需要的总字节数,然后根据总字节数和网络传输速度(例如千兆以太网的网络传输速度为125MB/秒)计算传输该总字节数所需要占用的时间作为该EPA节点的报文占用时间。When calculating the message occupancy time Ts1 of the EPA node 110-1, the total number of bytes required to transmit the corresponding amount of user data can be determined based on the maximum frame length of the Ethernet, and then the time required to transmit the total number of bytes can be calculated based on the total number of bytes and the network transmission speed (for example, the network transmission speed of Gigabit Ethernet is 125MB/s) as the message occupancy time of the EPA node.
具体地,如图6B中所示,每个FRT报文包括FRT报文头、用户数据段、FCS(FrameCheck Sequence,帧校验序列)字段和帧间隔,其中用户数据段用于承载上文所述的用户数据量。Specifically, as shown in FIG. 6B , each FRT message includes an FRT message header, a user data segment, an FCS (Frame Check Sequence) field, and a frame interval, wherein the user data segment is used to carry the user data amount mentioned above.
例如,假设EPA节点110-1的用户数据量是5000B,则可以按照如下表1设计EPA节点110-1的各个FRT报文:For example, assuming that the amount of user data of the EPA node 110-1 is 5000B, each FRT message of the EPA node 110-1 can be designed according to the following Table 1:
其中,FRT0的报文头长度包含28B的以太网报文头和14B的MAC字段,FCS字段长度固定为4B,帧间隔固定为12B。因此,根据EPA节点110-1的用户数据量5000B,考虑到以太网的最大帧长度,可以将FRT0、FRT1和FRT2分别设置为1530B,相应地,为其分配的用户数据段分别为1472B、1476B和1476B,并且FRT4的用户数据段为5000B-1472B-1476B-1476B=576B。因此,在上述假设下,用于传输EPA节点110-1的用户数据段的四个周期报文P1分别为1530B、1530B、1530B和618B,如表1所示。Among them, the message header length of FRT0 includes a 28B Ethernet message header and a 14B MAC field, the FCS field length is fixed to 4B, and the frame interval is fixed to 12B. Therefore, according to the user data volume of EPA node 110-1 of 5000B, considering the maximum frame length of Ethernet, FRT0, FRT1 and FRT2 can be set to 1530B respectively, and the user data segments allocated to them are 1472B, 1476B and 1476B respectively, and the user data segment of FRT4 is 5000B-1472B-1476B-1476B=576B. Therefore, under the above assumptions, the four periodic messages P1 used to transmit the user data segment of EPA node 110-1 are 1530B, 1530B, 1530B and 618B respectively, as shown in Table 1.
这样,EPA节点110-1传输5000B的用户数据量所需要传输的总字节数为5208B,在千兆以太网中,传输1B需要8ns,故报文占用时间Ts1为5208*8=41664ns。Thus, the total number of bytes that the EPA node 110 - 1 needs to transmit to transmit 5000B of user data is 5208B. In Gigabit Ethernet, it takes 8ns to transmit 1B, so the message occupancy time Ts1 is 5208*8=41664ns.
在步骤3224,控制设备20可以基于步骤3222所计算的EPA节点110-1的报文占用时间Ts1、传输整形时间Tm1和报文预留时间Tr1确定该EPA节点110-1的周期时间片(Tp1)长度。In step 3224 , the control device 20 may determine the length of the periodic time slice (Tp1 ) of the EPA node 110 - 1 based on the message occupation time Ts1 , transmission shaping time Tm1 , and message reservation time Tr1 of the EPA node 110 - 1 calculated in step 3222 .
在一些实施例中,控制设备20可以为每个EPA节点110分别设置传输整形时间Tm。更具体地,在步骤3224之前,控制设备20还可以至少基于每个EPA节点110的节点间线路延时和节点转发延时确定该EPA节点110的传输整形时间。In some embodiments, the control device 20 may set the transmission shaping time Tm for each EPA node 110. More specifically, before step 3224, the control device 20 may also determine the transmission shaping time of each EPA node 110 based at least on the inter-node line delay and the node forwarding delay of the EPA node 110.
这里,EPA节点110的传输整形时间Tm的确定可以参考如下图8所述。Here, the determination of the transmission shaping time Tm of the EPA node 110 may refer to the following description of FIG. 8 .
因此,在步骤3224,每个EPA节点110的周期时间片(Tpi)长度可以被确定为该EPA节点110的报文占用时间Ts、传输整形时间Tm和报文预留时间Tr之和。Therefore, in step 3224 , the periodic time slice (Tpi) length of each EPA node 110 may be determined as the sum of the message occupation time Ts, the transmission shaping time Tm, and the message reservation time Tr of the EPA node 110 .
继续图5,在步骤3226,控制设备20可以对EPA网络100的所有EPA节点110的周期时间片Tpi长度求和以确定EPA网络100的周期时间段(Tp)长度。即,Tp=ΣTpi。5 , at step 3226 , the control device 20 may sum the lengths of the periodic time slices Tpi of all EPA nodes 110 of the EPA network 100 to determine the length of the periodic time period (Tp) of the EPA network 100 . That is, Tp=ΣTpi.
继续图4,在步骤324,控制设备20可以基于周期时间段长度(Tp)和非周期时间长度(Tnp)确定EPA网络100的宏周期长度T。Continuing with FIG. 4 , at step 324 , the control device 20 may determine a macrocycle length T of the EPA network 100 based on the cycle time period length (Tp) and the non-cycle time length (Tnp).
具体地,控制设备20可以基于预先设置的非周期预留时间片和时钟同步误差确定宏周期的非周期时间长度Tnp。Specifically, the control device 20 may determine the non-periodic time length Tnp of the macrocycle based on a preset non-periodic reserved time slice and a clock synchronization error.
例如,非周期时间Tnp可以如下确定:For example, the non-periodic time Tnp can be determined as follows:
非周期时间Tnp =非周期预留时间片 + 时钟同步误差Non-periodic time Tnp = non-periodic reserved time slice + clock synchronization error
此外,在一些实施例中,还可以在非周期时间Tnp中设置同步字段,在这种情况下,非周期时间可以如下确定:In addition, in some embodiments, a synchronization field may also be set in the non-periodic time Tnp. In this case, the non-periodic time may be determined as follows:
非周期时间Tnp = 同步字段占用时间 + 非周期预留时间片 + 时钟同步误差Non-periodic time Tnp = synchronization field occupied time + non-periodic reserved time slice + clock synchronization error
这里,同步字段占用时间、非周期预留时间片和时钟同步误差都是预先设置或测量的值,例如,同步字段占用时间可以直接指定或者基于所需的同步字段长度与带宽来计算,同步字段长度例如可以是固定的64字节,因此这里不再赘述非周期时间Tnp的计算。并且,每个EPA节点110的时钟同步误差可能不同。在本文中,在组态配置参数计算过程中,使用所有EPA节点110的时钟同步误差的最大值作为时钟同步误差。Here, the synchronization field occupied time, the non-periodic reserved time slice and the clock synchronization error are all pre-set or measured values. For example, the synchronization field occupied time can be directly specified or calculated based on the required synchronization field length and bandwidth. The synchronization field length can be, for example, a fixed 64 bytes, so the calculation of the non-periodic time Tnp is not repeated here. In addition, the clock synchronization error of each EPA node 110 may be different. In this article, in the configuration parameter calculation process, the maximum value of the clock synchronization errors of all EPA nodes 110 is used as the clock synchronization error.
然后,可以对周期时间段长度Tp和非周期时间长度Tnp求和以确定EPA网络100的宏周期长度T。The periodic time period length Tp and the non-periodic time length Tnp may then be summed to determine a macrocycle length T of the EPA network 100 .
继续图4,在步骤326,对于EPA网络100中的每个EPA节点110,控制设备20可以基于该EPA节点110的前一EPA节点的发送偏移时间和前一EPA节点占用的总时间确定该EPA节点110的发送偏移时间。Continuing with FIG. 4 , in step 326 , for each EPA node 110 in the EPA network 100 , the control device 20 may determine the sending offset time of the EPA node 110 based on the sending offset time of the previous EPA node of the EPA node 110 and the total time occupied by the previous EPA node.
图7A示出了根据本发明一些实施例的各个EPA节点110的周期报文的传输示意图。其中,图7A中示出了EPA网络100的第一传输模式下的各个EPA节点110的发送偏移时间的示意图。在该第一传输模式下,各个EPA节点在前一EPA节点的周期报文完成在整个EPA网络中的传输后才发送本节点的周期报文,并且需要考虑正向传输与逆向传输,因此也称为宽松模式。其中将正向传输的周期报文标记为N1、N2、N3、N4,将逆向传输的周期报文标记为N1’、N2’、N3’、N4’。注意,这里的周期报文N1、N2、N3、N4等与上面结合图6A和图6B所述的周期报文P1、P2、P3、P4或FRT报文不同,这里的周期报文N1、N2、N3、N4相当于每个EPA节点110的用户数据,其所占用的时间为上文结合图6A所述的报文占用时间Ts。FIG. 7A shows a schematic diagram of the transmission of periodic messages of each EPA node 110 according to some embodiments of the present invention. FIG. 7A shows a schematic diagram of the transmission offset time of each EPA node 110 in the first transmission mode of the EPA network 100. In the first transmission mode, each EPA node sends the periodic message of the node only after the periodic message of the previous EPA node completes the transmission in the entire EPA network, and forward transmission and reverse transmission need to be considered, so it is also called a loose mode. The periodic messages of forward transmission are marked as N1, N2, N3, and N4, and the periodic messages of reverse transmission are marked as N1', N2', N3', and N4'. Note that the periodic messages N1, N2, N3, and N4 here are different from the periodic messages P1, P2, P3, and P4 or FRT messages described above in conjunction with FIG. 6A and FIG. 6B. The periodic messages N1, N2, N3, and N4 here are equivalent to the user data of each EPA node 110, and the time they occupy is the message occupancy time Ts described above in conjunction with FIG. 6A.
如图7A中所示,假设各个EPA节点110的周期报文以顺时针方向传输,并且EPA节点110-1、EPA节点110-2、EPA节点110-3、EPA节点110-4依次发送报文,由此可得如图7A所示的调度传输结果。在图7A中,T1为EPA节点110-1的发送偏移时间(在EPA节点110-1是EPA网络100中的第一个EPA节点的情况下,也可以将其发送偏移时间设置为0),T2为EPA节点110-2的发送偏移时间。t1_i为从第i个EPA节点到第i+1个EPA节点的节点间线路延时,t2_i为第i个EPA节点的节点转发延时,t3_i为第i个EPA节点的报文占用时间(即上文所述的报文占用时间ts),t4_i为第i个EPA节点占用的总时间。As shown in FIG7A , assuming that the periodic messages of each EPA node 110 are transmitted in a clockwise direction, and EPA node 110-1, EPA node 110-2, EPA node 110-3, and EPA node 110-4 send messages in sequence, the scheduling transmission result shown in FIG7A can be obtained. In FIG7A , T1 is the sending offset time of EPA node 110-1 (when EPA node 110-1 is the first EPA node in EPA network 100, its sending offset time can also be set to 0), and T2 is the sending offset time of EPA node 110-2. t1_i is the inter-node line delay from the i-th EPA node to the i+1-th EPA node, t2_i is the node forwarding delay of the i-th EPA node, t3_i is the message occupancy time of the i-th EPA node (i.e., the message occupancy time ts mentioned above), and t4_i is the total time occupied by the i-th EPA node.
以下对EPA节点110-1正向传输过程进行说明:The forward transmission process of the EPA node 110-1 is described below:
EPA节点110-1的发送端口1A在T1时刻发送的周期报文N1,经过t1_1时间到达EPA节点110-2的接收端口2B;The periodic message N1 sent by the sending port 1A of the EPA node 110-1 at time T1 arrives at the receiving port 2B of the EPA node 110-2 after time t1_1;
EPA节点110-2的接收端口2B接收到周期报文N1后,经过t2_2时间从EPA节点110-2的发送端口2A转发出去;After receiving the periodic message N1, the receiving port 2B of the EPA node 110-2 forwards it from the sending port 2A of the EPA node 110-2 after t2_2;
EPA节点110-2的发送端口2A转发的周期报文N1经过t1_2时间到达EPA节点110-3的接收端口3B;The periodic message N1 forwarded by the sending port 2A of the EPA node 110-2 arrives at the receiving port 3B of the EPA node 110-3 after t1_2 time;
EPA节点110-3的接收端口3B接收到周期报文N1后,经过t2_3时间从EPA节点110-3的发送端口3A转发出去;After receiving the periodic message N1, the receiving port 3B of the EPA node 110-3 forwards it from the sending port 3A of the EPA node 110-3 after t2_3 time;
EPA节点110-3的发送端口3A转发的周期报文N1经过t1_3时间到达EPA节点110-4的接收端口4B;The periodic message N1 forwarded by the sending port 3A of the EPA node 110 - 3 arrives at the receiving port 4B of the EPA node 110 - 4 after t1_3 time;
EPA节点110-4的接收端口4B接收到周期报文N1后,经过t2_4时间从EPA节点110-4的发送端口4A转发出去;After receiving the periodic message N1, the receiving port 4B of the EPA node 110-4 forwards it from the sending port 4A of the EPA node 110-4 after t2_4 time;
EPA节点110-4的发送端口4A转发的周期报文N1经过t1_4时间达到EPA节点110-1的接收端口1B。The periodic message N1 forwarded by the sending port 4A of the EPA node 110 - 4 reaches the receiving port 1B of the EPA node 110 - 1 after time t1_4.
因此可以看出,EPA节点110-1占用的总时间t4_1包含EPA节点110-1报文占用时间t3_1、节点间线路延时t1_i之和和节点转发延时t2_i之和。此外,EPA节点110-1占用的总时间t4_1还可以包含报文预留时间t6(这里,报文预留时间t6可以是如上所述为每个EPA节点110分别设置或者共同设置的报文预留时间Tr)和EPA网络100的时钟同步误差t7。即Therefore, it can be seen that the total time t4_1 occupied by the EPA node 110-1 includes the message occupied time t3_1 of the EPA node 110-1, the sum of the line delays t1_i between nodes, and the sum of the node forwarding delays t2_i. In addition, the total time t4_1 occupied by the EPA node 110-1 can also include the message reservation time t6 (here, the message reservation time t6 can be the message reservation time Tr set separately or jointly for each EPA node 110 as described above) and the clock synchronization error t7 of the EPA network 100. That is,
(1) (1)
其中t1_i为从第i个EPA节点到第i+1个EPA节点的节点间线路延时,t2_i为第i个EPA节点的节点转发延时,t3_i为第i个EPA节点的报文占用时间(即上文所述的报文占用时间ts),t4_i为第i个EPA节点占用的总时间,t6为报文预留时间,t7为EPA网络100的时钟同步误差,在EPA网络100是环形结构的情况下,n为EPA网络100所包含的EPA节点110的数量。Among them, t1_i is the inter-node line delay from the i-th EPA node to the i+1-th EPA node, t2_i is the node forwarding delay of the i-th EPA node, t3_i is the message occupancy time of the i-th EPA node (that is, the message occupancy time ts mentioned above), t4_i is the total time occupied by the i-th EPA node, t6 is the message reservation time, t7 is the clock synchronization error of the EPA network 100, and when the EPA network 100 is a ring structure, n is the number of EPA nodes 110 contained in the EPA network 100.
更一般性地,对于第i个EPA节点110,可以基于从第i个EPA节点到第i+1个EPA节点的节点间线路延时,第i个EPA节点的节点转发延时t2_i,第i个EPA节点的报文占用时间t3_i(即上文所述的报文占用时间tsi)、报文预留时间t6以及EPA网络100的时钟同步误差t7来确定第i个EPA节点占用的总时间t4_i,可以表示为:More generally, for the i-th EPA node 110, the total time t4_i occupied by the i-th EPA node can be determined based on the inter-node line delay from the i-th EPA node to the i+1-th EPA node, the node forwarding delay t2_i of the i-th EPA node, the message occupancy time t3_i of the i-th EPA node (i.e., the message occupancy time tsi mentioned above), the message reservation time t6, and the clock synchronization error t7 of the EPA network 100, which can be expressed as:
(2 ) (2)
其中t1_i为从第i个EPA节点到第i+1个EPA节点的节点间线路延时,t2_i为第i个EPA节点的节点转发延时,t3_i为第i个EPA节点的报文占用时间(即上文所述的报文占用时间ts),t4_i为第i个EPA节点占用的总时间,t6为报文预留时间,t7为EPA网络100的时钟同步误差,在EPA网络100是环形结构的情况下,n为EPA网络100所包含的EPA节点110的数量。Among them, t1_i is the inter-node line delay from the i-th EPA node to the i+1-th EPA node, t2_i is the node forwarding delay of the i-th EPA node, t3_i is the message occupancy time of the i-th EPA node (that is, the message occupancy time ts mentioned above), t4_i is the total time occupied by the i-th EPA node, t6 is the message reservation time, t7 is the clock synchronization error of the EPA network 100, and when the EPA network 100 is a ring structure, n is the number of EPA nodes 110 contained in the EPA network 100.
为避免其它EPA节点110的周期报文与EPA节点110-1的周期报文N1发送冲突,则其它EPA节点110至少应在T1+t4时刻或其之后发送周期报文,因此下一个EPA节点110-2的发送偏移时间:To avoid conflicts between the periodic messages of other EPA nodes 110 and the periodic message N1 of EPA node 110-1, other EPA nodes 110 should send periodic messages at least at or after time T1+t4. Therefore, the sending offset time of the next EPA node 110-2 is:
T2=T1+t4 (3 )T2=T1+t4 (3)
综上所述,在环形网络中配置发送偏移时间时,若本节点占用时间片前有其它节点已占用,则该节点的发送偏移时间=前一个节点的发送偏移时间+前一个节点报文占用时间+ 传输整形时间 + 报文预留时间。To summarize, when configuring the sending offset time in a ring network, if other nodes have occupied the time slice before this node occupies it, the sending offset time of this node = the sending offset time of the previous node + the message occupying time of the previous node + the transmission shaping time + the message reservation time.
类似地,对于如图1B所示的线型拓扑的EPA网络100,周期报文N1在到达最后一个EPA节点110-4并被处理之后,无需再通过EPA节点110-4的发送端口4A发送并被第一个EPA节点110-1的接收端口1B接收。因此在这种情况下,EPA节点110-1占用的总时间可以可以表示为:Similarly, for the EPA network 100 of the linear topology as shown in FIG1B , after the periodic message N1 reaches the last EPA node 110-4 and is processed, it does not need to be sent through the sending port 4A of the EPA node 110-4 and received by the receiving port 1B of the first EPA node 110-1. Therefore, in this case, the total time occupied by the EPA node 110-1 can be expressed as:
(4) (4)
其中t1_i为从第i个EPA节点到第i+1个EPA节点的节点间线路延时,t2_i为第i个EPA节点的节点转发延时,t3_i为第i个EPA节点的报文占用时间(即上文所述的报文占用时间ts),t4_i为第i个EPA节点占用的总时间,t6为报文预留时间,t7为EPA网络100的时钟同步误差,在EPA网络100是线型结构的情况下,n为EPA网络100所包含的EPA节点110的数量,在EPA网络100是星型结构的情况下,n为EPA网络100的最长链路设备数量。Among them, t1_i is the inter-node line delay from the i-th EPA node to the i+1-th EPA node, t2_i is the node forwarding delay of the i-th EPA node, t3_i is the message occupancy time of the i-th EPA node (that is, the message occupancy time ts mentioned above), t4_i is the total time occupied by the i-th EPA node, t6 is the message reservation time, t7 is the clock synchronization error of the EPA network 100, when the EPA network 100 is a linear structure, n is the number of EPA nodes 110 included in the EPA network 100, and when the EPA network 100 is a star structure, n is the number of longest link devices in the EPA network 100.
更一般性地,对于第i个EPA节点110,可以基于从第i个EPA节点到第i+1个EPA节点的节点间线路延时,第i个EPA节点的节点转发延时t2_i,第i个EPA节点的报文占用时间t3_i(即上文所述的报文占用时间tsi)、报文预留时间t6以及EPA网络100的时钟同步误差t7来确定第i个EPA节点占用的总时间t4_i,可以表示为:More generally, for the i-th EPA node 110, the total time t4_i occupied by the i-th EPA node can be determined based on the inter-node line delay from the i-th EPA node to the i+1-th EPA node, the node forwarding delay t2_i of the i-th EPA node, the message occupancy time t3_i of the i-th EPA node (i.e., the message occupancy time tsi mentioned above), the message reservation time t6, and the clock synchronization error t7 of the EPA network 100, which can be expressed as:
(5) (5)
对于图1C和图1D的星型网络,可以按照上述公式(5)类似的方式来确定第i个EPA节点占用的总时间。For the star networks of FIG. 1C and FIG. 1D , the total time occupied by the i-th EPA node may be determined in a manner similar to the above formula (5).
其中t1_i为从第i个EPA节点到第i+1个EPA节点的节点间线路延时,t2_i为第i个EPA节点的节点转发延时,t3_i为第i个EPA节点的报文占用时间(即上文所述的报文占用时间ts),t4_i为第i个EPA节点占用的总时间,t6为报文预留时间,t7为EPA网络100的时钟同步误差,在EPA网络100是线型结构的情况下,n为EPA网络100所包含的EPA节点110的数量,在EPA网络100是星型结构的情况下,n为EPA网络100的最长链路设备数量。Among them, t1_i is the inter-node line delay from the i-th EPA node to the i+1-th EPA node, t2_i is the node forwarding delay of the i-th EPA node, t3_i is the message occupancy time of the i-th EPA node (that is, the message occupancy time ts mentioned above), t4_i is the total time occupied by the i-th EPA node, t6 is the message reservation time, t7 is the clock synchronization error of the EPA network 100, when the EPA network 100 is a linear structure, n is the number of EPA nodes 110 included in the EPA network 100, and when the EPA network 100 is a star structure, n is the number of longest link devices in the EPA network 100.
这里,取决于EPA网络100的拓扑结构不同,n具有不同的含义。例如,对于上述公式(1)和(2)所表示的环形结构的EPA网络100,n为EPA网络100所包含的EPA节点110的数量,此时n=m。对于上述公式(4)和(5)所表示的线型和星型结构的EPA网络100,n为线型结构的EPA网络100所包含的EPA节点110的数量,此时n=m,或者n为星型结构的EPA网络100的最长链路设备数量。Here, n has different meanings depending on the topological structure of the EPA network 100. For example, for the EPA network 100 with a ring structure represented by the above formulas (1) and (2), n is the number of EPA nodes 110 included in the EPA network 100, and n=m. For the EPA network 100 with a linear structure and a star structure represented by the above formulas (4) and (5), n is the number of EPA nodes 110 included in the EPA network 100 with a linear structure, and n=m, or n is the number of the longest link devices of the EPA network 100 with a star structure.
EPA网络100的最长链路设备数量是EPA网络100中的最长链路所包含的设备(包括EPA节点110和交换机120)的数量。例如,在图1C中,EPA网络100的最长链路为从EPA节点110-1到交换机120再到EPA节点110-2至EPA节点110-4中任一个的链路,相应的最长链路设备数量为3,在图1D中,EPA网络100的最长链路为EPA节点110-1→交换机120-1→交换机120-2→交换机120-3→EPA节点110-4的链路,相应的最长链路设备数量为5。也就是说,在确定每个EPA节点110占用的总时间时,需要考虑该EPA节点110的最大传输路径上的所有链路和设备的延迟。The number of devices of the longest link of the EPA network 100 is the number of devices (including the EPA nodes 110 and the switches 120) included in the longest link in the EPA network 100. For example, in FIG1C , the longest link of the EPA network 100 is a link from the EPA node 110-1 to the switch 120 and then to any one of the EPA nodes 110-2 and 110-4, and the corresponding number of devices of the longest link is 3. In FIG1D , the longest link of the EPA network 100 is a link from the EPA node 110-1→switch 120-1→switch 120-2→switch 120-3→EPA node 110-4, and the corresponding number of devices of the longest link is 5. That is, when determining the total time occupied by each EPA node 110, the delays of all links and devices on the maximum transmission path of the EPA node 110 need to be considered.
在图7A所示的第一传输模式(宽松模式)下,可以为每个EPA节点110分别设置用于正向传输的正向发送偏移时间和用于逆向传输的逆向发送偏移时间,并且正向发送偏移时间与逆向发送偏移时间被设置为相等。例如,可以通过对上述公式(1)至(5)中的参数(如报文预留时间t6)进行配置来使得正向发送偏移时间等于逆向发送偏移时间。In the first transmission mode (relaxed mode) shown in FIG7A , a forward transmission offset time for forward transmission and a reverse transmission offset time for reverse transmission can be set for each EPA node 110, and the forward transmission offset time and the reverse transmission offset time are set equal. For example, the forward transmission offset time can be equal to the reverse transmission offset time by configuring the parameters in the above formulas (1) to (5) (such as the message reservation time t6).
图7B示出了根据本发明另一些实施例的各个EPA节点110的周期报文的传输示意图。其中,图7B中示出了EPA网络100的第二传输模式下的各个EPA节点110的发送偏移时间的示意图。在该第二传输模式下,EPA节点110的正向传输的发送偏移时间与逆向传输的发送偏移时间分别独立配置,两者之间无关联,因此也称为紧凑模式。如图7B所示为紧凑模式的单向调度示意图,各个EPA节点在完成转发上一条周期报文后,立即发送本节点的周期报文。在图7B中,T1为EPA节点110-1的发送偏移时间,T2为EPA节点110-2的发送偏移时间。与上述图7A类似,t1_i为从第i个EPA节点到第i+1个EPA节点的节点间线路延时,t2_i为第i个EPA节点的节点转发延时,t3_i为第i个EPA节点的报文占用时间(即上文所述的报文占用时间ts),t4_i为第i个EPA节点占用的总时间。FIG7B shows a schematic diagram of the transmission of periodic messages of each EPA node 110 according to some other embodiments of the present invention. FIG7B shows a schematic diagram of the sending offset time of each EPA node 110 in the second transmission mode of the EPA network 100. In the second transmission mode, the sending offset time of the forward transmission of the EPA node 110 and the sending offset time of the reverse transmission are configured independently, and there is no correlation between the two, so it is also called a compact mode. FIG7B is a schematic diagram of the one-way scheduling of the compact mode, and each EPA node immediately sends the periodic message of the node after completing the forwarding of the previous periodic message. In FIG7B, T1 is the sending offset time of the EPA node 110-1, and T2 is the sending offset time of the EPA node 110-2. Similar to the above-mentioned Figure 7A, t1_i is the inter-node line delay from the i-th EPA node to the i+1-th EPA node, t2_i is the node forwarding delay of the i-th EPA node, t3_i is the message occupancy time of the i-th EPA node (i.e., the message occupancy time ts mentioned above), and t4_i is the total time occupied by the i-th EPA node.
由图7B中可知,EPA节点110-1占用的总时间t4可以表示为:As can be seen from FIG. 7B , the total time t4 occupied by the EPA node 110 - 1 can be expressed as:
t4= t1+t2+t3+t5+t6+t7 (6)t4= t1+t2+t3+t5+t6+t7 (6)
即,对于第i个EPA节点110,可以对从第i-1个EPA节点到第i个EPA节点的节点间线路延时t1,第i-1个EPA节点的节点转发延时t2,第i-1个EPA节点的报文占用时间t3(即上文所述的报文占用时间ts)、预设的帧间隔t5(例如表1所示的帧间隔12B)、报文预留时间t6以及EPA网络100的时钟同步误差t7来确定第i个EPA节点占用的总时间t4_i。That is, for the i-th EPA node 110, the total time t4_i occupied by the i-th EPA node can be determined by the node-to-node line delay t1 from the i-1-th EPA node to the i-th EPA node, the node forwarding delay t2 of the i-1-th EPA node, the message occupancy time t3 of the i-1-th EPA node (i.e., the message occupancy time ts mentioned above), the preset frame interval t5 (for example, the frame interval 12B shown in Table 1), the message reservation time t6, and the clock synchronization error t7 of the EPA network 100.
若EPA节点110-2转发EPA节点110-1的周期报文N1与发送本节点的周期报文N2不发生冲突,则EPA节点110-2至少在与T1间隔t4之后的T2时刻发送本节点的周期报文N2,即If the periodic message N1 forwarded by EPA node 110-2 does not conflict with the periodic message N2 sent by EPA node 110-2, then EPA node 110-2 sends the periodic message N2 of this node at least at time T2 after an interval of t4 from T1, that is,
T2=T1+t1+t2+t3+t5+t6+t7。 (7)T2=T1+t1+t2+t3+t5+t6+t7. (7)
综上所述,当前的EPA节点110配置的发送偏移时间=前一个EPA节点的发送偏移时间+节点间线路延时t1+节点转发延时t2+前一个EPA节点的报文占用时间t3+帧间隔t5+报文预留时间t6+时钟同步误差t7。In summary, the sending offset time configured by the current EPA node 110 = the sending offset time of the previous EPA node + the line delay between nodes t1 + the node forwarding delay t2 + the message occupying time t3 of the previous EPA node + the frame interval t5 + the message reservation time t6 + the clock synchronization error t7.
可以看出,与宽松模式相比,在紧凑模式下,两个相邻EPA节点的发送偏移时间的间隔更小,从而带宽利用率高。It can be seen that, compared with the loose mode, in the compact mode, the interval between the sending offset times of two adjacent EPA nodes is smaller, so that the bandwidth utilization is high.
同时,需注意采用紧凑模式配置发送偏移时间时,配置发送偏移时间的顺序与EPA节点110连接的顺序应保持一致。例如,以图1A中所示的环形拓扑结构为例,在配置正向传输的发送偏移时间时,只能以EPA节点110-1→EPA节点110-2→EPA节点110-3→EPA节点110-4、EPA节点110-2→EPA节点110-3→EPA节点110-4→EPA节点110-1、EPA节点110-3→EPA节点110-4→EPA节点110-1→EPA节点110-2、EPA节点110-4→EPA节点110-1→EPA节点110-2→EPA节点110-3这四种顺序配置。At the same time, it should be noted that when the compact mode is used to configure the sending offset time, the order of configuring the sending offset time should be consistent with the order of connecting the EPA nodes 110. For example, taking the ring topology shown in FIG1A as an example, when configuring the sending offset time of forward transmission, only four orders can be configured: EPA node 110-1→EPA node 110-2→EPA node 110-3→EPA node 110-4, EPA node 110-2→EPA node 110-3→EPA node 110-4→EPA node 110-1, EPA node 110-3→EPA node 110-4→EPA node 110-1→EPA node 110-2, and EPA node 110-4→EPA node 110-1→EPA node 110-2→EPA node 110-3.
图7C示出了与图7B对应的根据本发明另一些实施例的各个EPA节点110的周期报文的传输示意图。与图7B中不同的是,图7C所示为紧凑模式的双向调度示意图,其中将正向传输的周期报文标记为N1、N2、N3、N4,将逆向传输的周期报文标记为N1’、N2’、N3’、N4’。FIG7C shows a transmission diagram of periodic messages of each EPA node 110 according to other embodiments of the present invention corresponding to FIG7B. Different from FIG7B, FIG7C shows a bidirectional scheduling diagram of the compact mode, in which the periodic messages transmitted in the forward direction are marked as N1, N2, N3, and N4, and the periodic messages transmitted in the reverse direction are marked as N1', N2', N3', and N4'.
以图1A中所示环形拓扑结构的EPA网络100为例,假设周期报文以顺时针方向传输为正向传输、以逆时针方向传输为逆向传输。假设正向传输按EPA节点110-1→EPA节点110-2→EPA节点110-3→EPA节点110-4的方式传输,逆向传输按EPA节点110-1→EPA节点110-4→EPA节点110-3→EPA节点110-2的方式传输,则根据上述结合图7B描述的类似的方式可以得到如图7C所示调度传输结果。Taking the EPA network 100 of the ring topology structure shown in FIG1A as an example, it is assumed that the periodic message is transmitted in a clockwise direction as forward transmission and in a counterclockwise direction as reverse transmission. It is assumed that the forward transmission is transmitted in the manner of EPA node 110-1→EPA node 110-2→EPA node 110-3→EPA node 110-4, and the reverse transmission is transmitted in the manner of EPA node 110-1→EPA node 110-4→EPA node 110-3→EPA node 110-2, then according to the similar method described above in conjunction with FIG7B, the scheduling transmission result shown in FIG7C can be obtained.
在图7C所示的第二传输模式(紧凑模式)下,可以为每个EPA节点110分别设置用于正向传输的正向发送偏移时间和用于逆向传输的逆向发送偏移时间,并且可以独立地设置正向发送偏移时间和逆向发送偏移时间。即,正向发送偏移时间和逆向发送偏移时间可以相同也可以不同。例如,可以通过对上述公式(6)和(7)中的参数(如报文预留时间t6)进行配置来设置相同或者不同的正向发送偏移时间和逆向发送偏移时间。In the second transmission mode (compact mode) shown in FIG7C , a forward transmission offset time for forward transmission and a reverse transmission offset time for reverse transmission can be set for each EPA node 110, and the forward transmission offset time and the reverse transmission offset time can be set independently. That is, the forward transmission offset time and the reverse transmission offset time can be the same or different. For example, the parameters in the above formulas (6) and (7) (such as the message reservation time t6) can be configured to set the same or different forward transmission offset time and reverse transmission offset time.
图7D和图7E分别示出了根据本发明再一些实施例的各个EPA节点110的周期报文的传输示意图。其中,图7D示出了根据图1C所示的星型结构的EPA网络100中的各个EPA节点110在第一传输模式(宽松模式)下的传输示意图;图7E示出了根据图1D所示的星型结构的EPA网络100中的各个EPA节点110在第一传输模式(宽松模式)下的传输示意图。对于图7D和图7E,可以与上述结合图7B所述类似地确定各个EPA节点的传输整形时间Tm和发送偏移时间。FIG7D and FIG7E respectively show schematic diagrams of transmission of periodic messages of each EPA node 110 according to some further embodiments of the present invention. FIG7D shows a schematic diagram of transmission of each EPA node 110 in the star-structured EPA network 100 shown in FIG1C in the first transmission mode (loose mode); FIG7E shows a schematic diagram of transmission of each EPA node 110 in the star-structured EPA network 100 shown in FIG1D in the first transmission mode (loose mode). For FIG7D and FIG7E, the transmission shaping time Tm and the sending offset time of each EPA node can be determined similarly to the above description in conjunction with FIG7B.
综合上述过程,可以总结确定EPA节点110的发送偏移时间的过程(步骤326)的更详细流程图,如图8中所示。In summary, a more detailed flowchart of the process of determining the transmission offset time of the EPA node 110 (step 326 ) can be summarized, as shown in FIG. 8 .
在图8的步骤3262中,对于EPA网络100中的第一个EPA节点110(如EPA节点110-1),将该第一个EPA节点110的发送偏移设置为0。In step 3262 of FIG. 8 , for the first EPA node 110 (eg, EPA node 110 - 1 ) in the EPA network 100 , the transmission offset of the first EPA node 110 is set to 0.
接下来,在步骤3264,对于EPA网络100中除了第一个EPA节点110之外的其他每个EPA节点110,可以至少基于该EPA节点110的前一EPA节点的节点间线路延时t1、节点转发延时t2以及EPA网络100的时钟同步误差t7确定该EPA节点110的传输整形时间Tm。Next, in step 3264, for each EPA node 110 in the EPA network 100 except the first EPA node 110, the transmission shaping time Tm of the EPA node 110 can be determined based at least on the inter-node line delay t1 of the previous EPA node of the EPA node 110, the node forwarding delay t2, and the clock synchronization error t7 of the EPA network 100.
在如上所述的第二传输模式下,各个EPA节点在完成转发上一条周期报文后,立即发送本节点的周期报文,因此为了避免相邻周期报文的干扰,传输整形时间Tm还可以包含帧间隔t5(例如上述结合表1所述的12B的帧间隔),参考上述公式(6)可知:In the second transmission mode described above, each EPA node immediately sends its own periodic message after completing forwarding the previous periodic message. Therefore, in order to avoid interference between adjacent periodic messages, the transmission shaping time Tm may also include a frame interval t5 (for example, the 12B frame interval described in Table 1). Referring to the above formula (6), it can be seen that:
Tm=t1+t2+t5+t7 (8)Tm=t1+t2+t5+t7 (8)
在如上所述的第一传输模式下,各个EPA节点在前一EPA节点的周期报文完成在整个EPA网络中的传输后才发送本节点的周期报文,因此传输整形时间Tm应当包括该节点的周期报文在整个网络中的传输延时减去其自身节点的转发延时,对于环形结构的EPA网络,参考上述公式(6)可知:In the first transmission mode described above, each EPA node sends its own periodic message only after the periodic message of the previous EPA node has completed transmission in the entire EPA network. Therefore, the transmission shaping time Tm should include the transmission delay of the periodic message of the node in the entire network minus the forwarding delay of its own node. For the ring-structured EPA network, referring to the above formula (6), it can be known that:
(9) (9)
其中,n为EPA网络100所包含的EPA节点110的数量,此时n=m。Wherein, n is the number of EPA nodes 110 included in the EPA network 100, and in this case n=m.
对于线型或星型结构的EPA网络,参考上述公式(2)可知:For a linear or star-shaped EPA network, referring to the above formula (2), we can know that:
(10) (10)
其中,n为线型结构的EPA网络100所包含的EPA节点110的数量,此时n=m,或者n为星型结构的EPA网络100的最长链路设备数量。Wherein, n is the number of EPA nodes 110 included in the linear EPA network 100, in which case n=m, or n is the number of the longest link devices in the star EPA network 100.
在步骤3266,可以基于该EPA节点110的传输整形时间Tm、前一EPA节点的报文占用时间t3和报文预留时间t6确定前一EPA节点占用的总时间t4。In step 3266, the total time t4 occupied by the previous EPA node can be determined based on the transmission shaping time Tm of the EPA node 110, the message occupation time t3 of the previous EPA node and the message reservation time t6.
在一些实施例中,例如对于如上结合图7A所描述的宽松模式中,前一EPA节点占用的总时间可以基于节点间线路延时、节点转发延时、EPA网络100包含的EPA节点110的数量以及前一EPA节点的报文占用时间来确定。In some embodiments, for example, in the loose mode described above in conjunction with Figure 7A, the total time occupied by the previous EPA node can be determined based on the line delay between nodes, the node forwarding delay, the number of EPA nodes 110 included in the EPA network 100, and the message occupancy time of the previous EPA node.
例如,在如上结合图7A所示的实例中,在环形拓扑的情况下,前一EPA节点110占用的总时间可以表示为:For example, in the example shown in FIG. 7A above, in the case of a ring topology, the total time occupied by the previous EPA node 110 can be expressed as:
(11) (11)
在线型或星型拓扑的情况下,前一EPA节点110占用的总时间可以表示为:In the case of a linear or star topology, the total time taken by the previous EPA node 110 can be expressed as:
(12) (12)
其中,在EPA网络100是线型结构的情况下,n为EPA网络100所包含的EPA节点110的数量,即n=m,在EPA网络100是星型结构的情况下,n为EPA网络100的最长链路设备数量。Among them, when the EPA network 100 is a linear structure, n is the number of EPA nodes 110 included in the EPA network 100, that is, n=m; when the EPA network 100 is a star structure, n is the number of the longest link devices in the EPA network 100.
本领域技术人员可以理解,在实际进行发送偏移时间计算时,也可以不考虑EPA网络100是何种拓扑结构都按照上述环形拓扑的情况进行配置,这是因为环形拓扑情况下计算的节点占用总时间足以保证发送偏移时间的大小不会使得周期报文发生冲突。Those skilled in the art will appreciate that, when actually calculating the sending offset time, it is possible to configure the EPA network 100 according to the above-mentioned ring topology regardless of the topology structure. This is because the total node occupancy time calculated in the ring topology is sufficient to ensure that the size of the sending offset time will not cause a conflict in periodic messages.
在另一些实施例中,例如对于如上结合图7B所描述的紧凑模式中,前一EPA节点占用的总时间可以通过对节点间线路延时、节点转发延时和当前EPA节点的前一EPA节点的报文占用时间进行求和来确定。In other embodiments, for example, in the compact mode described above in conjunction with Figure 7B, the total time occupied by the previous EPA node can be determined by summing the line delay between nodes, the node forwarding delay, and the message occupancy time of the previous EPA node of the current EPA node.
例如,在如上结合图7B所示的实例中,前一EPA节点110占用的总时间t4可以表示为:For example, in the example shown in FIG. 7B , the total time t4 occupied by the previous EPA node 110 can be expressed as:
t4=t1+t2+t3+t5+t6+t7 (13)t4=t1+t2+t3+t5+t6+t7 (13)
最后,在步骤3268,可以基于该EPA节点110的前一EPA节点110的发送偏移时间和前一EPA节点110的报文占用时间确定该EPA节点110的发送偏移时间。Finally, in step 3268, the sending offset time of the EPA node 110 can be determined based on the sending offset time of the previous EPA node 110 of the EPA node 110 and the message occupancy time of the previous EPA node 110.
例如,对于上述结合图7A至图7E分别描述的在宽松模式和紧凑模式下确定的前一EPA节点占用的总时间t4,可以分别将其与EPA节点的前一EPA节点的发送偏移求和以分别确定该EPA节点在两种传输模式下的发送偏移时间的最小值。For example, for the total time t4 occupied by the previous EPA node determined in the loose mode and the compact mode described above in combination with Figures 7A to 7E, it can be summed with the sending offset of the previous EPA node of the EPA node to determine the minimum value of the sending offset time of the EPA node in the two transmission modes.
在此基础上,控制设备20还可以通过设置不同的报文预留时间t6来对各个EPA节点110的发送偏移时间进行调整,从而可以根据用户需要设置不同的组态配置参数。On this basis, the control device 20 can also adjust the sending offset time of each EPA node 110 by setting different message reservation times t6, so that different configuration parameters can be set according to user needs.
图9示出了适合实现本公开的实施例的控制设备900的方框图。控制设备900可以用来实现如图1A至图1D中所示的控制设备20。Fig. 9 shows a block diagram of a control device 900 suitable for implementing an embodiment of the present disclosure. The control device 900 can be used to implement the control device 20 shown in Figs. 1A to 1D.
如图9中所示,控制设备900可以包括处理器910。处理器910控制控制设备900的操作和功能。例如,在某些实施例中,处理器910可以借助于与其耦合的存储器920中所存储的指令930来执行各种操作。存储器920可以是适用于本地技术环境的任何合适的类型,并且可以利用任何合适的数据存储技术来实现,包括但不限于基于半导体的存储器件、磁存储器件和系统、光存储器件和系统。尽管图9中仅仅示出了一个存储器920,但是本领域技术人员可以理解,控制设备900可以包括更多个物理上不同的存储器920。As shown in Figure 9, the control device 900 may include a processor 910. The processor 910 controls the operation and function of the control device 900. For example, in some embodiments, the processor 910 can perform various operations by means of instructions 930 stored in a memory 920 coupled thereto. The memory 920 can be any suitable type suitable for the local technical environment, and can be implemented using any suitable data storage technology, including but not limited to semiconductor-based memory devices, magnetic memory devices and systems, optical memory devices and systems. Although only one memory 920 is shown in Figure 9, it will be appreciated by those skilled in the art that the control device 900 may include more physically different memories 920.
处理器910可以是适用于本地技术环境的任何合适的类型,并且可以包括但不限于通用计算机、专用计算机、微处理器、数字信号处理器(DSP)以及基于处理器的多核处理器架构中的一个或多个多个。控制设备900也可以包括多个处理器910。处理器910与收发器940耦合,收发器940可以借助于一个或多个通信部件来实现信息的接收和发送。上文参考图1A至图8所描述的所有特征均适用于控制设备900,在此不再赘述。The processor 910 may be any suitable type suitable for the local technical environment, and may include, but is not limited to, one or more of a general-purpose computer, a special-purpose computer, a microprocessor, a digital signal processor (DSP), and a processor-based multi-core processor architecture. The control device 900 may also include multiple processors 910. The processor 910 is coupled to a transceiver 940, which may receive and send information with the aid of one or more communication components. All of the features described above with reference to FIG. 1A to FIG. 8 are applicable to the control device 900 and will not be repeated here.
利用本发明的方案,在EPA网络开始运行之前或者发生改变时,可以由与EPA网络相连的控制设备(也称为上位机)自动根据EPA网络的信息(如拓扑结构、节点数量、用户数据量等)为该EPA网络计算一组或多组组态配置参数,每组组态配置参数至少包含每个EPA节点的发送偏移时间,并且控制设备可以基于所确定的或者根据用户需求所选择的组态配置参数,通过该控制设备与EPA网络之间的以太网传输(例如以UDP报文)的形式,对该EPA网络进行组态配置,从而大大节省了进行EPA网络的组态配置所需的人力成本。By utilizing the solution of the present invention, before the EPA network starts to operate or when a change occurs, a control device (also referred to as a host computer) connected to the EPA network can automatically calculate one or more groups of configuration parameters for the EPA network based on information of the EPA network (such as topology, number of nodes, amount of user data, etc.), each group of configuration parameters at least including a sending offset time of each EPA node, and the control device can configure the EPA network based on the determined configuration parameters or the configuration parameters selected according to user needs through Ethernet transmission (for example, in the form of UDP packets) between the control device and the EPA network, thereby greatly saving the manpower cost required for configuring the EPA network.
本发明可以实现为方法、装置、系统和/或计算机程序产品。计算机程序产品可以包括计算机可读存储介质,其上载有用于执行本发明的各个方面的计算机可读程序指令。The present invention may be implemented as a method, an apparatus, a system and/or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present invention.
在一个或多个示例性设计中,可以用硬件、软件、固件或它们的任意组合来实现本发明所述的功能。例如,如果用软件来实现,则可以将所述功能作为一个或多个指令或代码存储在计算机可读介质上,或者作为计算机可读介质上的一个或多个指令或代码来传输。In one or more exemplary designs, the functions described in the present invention may be implemented using hardware, software, firmware, or any combination thereof. For example, if implemented using software, the functions may be stored as one or more instructions or codes on a computer-readable medium, or transmitted as one or more instructions or codes on a computer-readable medium.
本文公开的装置的各个单元可以使用分立硬件组件来实现,也可以集成地实现在一个硬件组件,如处理器上。例如,可以用通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或其它可编程逻辑器件、分立门或者晶体管逻辑、分立硬件组件或用于执行本文所述的功能的任意组合来实现或执行结合本发明所描述的各种示例性的逻辑块、模块和电路。The various units of the apparatus disclosed herein may be implemented using discrete hardware components or may be integrated on a hardware component, such as a processor. For example, the various exemplary logic blocks, modules, and circuits described in conjunction with the present invention may be implemented or executed using a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof for performing the functions described herein.
本领域普通技术人员还应当理解,结合本发明的实施例描述的各种示例性的逻辑块、模块、电路和算法步骤可以实现成电子硬件、计算机软件或二者的组合。Those skilled in the art should also understand that the various illustrative logical blocks, modules, circuits, and algorithm steps described in conjunction with the embodiments of the present invention may be implemented as electronic hardware, computer software, or a combination of the two.
本发明的以上描述用于使本领域的任何普通技术人员能够实现或使用本发明。对于本领域普通技术人员来说,本发明的各种修改都是显而易见的,并且本文定义的一般性原理也可以在不脱离本发明的精神和保护范围的情况下应用于其它变形。因此,本发明并不限于本文所述的实例和设计,而是与本文公开的原理和新颖性特性的最广范围相一致。The above description of the present invention is intended to enable any person of ordinary skill in the art to implement or use the present invention. Various modifications of the present invention are apparent to those of ordinary skill in the art, and the general principles defined herein may also be applied to other variations without departing from the spirit and scope of the present invention. Therefore, the present invention is not limited to the examples and designs described herein, but is consistent with the broadest range of principles and novel features disclosed herein.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311791277.6ACN117478501B (en) | 2023-12-25 | 2023-12-25 | Method, control device and storage medium for configuration of EPA network |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311791277.6ACN117478501B (en) | 2023-12-25 | 2023-12-25 | Method, control device and storage medium for configuration of EPA network |
| Publication Number | Publication Date |
|---|---|
| CN117478501A CN117478501A (en) | 2024-01-30 |
| CN117478501Btrue CN117478501B (en) | 2024-10-11 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202311791277.6AActiveCN117478501B (en) | 2023-12-25 | 2023-12-25 | Method, control device and storage medium for configuration of EPA network |
| Country | Link |
|---|---|
| CN (1) | CN117478501B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118713994B (en)* | 2024-08-30 | 2024-11-22 | 浙江国利信安科技有限公司 | Fully automatic configuration method, host computer, computer readable storage medium and computer program product for EPA system |
| CN118890307B (en)* | 2024-09-29 | 2025-01-21 | 浙江国利信安科技有限公司 | Method, computing device and storage medium for sending configuration data of a network |
| CN119052087A (en)* | 2024-11-04 | 2024-11-29 | 浙江国利信安科技有限公司 | Method, host computer, computer readable storage medium and computer program product for checking configuration parameters of EPA system |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106685735A (en)* | 2017-02-06 | 2017-05-17 | 浙江中控研究院有限公司 | EPA (ethemet for plant automation) on-chip system, EPA communication system and EPA communication method |
| CN113364638A (en)* | 2021-08-11 | 2021-09-07 | 浙江国利信安科技有限公司 | Method, electronic device and storage medium for EPA networking |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7720086B2 (en)* | 2007-03-19 | 2010-05-18 | Microsoft Corporation | Distributed overlay multi-channel media access control for wireless ad hoc networks |
| CN101534230B (en)* | 2009-04-15 | 2012-02-01 | 中控科技集团有限公司 | Method for sending data based on Ethernet, Ethernet node and control system |
| CN113347048B (en)* | 2021-07-28 | 2021-11-02 | 浙江国利信安科技有限公司 | Method, node device and storage medium for adaptively adjusting network configuration |
| CN113422724B (en)* | 2021-08-11 | 2021-11-19 | 浙江国利信安科技有限公司 | Method, device, communication system and storage medium for EPA configuration switching |
| CN116471647A (en)* | 2023-04-06 | 2023-07-21 | 北京理工大学 | A Method for Dynamically Adjusting Routing Cost Used in Large-Scale Ad Hoc Networks |
| CN116760659B (en)* | 2023-08-11 | 2023-11-14 | 浙江国利信安科技有限公司 | Programmable logic controller and its data communication method |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106685735A (en)* | 2017-02-06 | 2017-05-17 | 浙江中控研究院有限公司 | EPA (ethemet for plant automation) on-chip system, EPA communication system and EPA communication method |
| CN113364638A (en)* | 2021-08-11 | 2021-09-07 | 浙江国利信安科技有限公司 | Method, electronic device and storage medium for EPA networking |
| Publication number | Publication date |
|---|---|
| CN117478501A (en) | 2024-01-30 |
| Publication | Publication Date | Title |
|---|---|---|
| CN117478501B (en) | Method, control device and storage medium for configuration of EPA network | |
| CN107302786B (en) | A method and system for building a home intelligent network | |
| CN113364638B (en) | Method, electronic device and storage medium for EPA networking | |
| CN101997735A (en) | Monocylic network topology reconstruction method and system thereof | |
| JP2009512260A (en) | Subscriber apparatus, communication controller of communication system, and method for realizing gateway function in subscriber apparatus of communication system | |
| CN108028792A (en) | Industrial equipment communication system, communication means and industrial equipment | |
| CN115834508B (en) | A method for determining a message period and a related device thereof | |
| Saha et al. | Efficient many-to-many data sharing using synchronous transmission and tdma | |
| CN113315668B (en) | Method, node device and storage medium for adaptively adjusting network configuration | |
| CN112425101A (en) | Clock topology in Ethernet networks | |
| WO2023015644A1 (en) | Planning method and system architecture for scheduling of chained service flow | |
| CN114599018B (en) | A Bluetooth Mesh network routing method based on automatic channel scheduling | |
| CN105553795A (en) | Method for transmitting standard Ethernet data in industrial Ethernet | |
| CN113347048A (en) | Method, node device and storage medium for adaptively adjusting network configuration | |
| CN112187557B (en) | Method for measuring and reporting and network node | |
| CN116074242A (en) | Multipath joint scheduling method for TSCH network | |
| US11271772B2 (en) | Method for transmitting data and system comprising communicating entity | |
| WO2020150349A1 (en) | Device presence method and system for mesh network management | |
| US9276716B2 (en) | Sensor data transport and consolidation within communication nodes in a network | |
| JP7404185B2 (en) | Communication system, node, communication method and program | |
| CN110855540B (en) | 485 multi-master communication method and system based on single-ring network | |
| JP7382168B2 (en) | Unicast traffic synchronization | |
| CN116684024B (en) | FC-AE-1553 boundary clock port status configuration method and system | |
| KR20120051632A (en) | Method for clock synchronization in distributed system having ring topology and apparatus for the same | |
| US9450835B2 (en) | Method for turning off routers in a communications network and router implementing this method |
| 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 | ||
| EE01 | Entry into force of recordation of patent licensing contract | Application publication date:20240130 Assignee:Zhejiang Zhike Zhiyuan Technology Co.,Ltd. Assignor:ZHEJIANG GUOLI XIN'AN TECHNOLOGY Co.,Ltd. Contract record no.:X2024980042276 Denomination of invention:Methods, control devices, and storage media for configuring EPA networks Granted publication date:20241011 License type:Common License Record date:20241231 | |
| EE01 | Entry into force of recordation of patent licensing contract |