[go: up one dir, main page]

CN103647682B - A Simulation System for Simulating Switched Ethernet Clock Synchronization - Google Patents

A Simulation System for Simulating Switched Ethernet Clock Synchronization Download PDF

Info

Publication number
CN103647682B
CN103647682B CN201310664838.6A CN201310664838A CN103647682B CN 103647682 B CN103647682 B CN 103647682B CN 201310664838 A CN201310664838 A CN 201310664838A CN 103647682 B CN103647682 B CN 103647682B
Authority
CN
China
Prior art keywords
state
data
frame
node
module
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
CN201310664838.6A
Other languages
Chinese (zh)
Other versions
CN103647682A (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.)
Beihang University
Original Assignee
Beihang 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 Beihang University filed Critical Beihang University
Priority to CN201310664838.6A priority Critical patent/CN103647682B/en
Publication of CN103647682A publication Critical patent/CN103647682A/en
Application granted granted Critical
Publication of CN103647682B publication Critical patent/CN103647682B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Small-Scale Networks (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a kind of analogue system simulating the synchronization of switching Ethernet clock, this analogue system includes Ethernet protocol instruction database, intervalometer, node and link attribute configuration module, synchronizes Topology g eneration module, state management module, State Transferring module, data processing module, fault detect and processing module, clock correcting module and result output module.Ethernet protocol instruction database and intervalometer are to meet in IEEE802.3ISO/IEC8802 3 standard criterion and SAEAS6802 pointed instruction, state relation information.Carry out emulating role's configuration by node and link attribute configuration module and obtain synchronization topology;Then to each nodes for state Role Management in synchronization topology, and data process, clock correction and fault detect are carried out with different conditions role;Thus output state and clock correction result.Analogue system of the present invention, relative to existing analogue system, is set up aspect in network model and is shown higher extensibility, it is simple to Clock Synchronization Procedure is carried out significantly more efficient analysis.

Description

一种模拟交换式以太网时钟同步的仿真系统A Simulation System for Simulating Switched Ethernet Clock Synchronization

技术领域technical field

本发明涉及一种基于以太网的仿真系统,更特别地说,是指一种模拟交换式以太网建立与维持时钟同步的仿真系统。通过此系统,用户可以根据需求模拟交换式以太网在不同情况下时钟同步的过程。The present invention relates to a simulation system based on Ethernet, more particularly, refers to a simulation system for establishing and maintaining clock synchronization by simulating switched Ethernet. Through this system, users can simulate the clock synchronization process of switched Ethernet in different situations according to their needs.

背景技术Background technique

以太网(Ethernet)是一类满足一套标准规范的计算机局域网(技术)。所谓一套标准规范主要是指IEEE802.3ISO/IEC8802-3、IEEE802.12ISO/IEC8802-12或IEEE802.11ISO/IEC8802-11、HiperLAN2等一系列标准;所谓计算机系统是指该局部区域内许多计算机按这套协议规范连接起来的数据通信联络网络。参考《以太网技术与应用》王廷尧编著,2005年1月第1版,第4页至第7页。关于以太网的组成实例框图中,一个以太网中至少包括有服务器(Server)、交换机(Frame Switcher)、路由器(Router)和AP节点(Access PointEquipment)。Ethernet is a type of computer local area network (technology) that meets a set of standard specifications. The so-called set of standard specifications mainly refers to a series of standards such as IEEE802.3ISO/IEC8802-3, IEEE802.12ISO/IEC8802-12 or IEEE802.11ISO/IEC8802-11, HiperLAN2 and other standards; This set of protocols regulates connected data communication networks. Refer to "Ethernet Technology and Application" edited by Wang Tingyao, first edition in January 2005, pages 4 to 7. In the block diagram of the composition example of the Ethernet, an Ethernet includes at least a server (Server), a switch (Frame Switcher), a router (Router) and an AP node (Access PointEquipment).

交换式以太网是指采用了交换技术的以太网,连接节点就是交换机。参考《万兆位以太网及其实用技术》敖志刚编著,2007年7月第1次印刷,第82页。Switched Ethernet refers to Ethernet using switching technology, and the connecting nodes are switches. Refer to "10 Gigabit Ethernet and Its Practical Technology", edited by Ao Zhigang, first printing in July 2007, page 82.

航空电子系统作为一种任务和安全关键系统,需要具有完全确定性的时间保证。目前,国内外的先进的大型飞机均采用航空电子全双工交换式以太网(Avionics FullDuplex Switched Ethernet,AFDX)作为机载电子系统综合化互连的骨干,AFDX网络提出了时间确定性的机制,并引入了流量控制的机制,使通信任务的速率受到约束,被称为速率受限(Rate Constraint,RC)流量,然而,RC流量在经过多级复用和排队后,存在一定的时延和时延抖动。因此,一种时间触发的概念应运而生。时间触发以太网(Time TriggeredEthernet,TTE)在AFDX网络的基础上引入了透明时钟和时钟同步的概念,并采用了时间触发(Time Triggered,TT)流量来传输航空电子系统中的关键性消息。在TTE网络中,每个节点(所述节点可以是交换机、端系统)维持着自身的TT流量的时间调度表,所有行为都由固定的时间调度表驱动。由于时间触发系统中的各个节点根据它们的本地时钟来实现它们的行为,分布式节点间的时钟同步就显得尤为重要。As a mission- and safety-critical system, avionics systems require fully deterministic timing guarantees. At present, advanced large aircraft at home and abroad all use Avionics FullDuplex Switched Ethernet (AFDX) as the backbone of the integrated interconnection of airborne electronic systems. The AFDX network proposes a time-deterministic mechanism. And a flow control mechanism is introduced to constrain the rate of communication tasks, which is called rate-limited (Rate Constraint, RC) traffic. However, RC traffic has a certain delay and Latency jitter. Therefore, a time-triggered concept came into being. Time Triggered Ethernet (Time Triggered Ethernet, TTE) introduces the concept of transparent clock and clock synchronization based on the AFDX network, and uses Time Triggered (Time Triggered, TT) traffic to transmit key messages in the avionics system. In a TTE network, each node (the node may be a switch or an end system) maintains its own time schedule for TT traffic, and all behaviors are driven by the fixed time schedule. Since each node in a time-triggered system implements their actions according to their local clocks, clock synchronization among distributed nodes is particularly important.

为了更好地研究时钟同步以太网中TT流量的传输以及TT流量、RC流量等混合流量的传输,需要建立一个提供时间同步的网络作为上述流量传输的平台,因此,需要对时间同步的过程进行有效的模拟和仿真。目前有关时间触发以太网时钟同步机制的模拟仿真主要是由FPGA或者普通CPU实现的,这些仿真方法通常需要设计固定的模型与拓扑结构,节点的时延值与线上传输延迟时间由硬件本身决定,在实际传输过程中会出现一定的冲突或者丢包现象,只能建立受限于硬件水平的时钟同步,不能在短时间内对仿真过程进行随意的修改,灵活性较差。In order to better study the transmission of TT traffic and the transmission of mixed traffic such as TT traffic and RC traffic in clock-synchronized Ethernet, it is necessary to establish a network that provides time synchronization as a platform for the above traffic transmission. Therefore, it is necessary to carry out the process of time synchronization Effective simulation and emulation. At present, the simulation of the time-triggered Ethernet clock synchronization mechanism is mainly implemented by FPGA or ordinary CPU. These simulation methods usually need to design a fixed model and topology structure. The delay value of the node and the online transmission delay time are determined by the hardware itself. , in the actual transmission process, there will be certain conflicts or packet loss phenomena, only the clock synchronization limited by the hardware level can be established, and the simulation process cannot be modified arbitrarily in a short period of time, and the flexibility is poor.

发明内容Contents of the invention

本发明的目的是提出了一种模拟交换式以太网时钟同步的仿真系统,该仿真系统利用离散事件调度的方式实现了对交换式以太网时钟同步的仿真。在本发明仿真系统中,依据配置信息进行仿真角色模型配置,得到同步拓扑结构;然后对同步拓扑结构中的各个节点进行状态角色管理,并以不同状态角色进行数据处理、时钟修正以及故障检测;从而输出状态和时钟修正结果。本发明仿真系统相对于现有的仿真系统,在网络模型建立方面表现出更强的可扩展性,便于对时钟同步过程进行更加有效的分析。The object of the present invention is to propose a simulation system for simulating the clock synchronization of switched Ethernet. The simulation system realizes the simulation of clock synchronization of switched Ethernet by means of discrete event scheduling. In the simulation system of the present invention, the simulation role model configuration is performed according to the configuration information to obtain a synchronous topology; then state role management is performed on each node in the synchronous topology structure, and data processing, clock correction and fault detection are performed with different state roles; The status and clock correction results are thus output. Compared with the existing simulation system, the simulation system of the present invention shows stronger scalability in the aspect of network model establishment, and is convenient for more effective analysis on the clock synchronization process.

本发明是一种模拟交换式以太网时钟同步的仿真系统,该仿真系统包括以太网协议指令数据库、定时器、节点及链路属性配置模块(10)、同步拓扑生成模块(20)、状态管理模块(30)、状态转换模块(40)、数据处理模块(60)、故障检测与处理模块(70)、时钟修正模块(80)和结果输出模块(50)。The present invention is a simulation system for simulating switched Ethernet clock synchronization. The simulation system includes an Ethernet protocol command database, a timer, a node and link attribute configuration module (10), a synchronization topology generation module (20), and a state management module. module (30), state conversion module (40), data processing module (60), fault detection and processing module (70), clock correction module (80) and result output module (50).

节点及链路属性配置模块(10)依据实际以太网中的端系统、交换机以及端系统与交换机之间的物理连接,来配置所需的仿真用配置信息D10The node and link attribute configuration module (10) configures the required simulation configuration information D 10 according to the end system, the switch and the physical connection between the end system and the switch in the actual Ethernet.

同步拓扑生成模块(20)用于生成同步拓扑结构,并输出同步拓扑信息D20The synchronous topology generation module (20) is used to generate a synchronous topology structure and output synchronous topology information D 20 .

状态管理模块(30),用于对节点角色和节点状态的执行行为进行管理。A state management module (30), configured to manage the execution behavior of node roles and node states.

状态转换模块(40),用于对节点状态进行切换,所述节点状态分别为集成状态、异步状态、等待状态、FLOOD状态、使能状态和同步状态。A state conversion module (40), configured to switch the node states, the node states are integration state, asynchronous state, waiting state, FLOOD state, enabling state and synchronous state.

数据处理模块(60)根据当前节点状态来完成数据帧的生成、发送、接收、固化、压缩。并在进行数据处理的过程中作用于状态管理模块通知状态管理模块当前是否接收到数据帧和数据帧的类型信息;在数据固化或者压缩完成后作用于时钟修正模块,将固化或压缩好的数据帧传递给时钟修正模块;在数据处理过程中,作用于故障检测与处理模块,将数据帧的信息传递给故障检测与处理模块。由数据帧生成单元(601)、数据帧发送单元(602)、数据帧接收单元(603)、数据帧固化单元(604)、数据帧压缩单元(605)构成。The data processing module (60) completes the generation, transmission, reception, curing and compression of data frames according to the current node status. And in the process of data processing, it acts on the state management module to notify the state management module whether it currently receives the data frame and the type information of the data frame; after the data is solidified or compressed, it acts on the clock correction module, and the solidified or compressed data The frame is transmitted to the clock correction module; in the process of data processing, it acts on the fault detection and processing module, and transmits the information of the data frame to the fault detection and processing module. It is composed of a data frame generation unit (601), a data frame sending unit (602), a data frame receiving unit (603), a data frame curing unit (604), and a data frame compression unit (605).

故障检测与处理模块(70),用于对数据帧校验并进行错误处理;对结团的情况进行检测与处理;对仿真运行状况的检测处理。由数据帧校验错误处理单元(701)、同步结团检测与处理单元(702)、异步结团检测与处理单元(703)和软件异常处理单元(704)构成。The fault detection and processing module (70) is used for checking data frames and performing error processing; detecting and processing clumping; detecting and processing simulation operation status. It is composed of a data frame check error processing unit (701), a synchronous clumping detection and processing unit (702), an asynchronous clumping detection and processing unit (703) and a software exception processing unit (704).

时钟修正模块(80),用于修正节点角色的本地时钟。由数据帧选择单元(801)、时钟修正计算单元(802)和时钟修正执行单元(803)构成。A clock correction module (80), used for correcting the local clock of the node role. It is composed of a data frame selection unit (801), a clock correction calculation unit (802) and a clock correction execution unit (803).

结果输出模块(50),用于将当前状态信息的结果、时钟修正值大小和节点的当前本地时钟值以xml格式文件或者excel的格式文件输出。The result output module (50), configured to output the result of the current state information, the size of the clock correction value and the current local clock value of the node in an xml format file or an excel format file.

本发明模拟交换式以太网时钟同步的仿真系统的优点在于:The advantage of the simulation system of the present invention's simulated switched Ethernet clock synchronization is:

①本发明采用离散事件调度的方式模拟网络时钟同步的过程,不受硬件平台的限制,可以根据需要更改仿真模型的拓扑结构和规模,灵活方便,易于实施。① The present invention uses discrete event scheduling to simulate the process of network clock synchronization, and is not limited by the hardware platform. The topology and scale of the simulation model can be changed as needed, which is flexible, convenient, and easy to implement.

②本发明采用不受具体硬件限制的方式实现时钟同步的功能,在计算压缩修正值时,可以尽量多地取用固化队列中所收到的数据帧的固化时刻点,可以达到更加高的时钟同步精度。②The present invention realizes the function of clock synchronization in a way that is not limited by specific hardware. When calculating the compression correction value, it can use as many curing time points of the data frames received in the curing queue as possible to achieve a higher clock speed. synchronization accuracy.

③本发明按照用户需求设置仿真过程中的时间精度,可以为上层流量传输过程提供不同时钟粒度下的同步网络平台,与应用的时钟匹配,从而有效地保证了TT流量的时间确定性。③ The present invention sets the time accuracy in the simulation process according to user requirements, and can provide a synchronous network platform with different clock granularities for the upper-layer traffic transmission process, which matches the clock of the application, thereby effectively ensuring the time determinism of TT traffic.

④通过TTE网络时钟同步的仿真平台,可以实现对TTE网络时钟同步过程的优化设计,通过对同步拓扑的优化和时钟同步参数的配置,获得不同情况下时钟同步的情形,可以对其进行比较分析,从而修正配置,优化TTE网络时钟同步的性能。④Through the simulation platform of TTE network clock synchronization, the optimal design of the TTE network clock synchronization process can be realized. Through the optimization of the synchronization topology and the configuration of clock synchronization parameters, the situation of clock synchronization in different situations can be obtained, which can be compared and analyzed , so as to modify the configuration and optimize the performance of TTE network clock synchronization.

⑤通过TTE网络时钟同步仿真,可以对实际网络中难以获得的临界情况进行预测分析,获得TTE网络时钟同步的临界情况。⑤Through the TTE network clock synchronization simulation, the critical situation that is difficult to obtain in the actual network can be predicted and analyzed, and the critical situation of TTE network clock synchronization can be obtained.

⑥可以利用本发明设计的仿真系统进行基于what-if的假设,对于网络不同错误情况进行仿真,分析网络的容错性能。6. The simulation system designed by the present invention can be used to carry out assumptions based on what-if, simulate different error situations of the network, and analyze the fault-tolerant performance of the network.

⑦可以利用本发明设计的仿真系统来构建多种网络场景(即不同的同步拓扑结构),利用不同的参数配置,获得各情景下网络同步的收敛性和精度,便于对其进行比较。⑦The simulation system designed by the present invention can be used to construct various network scenarios (that is, different synchronization topology structures), and different parameter configurations can be used to obtain the convergence and accuracy of network synchronization in each scenario, which is convenient for comparison.

附图说明Description of drawings

图1是本发明仿真系统的结构框图。Fig. 1 is a structural block diagram of the simulation system of the present invention.

图2是本发明任意一同步拓扑结构图。Fig. 2 is a diagram of any synchronization topology in the present invention.

图3是本发明中数据处理模块的处理过程图。Fig. 3 is a process diagram of the data processing module in the present invention.

图3A是本发明中数据帧生成单元所生成的PCF格式示意图。Fig. 3A is a schematic diagram of the PCF format generated by the data frame generating unit in the present invention.

图3B是本发明中数据帧发送单元的流程图。Fig. 3B is a flowchart of the data frame sending unit in the present invention.

图3C是本发明中数据帧接收单元的流程图。Fig. 3C is a flowchart of the data frame receiving unit in the present invention.

图3D是本发明中数据帧固化单元的流程图。Fig. 3D is a flow chart of the data frame curing unit in the present invention.

图3E是本发明中对数据帧进行固化操作的具体方式。FIG. 3E is a specific way of curing the data frame in the present invention.

图3F是本发明中数据帧压缩单元的流程图。Fig. 3F is a flowchart of the data frame compression unit in the present invention.

图3G是本发明中计算压缩时刻点的时序图。FIG. 3G is a timing diagram of calculating the compression time point in the present invention.

图4是本发明中数据帧选择单元的流程图。Fig. 4 is a flowchart of the data frame selection unit in the present invention.

图5是本发明中状态转换模块根据状态管理模块传递的相应条件进行状态转换的流程图。Fig. 5 is a flow chart of the state transition module performing state transition according to the corresponding conditions delivered by the state management module in the present invention.

具体实施方式detailed description

下面将结合附图对本发明做进一步的详细说明。The present invention will be further described in detail below in conjunction with the accompanying drawings.

参见图1所示,本发明提供了一种模拟交换式以太网时钟同步过程的仿真系统,该仿真系统包括以太网协议指令数据库、定时器、节点及链路属性配置模块10、同步拓扑生成模块20、状态管理模块30、状态转换模块40、数据处理模块60、故障检测与处理模块70、时钟修正模块80和结果输出模块50。Referring to shown in Fig. 1, the present invention provides a kind of emulation system of analog switched Ethernet clock synchronization process, this emulation system comprises Ethernet protocol command database, timer, node and link attribute configuration module 10, synchronous topology generation module 20. A state management module 30 , a state conversion module 40 , a data processing module 60 , a fault detection and processing module 70 , a clock correction module 80 and a result output module 50 .

在本发明中,以太网协议指令数据库是依据IEEE802.3ISO/IEC8802-3标准规范和SAEAS6802(时间触发以太网)中所指出的指令、状态关联信息构建得到。所述以太网协议指令数据库中的不同指令、状态关联信息能够被各个模块(即节点及链路属性配置模块10、同步拓扑生成模块20、状态管理模块30、状态转换模块40、数据处理模块60、故障检测与处理模块70、时钟修正模块80)所调用。In the present invention, the Ethernet protocol instruction database is constructed according to the IEEE802.3ISO/IEC8802-3 standard specification and the instruction and state association information indicated in SAEAS6802 (time-triggered Ethernet). Different instructions in the Ethernet protocol instruction database, state association information can be used by each module (i.e. node and link attribute configuration module 10, synchronous topology generation module 20, state management module 30, state conversion module 40, data processing module 60 , fault detection and processing module 70, and clock correction module 80).

在本发明中,定时器是依据IEEE802.3ISO/IEC8802-3标准规范和SAEAS6802(时间触发以太网)中所指出的时间指令构建得到。为了便于对时钟同步过程进行更加有效的分析,通过定时器来定制时间关联信息以保证仿真过程中对时间信息的调用。In the present invention, the timer is constructed according to the IEEE802.3ISO/IEC8802-3 standard specification and the time instruction specified in SAEAS6802 (time-triggered Ethernet). In order to facilitate a more effective analysis of the clock synchronization process, the timer is used to customize the time-related information to ensure the call of the time information during the simulation process.

在本发明中,节点及链路属性配置模块10依据实际以太网中的端系统、交换机以及端系统与交换机之间的物理连接,来配置所需的仿真用配置信息D10In the present invention, the node and link attribute configuration module 10 configures the required simulation configuration information D 10 according to the end system, the switch and the physical connection between the end system and the switch in the actual Ethernet.

在本发明中,同步拓扑生成模块20用于生成同步拓扑结构,并输出同步拓扑信息D20In the present invention, the synchronous topology generation module 20 is used to generate a synchronous topology structure and output synchronous topology information D 20 .

在本发明中,同步拓扑生成模块20实现根据配置信息读取模块中读入的物理拓扑信息生成同步拓扑的功能,并初始化配置不同的节点角色,将所有的节点配置为同步控制器的角色;然后配置交换节点的角色,交换节点被配置为压缩控制器或者同步客户端,在同一信道上只配置一个压缩控制器,同一信道上的其它交换节点被配置为同步客户端。具体执行方式为从信道上的某一个节点设备开始对各个节点进行配置,将节点配置为同步控制器,并作为同步控制器获得节点的相应配置信息(端口速率、线上延迟、发送和接收延迟、端口内部处理时间和所模拟的设备的时钟漂移),之后继续遍历物理链路配置设备,当为交换节点时,且为信道上首个交换节点时,将其配置为压缩控制器,并作为压缩控制器获得作为交换节点时设备的相应配置信息(端口速率、线上延迟、发送和接收延迟、端口内部处理时间和所模拟的设备的时钟漂移),对于信道上其它的交换节点,将其配置为同步客户端,同样作为同步客户端获得作为交换节点时节点的相应配置信息(端口速率、线上延迟、发送和接收延迟、端口内部处理时间和所模拟的设备的时钟漂移)。In the present invention, the synchronous topology generation module 20 realizes the function of generating synchronous topology according to the physical topology information read in the configuration information reading module, and initializes and configures different node roles, and configures all nodes as synchronous controller roles; Then configure the role of the switching node. The switching node is configured as a compression controller or a synchronization client. Only one compression controller is configured on the same channel, and other switching nodes on the same channel are configured as synchronization clients. The specific execution method is to configure each node from a certain node device on the channel, configure the node as a synchronous controller, and obtain the corresponding configuration information (port rate, online delay, sending and receiving delay) of the node as a synchronous controller , the internal processing time of the port and the clock drift of the simulated device), and then continue to traverse the physical link to configure the device. When it is a switching node and the first switching node on the channel, configure it as a compression controller and as a The compression controller obtains the corresponding configuration information (port speed, line delay, sending and receiving delay, internal processing time of the port and the clock drift of the simulated device) when it is a switching node. For other switching nodes on the channel, it Configured as a synchronous client, also as a synchronous client to obtain the corresponding configuration information of the node as a switching node (port speed, online delay, sending and receiving delay, internal processing time of the port and clock drift of the simulated device).

在本发明中,状态管理模块30,用于对节点角色和节点状态的执行行为进行管理。In the present invention, the state management module 30 is used to manage the execution behavior of node roles and node states.

在本发明中,状态管理模块30在不同的状态下依据定时器生成由用户配置的该状态对应时长的定时器;作用于数据处理模块进行数据帧的处理;作用于时钟修正模块触发对节点本地时钟的修正;作用于故障检测与处理模块对仿真系统可能出现的故障进行检测与处理。In the present invention, the state management module 30 generates a timer corresponding to the state configured by the user according to the timer in different states; it acts on the data processing module to process data frames; it acts on the clock correction module to trigger the node local Clock correction; acting on the fault detection and processing module to detect and process possible faults in the simulation system.

在本发明中,状态转换模块40用于对节点状态进行切换,并将节点状态输出给结果输出模块50。In the present invention, the state conversion module 40 is used to switch the node state, and output the node state to the result output module 50 .

在本发明中,数据处理模块60根据当前节点状态来完成数据帧的生成、发送、接收、固化、压缩。由数据帧生成单元601、数据帧发送单元602、数据帧接收单元603、数据帧固化单元604、数据帧压缩单元605构成。In the present invention, the data processing module 60 completes the generation, transmission, reception, curing and compression of data frames according to the current node status. It is composed of a data frame generating unit 601 , a data frame sending unit 602 , a data frame receiving unit 603 , a data frame curing unit 604 and a data frame compressing unit 605 .

在本发明中,数据处理模块60根据状态管理模块相应状态下对其的作用实现数据帧的生成、发送、接收、固化、压缩操作;并在进行数据处理的过程中作用于状态管理模块通知状态管理模块当前是否接收到数据帧和数据帧的类型信息;在数据固化或者压缩完成后作用于时钟修正模块,将固化或压缩好的数据帧传递给时钟修正模块;在数据处理过程中,作用于故障检测与处理模块,将数据帧的信息传递给故障检测与处理模块。In the present invention, the data processing module 60 realizes the generation, transmission, reception, solidification, and compression operations of the data frame according to the effect on it under the corresponding state of the state management module; and acts on the state management module to notify the state during the data processing process Whether the management module currently receives the data frame and the type information of the data frame; after the data is solidified or compressed, it acts on the clock correction module, and passes the solidified or compressed data frame to the clock correction module; during the data processing process, it acts on the clock correction module The fault detection and processing module transmits the information of the data frame to the fault detection and processing module.

在本发明中,故障检测与处理模块70,用于对数据帧校验并进行错误处理;对结团的情况进行检测与处理;对仿真运行状况的检测处理。由数据帧校验错误处理单元701、同步结团检测与处理单元702、异步结团检测与处理单元703和软件异常处理单元704构成。In the present invention, the fault detection and processing module 70 is used for checking data frames and performing error processing; detecting and processing agglomeration; detecting and processing simulated operating conditions. It is composed of a data frame check error processing unit 701 , a synchronous clumping detection and processing unit 702 , an asynchronous clumping detection and processing unit 703 and a software exception processing unit 704 .

在本发明中,时钟修正模块80,用于修正节点角色的本地时钟。由数据帧选择单元801、时钟修正计算单元802和时钟修正执行单元803构成。In the present invention, the clock correction module 80 is used to correct the local clock of the node role. It consists of a data frame selection unit 801 , a clock correction calculation unit 802 and a clock correction execution unit 803 .

在本发明中,结果输出模块50,用于将当前节点状态、时钟修正值大小和修正后的本地时钟以xml格式文件或者excel的格式文件输出。In the present invention, the result output module 50 is configured to output the current node status, the clock correction value and the corrected local clock in an xml format file or an excel format file.

本发明设计的仿真系统通过节点及链路属性配置模块10和结果输出模块50与用户实现交互。The simulation system designed by the present invention realizes interaction with the user through the node and link attribute configuration module 10 and the result output module 50 .

以太网协议指令数据库Ethernet protocol command database

为了使设计的本发明仿真系统满足IEEE802.3ISO/IEC8802-3标准规范,同时也能满足航空电子系统使用者的需要,采用了SAE(Society of Automotive Engineers)美国机动车工程师学会制订的SAEAS6802(时间触发以太网)中所指出的指令、状态等信息,这些信息构建了本发明仿真系统的以太网协议指令数据库。In order to make the designed simulation system of the present invention meet IEEE802.3ISO/IEC8802-3 standard specifications, and also meet the needs of avionics system users, the SAEAS6802 (time Instructions, status and other information pointed out in Trigger Ethernet), these information construct the Ethernet protocol instruction database of the simulation system of the present invention.

在本发明中,节点状态门限值包括有同步控制器SMB从集成状态至同步状态的门限值压缩控制器CMB从集成状态至同步状态的门限值同步客户端SCB从集成状态至同步状态的门限值同步控制器SMB从异步状态至同步状态的门限值压缩控制器CMB从异步状态至同步状态的门限值同步控制器SMB从同步状态至异步状态的门限值压缩控制器CMB从同步状态至异步状态的门限值同步控制器SMB维持同步状态的门限值压缩控制器CMB维持同步状态的门限值同步客户端SCB维持同步状态的门限值采用集合形式表达为 A 0 User = ITS SM B A , ITS CM B A , ITS SC B A , ATS S M B A , ATS CM B A , STA SM B A , STA CM B A , STS SM B A , STS CM B A , STS SC B A . In the present invention, the node state threshold Including the threshold value of the synchronous controller SM B from the integrated state to the synchronous state Threshold value of compression controller CM B from integrated state to synchronous state Threshold for synchronizing client SC B from integrated state to synchronous state Threshold value of synchronous controller SM B from asynchronous state to synchronous state Threshold value of compression controller CM B from asynchronous state to synchronous state Threshold value of synchronous controller SM B from synchronous state to asynchronous state Threshold value of compression controller CM B from synchronous state to asynchronous state Synchronous controller SM B maintains the threshold value of the synchronous state Threshold value of compression controller CM B to maintain synchronization state Threshold value for synchronization client SC B to maintain synchronization state Expressed in aggregate form as A 0 User = ITS SM B A , ITS CM B A , ITS SC B A , ATS S m B A , ATS CM B A , STA SM B A , STA CM B A , STS SM B A , STS CM B A , STS SC B A .

在本发明中,节点角色BUser包括有同步控制器SMB、压缩控制器CMB、同步客户端SCB;采用集合形式表达为BUser={SMB,CMB,SCB}。In the present invention, the node role B User includes a synchronization controller SM B , a compression controller CMB , and a synchronization client SC B ; it is expressed as B User ={SM B , CM B , SC B } in a set form.

在本发明中,数据帧传输角色MBUser包括有源节点的同步控制器SSMB、源节点的压缩控制器SCMB、目的节点的同步控制器DSMB、目的节点的压缩控制器DCMB、目的节点的同步客户端DSCB、中间节点的同步客户端MSCB;采用集合形式表达为MBUser={SSMB,SCMB,DSMB,DCMB,DSCB,MSCB}。In the present invention, the data frame transmission role MB User includes the synchronization controller SSM B of the source node, the compression controller SCM B of the source node, the synchronization controller DSM B of the destination node, the compression controller DCM B of the destination node, the destination node The synchronous client DSC B of the node and the synchronous client MSC B of the intermediate node are expressed as MB User = {SSM B , SCM B , DSM B , DCM B , DSC B , MSC B } in a set form.

在本发明中,节点物理延迟时间包括有派发延迟时间TDC、发送延迟时间TSC、线上传输延迟时间TWC、接收延迟时间TRC;采用集合形式表达为 C 0 User = { TD C , TS C , TW C , TR C } . In the present invention, the node physical delay time Including distribution delay time TD C , sending delay time TS C , online transmission delay time TW C , receiving delay time TR C ; expressed in aggregate form as C 0 User = { TD C , TS C , TW C , TR C } .

在本发明中,节点状态VUser包括有集成状态异步状态数据信息接收过程状态等待状态使能状态同步状态采用集合形式表达为 V User = { Z IN User , Z AS User , Z FL User , Z WT User , Z EA User , Z SY User } . In the present invention, node status V User includes integrated status asynchronous state Data information receiving process status waiting state enable state sync status Expressed in aggregate form as V User = { Z IN User , Z AS User , Z FL User , Z WT User , Z EA User , Z Sy User } .

定时器timer

在本发明中,为了保证仿真系统在时间上的同步,应用定时器进行时间定制来管理状态的运行。In the present invention, in order to ensure the time synchronization of the simulation system, the timer is used to customize the time to manage the operation of the state.

节点及链路属性配置模块10Node and link attribute configuration module 10

参见图1所示,在本发明中,节点及链路属性配置模块10第一方面调用以太网协议指令数据库中的来配置连接信息 Referring to shown in Fig. 1, in the present invention, node and link attribute configuration module 10 first aspect transfers in the Ethernet protocol instruction database to configure connection information

在本发明中,依据实际以太网中的端系统、交换机以及端系统与交换机之间的物理连接,来配置符合本发明仿真系统所需的配置连接信息即参见图2所示的拓扑以太网结构示意图。In the present invention, according to the end system in the actual Ethernet, the switch and the physical connection between the end system and the switch, configure the configuration connection information required by the simulation system of the present invention That is, refer to the schematic diagram of the topology Ethernet structure shown in FIG. 2 .

节点及链路属性配置模块10第二方面调用以太网协议指令数据库中的TDC,TSC,TWC,TRC,进行初始赋值,得到赋值后的仿真配置信息 P 10 User , D 10 User , D max - 10 User , f 10 User , TD 10 C , TS 10 C , TW 10 C , TR 10 C , E 10 User , G 10 User ; 采用集合形式表达为 D ass 10 = { P 10 User , D 10 User , D max - 10 User , f 10 User , TD 10 C , TS 10 C , TW 10 C , TR 10 C , E 10 User , G 10 User } ; The second aspect of node and link attribute configuration module 10 calls in the Ethernet protocol instruction database TD C ,TS C ,TW C ,TR C , Perform initial assignment to obtain the simulation configuration information after assignment P 10 User , D. 10 User , D. max - 10 User , f 10 User , TD 10 C , TS 10 C , TW 10 C , TR 10 C , E. 10 User , G 10 User ; Expressed in aggregate form as D. ass 10 = { P 10 User , D. 10 User , D. max - 10 User , f 10 User , TD 10 C , TS 10 C , TW 10 C , TR 10 C , E. 10 User , G 10 User } ;

在本发明中,节点及链路属性配置模块10输出给同步拓扑生成模块20的信息记为仿真用配置信息D10,采用集合形式表达为 In the present invention, the information output by the node and link attribute configuration module 10 to the synchronous topology generation module 20 is denoted as configuration information D 10 for simulation, expressed as

同步拓扑生成模块20Synchronous topology generation module 20

参见图1所示,在本发明中,同步拓扑生成模块20第一方面用于接收 D 10 = { D link 10 , D ass 10 } ; Referring to Fig. 1, in the present invention, the first aspect of synchronous topology generation module 20 is used to receive D. 10 = { D. link 10 , D. ass 10 } ;

同步拓扑生成模块20第二方面调用以太网协议指令数据库中的节点角色BUser按照同步化方式进行节点角色配置得到同步拓扑结构,如图2所示;In the second aspect, the synchronous topology generation module 20 calls the node role B User and Configure node roles in a synchronized manner A synchronous topology is obtained, as shown in Figure 2;

所述的同步化方式是指将仿真所需的端系统、交换机进行同步角色配置,即将端系统配置为同步控制器的角色,交换机配置为压缩控制器或者同步客户端;然后依据节点角色配置结合以太网结构,生成虚拟链路 The synchronization method refers to the synchronization role configuration of the end system and the switch required for the simulation, that is, the end system is configured as the role of the synchronization controller, and the switch is configured as the compression controller or the synchronization client; and then configured according to the node role Combined with the Ethernet structure, a virtual link is generated

在本发明中,若同一信道上存在有多个交换机,则在同一信道上将其中一个交换机配置为压缩控制器,同一信道上的其余交换机被配置为同步客户端。In the present invention, if there are multiple switches on the same channel, one of the switches on the same channel is configured as a compression controller, and the rest of the switches on the same channel are configured as synchronization clients.

参见图2所示,在本发明中的仿真系统的拓扑结构图中,第一同步控制器记为211、第二同步控制器记为212、第三同步控制器记为213、第四同步控制器记为214、第五同步控制器记为215、第六同步控制器记为216、第一同步客户端记为221、第二同步客户端记为222、压缩控制器记为231。Referring to shown in Figure 2, in the topological structure diagram of the simulation system in the present invention, the first synchronous controller is marked as 211, the second synchronous controller is marked as 212, the third synchronous controller is marked as 213, and the fourth synchronous controller 214, the fifth synchronization controller 215, the sixth synchronization controller 216, the first synchronization client 221, the second synchronization client 222, and the compression controller 231.

若以同步控制器(211~216)作为源节点、同步客户端(221、222)作为中间节点、压缩控制器(231)作为目的节点进行信息(协议控制帧)传输。所述的同步-压缩的协议控制帧中至少有透明时钟 If the synchronization controller (211-216) is used as the source node, the synchronization client (221, 222) is used as the intermediate node, and the compression controller (231) is used as the destination node, the information (protocol control frame) is transmitted. Said sync-compressed protocol control frame has at least transparent clock

若以压缩控制器(231)作为源节点、同步客户端(221、222)作为中间节点、同步控制器(211~216)作为目的节点进行信息传输。所述的压缩-同步的协议控制帧中至少有透明时钟 If the compression controller (231) is used as the source node, the synchronization clients (221, 222) are used as the intermediate nodes, and the synchronization controllers (211-216) are used as the destination nodes for information transmission. The compressed-synchronized protocol control frame has at least a transparent clock

同步拓扑生成模块20第三方面调用以太网协议指令数据库中的节点状态门限值结合得到各个节点的赋值后的状态门限值 The third aspect of synchronous topology generation module 20 calls the node state threshold value in the Ethernet protocol instruction database combine Get the state threshold value of each node after assignment

同步拓扑生成模块20第四方面依据 D ass 10 = { P 10 User , D 10 User , D max - 10 User , f 10 User , TD 10 C , TS 10 C , TW 10 C , TR 10 C , E 10 User , G 10 User } 中的并结合压缩控制器的计算时延生成定时时长TO和开窗大小Wb;所述的 Synchronization topology generation module 20 is based on the fourth aspect D. ass 10 = { P 10 User , D. 10 User , D. max - 10 User , f 10 User , TD 10 C , TS 10 C , TW 10 C , TR 10 C , E. 10 User , G 10 User } middle combined with the computational delay of the compression controller Generate timing duration TO and window size W b ;

在本发明中,定时时长TO包括有定时器中记载的所有定时名称,采用集合形式表达为TO={TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ}。In the present invention, the timing duration TO includes all the timing names recorded in the timer, and is expressed as TO={T A , T B , T C , T D , T E , T F , T G , T H , T I , T J }.

在本发明中,同步拓扑生成模块20输出的同步拓扑信息记为D20,采用集合形式表达为 D 20 = { D VL 20 , D queue 20 , D state 20 , TO , W b } . In the present invention, the synchronous topology information output by the synchronous topology generation module 20 is denoted as D 20 , expressed as D. 20 = { D. VL 20 , D. queue 20 , D. state 20 , TO , W b } .

在本发明中,依据节点及链路属性配置模块10的配置信息使得同步拓扑生成模块20生成同步拓扑结构,对于同步拓扑结构中各节点的启动时间和物理参数按照读取的配置信息进行赋值,所述物理参数包括端口速率、所连接信道的线上延迟、发送和接收延迟、端口内部处理时间和所模拟的节点的时钟漂移,同时还为每个节点初始化了一定数目的数据队列,以便于后续操作,节点中维持的数据队列包括数据发送队列、数据接收队列、VL接收队列、数据固化队列、数据压缩队列(对于配置为压缩控制器的节点)、数据收集队列。在初始化过程中,队列为空,留置后续过程中再对各个队列进行具体操作,队列选取先入先出的模型,队列中的每个元素包括封装的数据帧、进入队列当前时间值、数据队列所属的节点类型及名称。对于每一条包含多个同步控制器的信道,需要生产2倍个VL(Virtual Link,虚拟链路)。In the present invention, according to the configuration information of the node and link attribute configuration module 10, the synchronous topology generation module 20 generates a synchronous topology structure, and the startup time and physical parameters of each node in the synchronous topology structure are assigned according to the read configuration information, The physical parameters include the port rate, the online delay of the connected channel, the sending and receiving delay, the internal processing time of the port, and the clock drift of the simulated node. At the same time, a certain number of data queues are initialized for each node to facilitate Subsequent operations, the data queues maintained in the nodes include data sending queues, data receiving queues, VL receiving queues, data curing queues, data compression queues (for nodes configured as compression controllers), and data collection queues. During the initialization process, the queue is empty, and it will be left in the subsequent process to perform specific operations on each queue. The queue adopts a first-in-first-out model. Each element in the queue includes the encapsulated data frame, the current time value of entering the queue, and the data queue belongs to. The type and name of the node. For each channel containing multiple synchronous controllers, it is necessary to produce twice as many VLs (Virtual Link, virtual link).

状态管理模块30State Management Module 30

参见图1、图3、图3A~图3G所示,状态管理模块30在不同的状态下作用于定时器;状态管理模块30依据节点角色(同步拓扑生成模块20产生)和节点状态(状态转换模块40产生)作用于数据处理模块60进行数据帧的处理;作用于时钟修正模块80触发对节点本地时钟的修正;作用于故障检测与处理模块70对仿真系统可能出现的故障进行检测与处理。Referring to Fig. 1, Fig. 3, Fig. 3A ~ Fig. 3G, the state management module 30 acts on the timer in different states; the state management module 30 is based on the node role (generated by the synchronous topology generation module 20) and the node state (state transition module 40) acts on the data processing module 60 to process data frames; acts on the clock correction module 80 to trigger the correction of the local clock of the node; acts on the fault detection and processing module 70 to detect and process possible faults in the simulation system.

在本发明中,状态管理模块30对状态的管理为:In the present invention, the management of state by state management module 30 is:

第一方面,依据同步拓扑生成模块20的D20、状态转换模块40、数据处理模块60、故障检测与处理模块70和时钟修正模块80中的信息,综合分析,生成与状态转换模块40的节点状态相匹配的执行行为。In the first aspect, according to the information in the D 20 of the synchronous topology generation module 20, the state transition module 40, the data processing module 60, the fault detection and processing module 70 and the clock correction module 80, comprehensively analyze and generate the nodes of the state transition module 40 The state matches the execution behavior.

第二方面,将由第一方面得到的执行行为传递给所述相匹配的执行行为是指,当状态转换模块40传递的节点状态为集成状态时:同步控制器SMB在集成状态的执行行为压缩控制器CMB在集成状态的执行行为同步客户端SCB在集成状态的执行行为 In the second aspect, transferring the execution behavior obtained by the first aspect to the matching execution behavior refers to that when the node state transferred by the state transition module 40 is the integrated state: the execution behavior of the synchronization controller SM B in the integrated state Execution Behavior of Compression Controller CM B in Integrated State Execution behavior of synchronization client SC B in integrated state

当状态转换模块40传递的节点状态为同步状态时:同步控制器SMB在同步状态的执行行为压缩控制器CMB在同步状态的执行行为同步客户端SCB在同步状态的执行行为 When the node state delivered by the state transition module 40 is a synchronous state: the execution behavior of the synchronous controller SM B in the synchronous state Execution Behavior of Compression Controller CM B in Synchronous State Execution behavior of sync client SC B in sync state

当状态转换模块40传递的节点状态为异步状态时:同步控制器SMB在异步状态的执行行为压缩控制器CMB在异步状态的执行行为 When the node state delivered by the state conversion module 40 is an asynchronous state: the execution behavior of the synchronous controller SM B in the asynchronous state Execution Behavior of Compression Controller CM B in Asynchronous State

当状态转换模块40传递的节点状态为等待状态时:同步控制器SMB在等待状态的执行行为压缩控制器CMB在等待状态的执行行为 When the node state transferred by the state transition module 40 is the waiting state: the execution behavior of the synchronization controller SM B in the waiting state Execution Behavior of Compression Controller CM B in Waiting State

当状态转换模块40传递的节点状态为FLOOD状态时:同步控制器SMB在FLOOD状态的执行行为当状态转换模块40传递的节点状态为使能状态时:压缩控制器CMB在使能状态的执行行为采用集合形式表达为 D ACT 30 = ACT SM B IN , ACT CM B IN , ACT SC B IN , ACT SM B SY , ACT CM B SY , ACT SC B SY , ACT SM B AS , ACT CM B AS , ACT SM B WT , ACT CM B WT , ACT SM B FL , ACT CM B EA . When the node state delivered by the state transition module 40 is the FLOOD state: the execution behavior of the synchronization controller SM B in the FLOOD state When the node state transferred by the state transition module 40 is the enabled state: the execution behavior of the compression controller CM B in the enabled state Expressed in aggregate form as D. ACT 30 = ACT SM B IN , ACT CM B IN , ACT SC B IN , ACT SM B Sy , ACT CM B Sy , ACT SC B Sy , ACT SM B AS , ACT CM B AS , ACT SM B WT , ACT CM B WT , ACT SM B FL , ACT CM B EA .

具体的,根据节点角色配置的不同,依次介绍集合中的每一个元素的具体内容。Specifically, according to the different node role configurations, the sets are introduced in turn The specific content of each element in .

首先,对于角色配置为同步控制器的节点:First, for a node whose role is configured as a sync controller:

(A)所述同步控制器SMB在集成状态的执行行为是指:在A定时TA内,状态管理模块30对数据处理模块60传递的数据固化队列Qperm中的元素进行判断,判断其中是否有数据元素,如果有则进一步判断收到的数据帧FR的类型:如果为CA帧,则触发状态转换模块40将节点状态转换为等待状态,并触发同步结团检测与处理单元702将Msync置为1。如果为IN帧,则继续判断同步成员变量是否达到状态门限值若达到,则触发状态转换模块50将节点状态转换为同步状态,并开始触发数据处理模块60对上述IN帧进行记录并利用数据处理模块60执行对IN帧的处理;若未达到,则触发状态转换模块50将节点状态转换为等待状态。如果A定时TA结束后,数据固化队列Qperm仍为空,则触发状态转换模块40将节点状态转换为非同步状态,将定时时长设置为TB,触发数据处理模块60中的数据帧生成单元601,开始生成CS帧,之后按照数据处理模块60中的各个单元顺序进行操作,发起握手过程。(A) The execution behavior of the synchronization controller SM B in the integrated state Means: in the timing TA of A , the state management module 30 judges the elements in the data curing queue Q perm delivered by the data processing module 60, judges whether there are data elements therein, and if so, further judges the received data frame FR type: if it is a CA frame, trigger the state transition module 40 to transition the node state to a waiting state, and trigger the synchronous cluster detection and processing unit 702 to set M sync to 1. If it is an IN frame, continue to judge whether the synchronization member variable reaches the state threshold If reached, the trigger state conversion module 50 converts the node state into a synchronous state, and starts to trigger the data processing module 60 to record the above-mentioned IN frame and utilize the data processing module 60 to perform processing on the IN frame; if not reached, the trigger state The transition module 50 transitions the node state into a waiting state. If after A timing TA ends, the data curing queue Q perm is still empty, then the trigger state transition module 40 converts the node state to an asynchronous state, sets the timing duration to TB, and triggers the data frame generation in the data processing module 60 Unit 601 starts to generate a CS frame, and then operates in sequence according to each unit in the data processing module 60, and initiates a handshake process.

(B)所述同步控制器SMB在异步状态的执行行为是指:在B定时TB内,对数据处理模块60传递的数据固化队列Qperm中的元素进行判断,判断其中是否有数据元素,如果有则进一步判断收到的数据帧类型:如果为CS(ColdStart Frame)帧,则触发状态转换模块40将节点状态转换为FLOOD状态;如果为CA帧,则触发状态转换模块40将节点状态转换为等待状态,并触发同步结团检测与处理单元702将Msync置为1;如果为IN帧,则继续判断同步成员变量是否达到如果节点同步成员变量达到则触发状态转换模块40将节点状态转换为同步状态,并开始触发数据处理模块60对其进行记录并在数据处理模块60执行对IN帧的处理;若未达到,则触发状态转换模块40将节点状态转换为等待状态。如果B定时TB结束后,节点的数据固化队列Qperm仍为空,则触发状态转换模块40将节点状态转换为非同步状态,此时,触发数据处理模块60中的数据帧生成单元601,开始生成CS帧,之后按照数据处理模块60中的各个单元顺序进行操作,发起握手过程。(B) The execution behavior of the synchronous controller SM B in the asynchronous state Refer to: in B timing TB, judge the element in the data curing queue Q perm that data processing module 60 transmits, judge whether there is data element wherein, if have then further judge the data frame type that receives: if be CS (ColdStart Frame) frame, then the trigger state conversion module 40 is converted to the FLOOD state by the node state; M sync is set to 1; if it is an IN frame, continue to judge whether the synchronization member variable has reached If the node synchronization member variable reaches Then the trigger state transition module 40 converts the node state into a synchronous state, and starts to trigger the data processing module 60 to record it and execute the processing to the IN frame in the data processing module 60; if not reached, then the trigger state transition module 40 converts the node state The state transitions to a wait state. If after B timing TB ends, the data curing queue Q perm of the node is still empty, then the trigger state conversion module 40 converts the node state to an asynchronous state, at this time, triggers the data frame generation unit 601 in the data processing module 60, Start to generate the CS frame, and then operate according to the order of each unit in the data processing module 60, and initiate a handshake process.

(C)所述同步控制器SMB在FLOOD状态的执行行为是指:状态管理模块30根据节点当前的变量配置信息设定定时时长。(C) The execution behavior of the synchronization controller SM B in the FLOOD state It means that the state management module 30 sets the timing duration according to the current variable configuration information of the node.

所述变量配置信息包括flood_recv和closed_window(这两个值是bool型变量,初始化时设为0)。The variable configuration information includes flood_recv and closed_window (these two values are bool variables, which are set to 0 when initialized).

在C定时TC内,对数据处理模块60传递的数据固化队列Qperm中加入的元素进行判断,判断其中是否有数据元素,如果有,则进一步判断收到的PCF帧类型:如果为CS帧,则触发状态转换模块40将节点状态再次置为FLOOD状态;In the timing T C of C, judge the elements added in the data curing queue Q perm delivered by the data processing module 60, judge whether there are data elements in it, and if there is, then further judge the received PCF frame type: if it is a CS frame , then the trigger state transition module 40 sets the node state to the FLOOD state again;

如果为CA帧,且在flood_recv值为1,closed_window值为0的配置情况下,则触发状态转换模块40将节点状态转换为等待状态。If it is a CA frame, and in the case of a configuration in which the value of flood_recv is 1 and the value of closed_window is 0, the state transition module 40 is triggered to transform the node state into a waiting state.

在C定时TC结束后,节点的数据固化队列Qperm仍为空,则判断flood_recv值与closed_window值,如果都为0时,则触发状态转换模块40将节点状态再次置为FLOOD状态,并触发数据处理模块60发送CA帧,同时,将flood_recv赋值为1;After C timing T C ends, the data curing queue Q perm of the node is still empty, then judge the flood_recv value and closed_window value, if both are 0, then trigger the state transition module 40 and set the node state to the FLOOD state again, and trigger The data processing module 60 sends the CA frame, and at the same time, assigns flood_recv to 1;

如果flood_recv值为1,closed_window值为0时,则在I定时TI内,继续对数据处理模块60传递的数据固化队列Qperm中的元素进行判断,判断其中是否有数据元素,如果没有,则触发状态转换模块40将节点状态再次置为FLOOD状态,不进行状态转换;If the flood_recv value is 1, and the closed_window value is 0, then within I timing T1, continue to judge the elements in the data curing queue Q perm delivered by the data processing module 60, judge whether there is a data element in it, if not, then The trigger state transition module 40 is set to the FLOOD state again with the node state, and does not carry out state transition;

如果flood_recv值与closed_window值都为1时,则在J定时TJ内,继续对数据处理模块60传递的数据固化队列Qperm中的元素进行判断,判断其中是否有数据元素,如果没有,则触发状态转换模块40将节点状态转换为非同步状态,将flood_recv值与closed_window值赋为0。If both the flood_recv value and the closed_window value are 1, then within J timing T J , continue to judge the elements in the data curing queue Q perm delivered by the data processing module 60, and judge whether there is a data element in it, if not, then trigger The state conversion module 40 converts the node state into an asynchronous state, and assigns the flood_recv value and closed_window value to 0.

(D)所述同步控制器SMB在等待状态的执行行为是指:在E定时TE内,对数据处理模块60传递的数据固化队列Qperm中的元素进行判断,判断其中是否有数据元素,如果有,则进一步判断收到的数据帧类型:如果为CS帧,则触发状态转换模块40将节点状态转换为FLOOD状态;如果为CA帧,则触发状态转换模块40将节点状态继续停留在等待状态,并触发同步结团检测与处理单元702将Msync置为1;如果数据接收队列Qrecv为空,并且节点的本地成员值达到状态门限值则触发状态转换模块40将节点状态转换为同步状态,同时触发数据处理模块60中的数据帧生成单元601,开始生成IN帧(帧内新成员=节点的本地成员值),以发起同步过程;如果节点的本地成员值没有达到状态门限值则则触发状态转换模块40将节点状态转换为异步状态。(D) The execution behavior of the synchronization controller SM B in the waiting state Refer to: in E timing TE, judge the element in the data solidification queue Q perm that data processing module 60 transmits, judge whether there is data element wherein, if have, then further judge the data frame type that receives: if be If it is a CS frame, the trigger state transition module 40 will convert the node state to the FLOOD state; if it is a CA frame, then the trigger state transition module 40 will continue to stay in the waiting state with the node state, and trigger the synchronous clumping detection and processing unit 702 to M sync Set to 1; if the data receiving queue Q recv is empty, and the local member value of the node reaches the state threshold Then the trigger state conversion module 40 converts the node state into a synchronous state, and simultaneously triggers the data frame generation unit 601 in the data processing module 60 to start generating IN frames (new members in the frame=local member value of the node) to initiate the synchronization process; If the node's local membership value does not reach the state threshold Then the state conversion module 40 is triggered to convert the node state into an asynchronous state.

(E)所述同步控制器SMB在同步状态的执行行为是指:在这一状态下,冷启动握手已成功,各个节点的时钟差保持在所设置的时钟精度的范围内。状态管理模块30在每个集成周期的起点触发数据处理模块60生成IN帧,并对其进行发送、接收、固化等操作;触发时钟修正模块80在接收到固化好的IN帧后进行时钟修正;触发故障检测与处理模块70对运行过程进行监视,利用故障检测与处理模块70中的同步结团检测与处理单元702和异步结团检测与处理单元703对同步过程中是否出现结团的情况进行检测,并做出处理。在同步状态,数据处理模块60将传递的数据固化队列Qperm中加入的元素反馈给状态管理模块30进行判断,如果是IN帧,则继续保持在同步状态,继续后续操作;如果是CA帧,则预示着当前出现了不同步的状况,触发状态转换模块40将节点状态转换为等待状态,开始等待重新发起同步过程。故障检测与处理模块70将检测出的问题汇报给状态管理模块40,当同步结团检测与处理单元702或异步结团检测与处理单元703检测出结团的情况时,将出现的情况汇报给状态管理模块30,状态管理模块30触发状态转换模块40将节点状态转换为异步状态。所述结团情况是指SAEAS6802(时间触发以太网)中规定的。(E) The execution behavior of the synchronization controller SM B in the synchronization state It means: in this state, the cold start handshake has been successful, and the clock difference of each node is kept within the range of the set clock accuracy. The state management module 30 triggers the data processing module 60 at the starting point of each integration cycle to generate an IN frame, and performs operations such as sending, receiving, and curing it; the trigger clock correction module 80 performs clock correction after receiving the solidified IN frame; Trigger the fault detection and processing module 70 to monitor the running process, utilize the synchronous clumping detection and processing unit 702 and the asynchronous clumping detection and processing unit 703 in the fault detection and processing module 70 to check whether there is clumping in the synchronous process Detect and deal with it. In the synchronous state, the data processing module 60 feeds back the elements added in the data solidification queue Q perm delivered to the state management module 30 for judgment, if it is an IN frame, then continue to remain in the synchronous state, and continue subsequent operations; if it is a CA frame, It indicates that there is currently an out-of-sync situation, and the trigger state transition module 40 switches the node state into a waiting state, and starts to wait for re-initiation of the synchronization process. Fault detection and processing module 70 reports the detected problem to state management module 40, when synchronous clumping detection and processing unit 702 or asynchronous clumping detection and processing unit 703 detects the situation of clumping, the situation that occurs will be reported to The state management module 30, the state management module 30 triggers the state transition module 40 to transform the node state into an asynchronous state. The clustering situation mentioned is specified in SAEAS6802 (Time-Triggered Ethernet).

对于配置为压缩控制器的节点:根据状态转换模块40传递的不同的状态信息进行讨论。For a node configured as a compression controller: discuss according to different state information transmitted by the state transition module 40 .

(A)所述压缩控制器CMB在集成状态的执行行为是指:在D定时TD内,对数据处理模块60传递的数据固化队列Qperm中的元素进行判断,判断其中是否有数据元素,如果有则进一步判断收到的数据帧类型:如果为CS或者CA帧,则视为不该出现的情况,直接对数据帧进行丢弃;如果为IN帧,则继续判断同步成员变量是否达到状态门限值若同步成员变量达到状态门限值则触发状态转换模块40将节点状态转换为同步状态,并开始触发数据处理模块60对其进行记录并利用数据处理模块60和时钟修正模块80进行相应操作;若未达到,则对数据帧进行丢弃。如果D定时TD结束后,节点的数据固化队列Qperm仍为空,则进入触发状态转换模块40将节点状态转换为异步状态。(A) Execution behavior of the compression controller CM B in the integrated state Refer to: in D timing T D , judge the elements in the data curing queue Q perm delivered by data processing module 60, judge whether there are data elements in it, if there is, then further judge the received data frame type: if it is CS Or CA frame, it is regarded as the situation that should not occur, and the data frame is directly discarded; if it is an IN frame, continue to judge whether the synchronization member variable reaches the state threshold If the synchronization member variable reaches the state threshold Then the trigger state transition module 40 converts the node state into a synchronous state, and starts to trigger the data processing module 60 to record it and utilize the data processing module 60 and the clock correction module 80 to perform corresponding operations; if not reached, the data frame is discarded . If the data solidification queue Q perm of the node is still empty after the D timing T D ends, the trigger state conversion module 40 is entered to convert the node state to an asynchronous state.

(B)所述压缩控制器CMB在异步状态的执行行为是指:对数据处理模块60传递的节点的数据固化队列Qperm中的元素进行判断,判断其中是否有数据元素,如果有则进一步判断收到的数据帧类型:如果为CS帧,或者为CA帧并且接收到的CA帧的成员值信息大于状态门限值则触发状态转换模块40将节点状态转换为使能状态,并且触发数据处理模块60利用数据帧生成单元601生成CS或者CA帧,并按照数据处理模块60中的步骤将数据帧生成并发送出去。如果为IN帧,并且IN帧的新成员的值大于状态门限值则触发状态转换模块40将节点状态转换为同步状态,并触发数据处理模块60后续处理。如果数据固化队列Qperm一直为空,则节点一直停留在异步状态。(B) The execution behavior of the compression controller CM B in the asynchronous state Refers to: judge the elements in the data solidification queue Q perm of the node delivered by the data processing module 60, judge whether there are data elements in it, and if there is, then further judge the received data frame type: if it is a CS frame, or it is a CA frame and the member value information of the received CA frame is greater than the status threshold Then the trigger state transition module 40 converts the node state to the enable state, and the trigger data processing module 60 uses the data frame generating unit 601 to generate a CS or CA frame, and generates and sends the data frame according to the steps in the data processing module 60 . If it is an IN frame, and the value of the new member of the IN frame is greater than the status threshold Then the state conversion module 40 is triggered to convert the node state into a synchronous state, and the data processing module 60 is triggered for subsequent processing. If the data curing queue Q perm is always empty, the node stays in the asynchronous state.

所述的数据处理模块60中的步骤包括:由于所生成的数据帧与接收到的数据帧格式基本一致,因此,在生成新的数据帧时,采取对接收到的PCF内部结构进行更改的方法,修改该帧的透明时钟域为0,并在数据处理过程中添加新的VL(将其源地址和目的地址互换)信息,按照数据处理模块60中的后续步骤将其发送回相应目的节点。The steps in the described data processing module 60 include: because the generated data frame is basically consistent with the received data frame format, therefore, when generating a new data frame, take the method of changing the received PCF internal structure , modify the transparent clock field of the frame to be 0, and add new VL (swapping its source address and destination address) information during data processing, and send it back to the corresponding destination node according to the subsequent steps in the data processing module 60 .

(C)所述压缩控制器CMB在使能状态的执行行为是指:在F定时TF内,对数据处理模块60传递的数据固化队列Qperm中的元素进行判断,判断其中是否有数据元素,如果有则进一步判断收到的数据帧类型:如果为CS或者IN帧,则视为错误的情况,直接对数据帧进行丢弃,不予操作;如果接收到CA帧,则将对此CA帧进行转发操作,触发数据处理模块60生成CA帧,并按照数据处理模块60中的步骤将数据帧发送出去。在此状态下,每收到一个CA帧,就执行转发行为,由于所生成的数据帧与接收到的数据帧格式基本一致,因此,在生成新的数据帧时,采取对接收到的PCF内容进行更改的方法,修改该帧的透明时钟域,并在数据处理过程中添加新的VL(将其源端地址和目的端地址互换),按照数据处理模块60中的后续步骤将其发送回相应目的节点,在此种情况(即接收到数据帧的情况)下,节点继续停留在当前状态,不进行状态转换。如果在F定时TF结束后,节点数据接收队列Qrecv仍为空,即未收到新的数据,则触发状态转换模块40将节点状态转换为等待状态。(C) Execution behavior of the compression controller CM B in the enabled state Refer to: in the timing TF of F , judge the elements in the data curing queue Q perm delivered by the data processing module 60, judge whether there are data elements in it, if there is, then further judge the received data frame type: if it is CS Or IN frame, then regard as the situation of error, directly discard data frame, do not operate; If receive CA frame, then will carry out forwarding operation to this CA frame, trigger data processing module 60 to generate CA frame, and according to data The steps in processing module 60 transmit the data frame. In this state, each time a CA frame is received, the forwarding behavior is performed. Since the format of the generated data frame is basically the same as that of the received data frame, when generating a new data frame, the received PCF content is taken The method for making changes is to modify the transparent clock domain of the frame, and add a new VL (exchange its source end address and destination end address) during data processing, and send it back according to the subsequent steps in the data processing module 60 For the corresponding destination node, in this case (that is, the case of receiving a data frame), the node continues to stay in the current state and does not perform state transition. If the node data receiving queue Q recv is still empty after the F timing TF ends, that is, no new data is received, the trigger state transition module 40 will switch the node state to a waiting state.

(D)所述压缩控制器CMB在等待状态的执行行为是指:在G定时TG内,对数据处理模块60传递的数据固化队列Qperm中的元素进行判断,判断其中是否有数据元素,如果有则进一步判断收到的数据帧类型:如果为CS或者CA帧,则视为错误的情况,直接对数据帧进行丢弃,不予操作;如果为IN帧,并且IN帧的新成员的值状态门限值则触发状态转换模块40将节点状态转换为同步状态,并触发数据处理模块60和时钟修正模块80对所接收到的数据帧进行操作。如果G定时TG结束后,节点的数据固化队列Qperm中一直为空,即未收到新的数据,则触发状态转换模块40将节点状态转换为异步状态。(D) The execution behavior of the compression controller CM B in the wait state Refer to: in G timing T G , judge the elements in the data curing queue Q perm delivered by the data processing module 60, judge whether there are data elements in it, if there is, then further judge the received data frame type: if it is CS Or a CA frame, it is regarded as an error, and the data frame is discarded directly, and no operation is performed; if it is an IN frame, and the value status threshold of the new member of the IN frame Then the trigger state conversion module 40 converts the node state into a synchronous state, and triggers the data processing module 60 and the clock correction module 80 to operate on the received data frame. If the data solidification queue Q perm of the node is always empty after the G timer T G ends, that is, no new data is received, the trigger state conversion module 40 will convert the node state to an asynchronous state.

(E)所述压缩控制器CMB在同步状态的执行行为是指:当处于这一状态时,说明冷启动握手成功,各个节点的时钟差保持在所设置的时钟精度的范围内。状态管理模块30根据数据处理模块60所反馈的数据帧进行相应操作:如果接收到固化后的CS或者CA帧,则视为错误的情况,直接对数据帧进行丢弃,不予操作;如果接收到固化后的IN帧,则触发数据处理模块60中的数据帧压缩单元605,对IN帧进行收集,压缩等操作,并利用时钟修正模块80进行时钟修正,利用故障检测与处理模块70中的同步结团检测与处理单元702和异步结团检测与处理单元703对同步过程中是否出现结团的情况进行检测,并做出处理。故障检测与处理模块70将检测出的问题汇报给状态管理模块30,当同步结团检测与处理单元702或异步结团检测与处理单元703检测出结团的情况时,将出现的情况汇报给状态管理模块30,状态管理模块30触发状态转换模块40将当前状态转换为集成状态,从而重新等待开始握手同步的过程;如果没有检测出结团的情况,则继续保持在同步状态,同时还按照数据处理模块60中处理数据时的相应情况更新节点的本地配置信息。(E) The execution behavior of the compression controller CM B in the synchronous state It means: when in this state, it means that the cold start handshake is successful, and the clock difference of each node is kept within the range of the set clock accuracy. State management module 30 carries out corresponding operation according to the data frame fed back by data processing module 60: if receive the CS or CA frame after solidification, then regard as the situation of error, directly discard data frame, do not operate; The cured IN frame then triggers the data frame compression unit 605 in the data processing module 60 to collect and compress the IN frame, and utilizes the clock correction module 80 to perform clock correction, utilizes the synchronization in the fault detection and processing module 70 The clumping detection and processing unit 702 and the asynchronous clumping detection and processing unit 703 detect whether clumping occurs during the synchronization process, and make processing. Fault detection and processing module 70 reports the detected problem to state management module 30, when synchronous clumping detection and processing unit 702 or asynchronous clumping detection and processing unit 703 detects the situation of clumping, the situation that occurs will be reported to State management module 30, state management module 30 triggers state transition module 40 to convert current state into integrated state, thus waits again to start the process of handshake synchronization; The local configuration information of the node is updated correspondingly when data is processed in the data processing module 60 .

对于配置为同步客户端的节点:根据状态转换模块40传递的不同的状态信息进行讨论。For a node configured as a synchronous client: discuss according to different state information delivered by the state transition module 40 .

(A)所述同步客户端SCB在集成状态的执行行为是指:首先对数据处理模块60传递的数据固化队列Qperm中的元素进行判断,判断其中是否有数据元素,如果有则进一步判断收到的数据帧类型:如果是IN帧,则进一步判断其同步成员变量是否达到状态门限值如果是,则触发状态转换模块40将节点状态转换为同步状态,并且触发数据处理模块60,按照数据处理模块60中收到IN帧时的方法对其进行处理,并且对节点的本地信息进行一定的更新;如果不是,即未能达到状态门限值则说明还没有能够达到同步的状态,继续触发数据处理模块60,执行相应的数据转发操作。如果接收到的PCF类型为CS或者CA帧,也继续触发数据处理模块60,执行相应的数据转发操作。(A) The execution behavior of the synchronization client SC B in the integrated state Refer to: first judge the elements in the data curing queue Q perm delivered by the data processing module 60, judge whether there are data elements in it, if there is, then further judge the received data frame type: if it is an IN frame, then further judge its Whether the synchronization member variable reaches the state threshold If yes, then the trigger state conversion module 40 will convert the node state into a synchronous state, and trigger the data processing module 60, process it according to the method when receiving the IN frame in the data processing module 60, and perform certain local information on the node update; if not, the state threshold has not been reached It means that the state of synchronization has not yet been reached, and the data processing module 60 is continuously triggered to perform corresponding data forwarding operations. If the received PCF type is a CS or CA frame, the data processing module 60 is also continuously triggered to perform corresponding data forwarding operations.

(B)所述同步客户端SCB在同步状态的执行行为是指:状态管理模块30触发数据处理模块60、时钟修正模块80等对接收到的IN帧进行处理,并对节点当前的本地时钟进行修正,同时,触发故障检测与处理模块70对是否出现结团情况进行检测,如果出现,则触发状态转换模块40将节点状态转换为集成状态;否则,仍然保持在同步状态。同时,对节点的当前配置信息进行相应的修改。(B) The execution behavior of the synchronization client SC B in the synchronization state Refers to: the state management module 30 triggers the data processing module 60, the clock correction module 80, etc. to process the received IN frame, and corrects the current local clock of the node. If it occurs, the state transition module 40 is triggered to convert the node state to an integrated state; otherwise, it remains in the synchronous state. At the same time, the current configuration information of the node is modified accordingly.

状态转换模块40State Transition Module 40

参见图5所示,状态转换模块40在建立同步的过程中一共经历6个节点状态,所述节点状态分别为集成状态异步状态等待状态FLOOD状态使能状态(图5中未示出)和同步状态前五个状态均为非同步的状态。当在上述状态下,状态转换模块40即开始发挥作用,完成状态转换,并等待下一次触发状态转换的指令。图中所示的有关判断条件的信息均由状态管理模块30传递给状态转换模块40。As shown in FIG. 5, the state transition module 40 experiences a total of 6 node states during the synchronization establishment process, and the node states are respectively integration states asynchronous state waiting state FLOOD state enable state (not shown in Figure 5) and the synchronous state The first five states are all asynchronous states. When in the above state, the state transition module 40 starts to function, completes the state transition, and waits for the next command to trigger the state transition. The information about the judgment conditions shown in the figure is transmitted from the state management module 30 to the state transition module 40 .

参见图5所示,在本发明中,同步控制器SMB在节点启动后,首先进入集成状态,判断A定时TA内是否收到数据帧,如果收到,则继续判断其类型;如果没有收到则进入异步状态。如果收到的数据帧类型为IN帧,则继续判断节点的本地成员值是否达到状态门限值如果不是IN帧,则判断是否为CA帧。对于上述收到的PCF是IN帧的情况,如果节点的本地成员值达到状态门限值则进入同步状态;如果不是,则进入等待状态。对于上述收到的数据帧不是IN帧的情况,如果收到的PCF是CA帧,则进入等待状态;如果不是,则进入非同步状态。Referring to shown in Fig. 5, in the present invention, synchronous controller SM B enters integrated state at first after node startup, judges whether A receives data frame in timing TA, if receive, then continue to judge its type; If not When received, it enters the asynchronous state. If the received data frame type is an IN frame, continue to judge whether the local member value of the node reaches the state threshold If it is not an IN frame, then judge whether it is a CA frame. For the above case where the received PCF is an IN frame, if the local member value of the node reaches the status threshold Then enter the synchronous state; if not, enter the waiting state. For the above-mentioned situation that the received data frame is not an IN frame, if the received PCF is a CA frame, it enters a waiting state; if not, it enters an asynchronous state.

对于在异步状态的状态转换:同样判断是否在B定时TB收到数据帧,如果收到,则进一步判断收到的数据帧类型;如果没有收到,则仍停留在异步状态。如果为CA帧,则进入等待状态;如果不是,则进一步判断是否为CS帧。如果是CS帧,则进入FLOOD状态;如果不是,即为IN帧,则进入同步状态。For the state transition in the asynchronous state: it is also judged whether the data frame is received at the timing TB of B , and if it is received, the type of the data frame received is further judged; if it is not received, it is still in the asynchronous state. If it is a CA frame, it enters a waiting state; if not, it further judges whether it is a CS frame. If it is a CS frame, enter the FLOOD state; if not, it is an IN frame, then enter the synchronization state.

对于等待状态的状态转换:同样判断是否E在定时TE内收到数据帧,如果收到,则仍停留在等待状态,如果不是,则判断节点的本地成员值是否达到状态门限值如果节点本地成员值达到状态门限值则进入同步状态;如果没有达到状态门限值则进入异步状态。For the state transition of the waiting state: it is also judged whether E receives the data frame within the timing TE, if it is received, it still stays in the waiting state, if not, then judges whether the local member value of the node reaches the state threshold If the node's local membership value reaches the status threshold Then enter the synchronization state; if the state threshold is not reached Then enter the asynchronous state.

对于在FLOOD状态的状态转换:同样判断是否在在状态管理模块30中的定时时长内收到PCF,如果收到,则继续判断接收到的PCF的类型;如果没有收到,则判断是否满足配置信息条件(有关flood_recv和closed_window值的配置)。对于上述规定时间内收到PCF的情况,继续判断接收到的PCF是否为CS帧;如果是,则继续保持在FLOOD状态;如果不是,则判断是否为CA帧。如果是CA帧,则进入等待状态;如果不是,则判断是否满足配置信息条件(有关flood_recv和closed_window值的配置)。对于上述没有在状态管理模块30中的定时时长内接收到PCF的情况,如果满足配置信息条件,则进入异步状态,如果不满足,则仍停留在FLOOD状态。所述定时时长和配置信息条件依据状态管理模块30中FLOOD状态下中而定。For the state transition in the FLOOD state: judge whether to receive PCF equally in the timing duration in state management module 30, if receive, then continue to judge the type of the PCF that receives; If not received, then judge whether to satisfy configuration Info conditions (configuration about flood_recv and closed_window values). For the situation of receiving the PCF within the above specified time, continue to judge whether the received PCF is a CS frame; if yes, continue to maintain the FLOOD state; if not, then judge whether it is a CA frame. If it is a CA frame, it enters the waiting state; if not, it judges whether the configuration information condition is satisfied (the configuration of the flood_recv and closed_window values). For the above-mentioned situation that PCF is not received within the timing duration in the state management module 30, if the configuration information condition is satisfied, it will enter the asynchronous state; if not, it will still stay in the FLOOD state. The timing duration and configuration information condition are based on the FLOOD state in the state management module 30 depends on.

对于在同步状态的状态转换:对是否检测出结团情况和数据接收队列Qrecv是否收到CA帧进行判断,如果检测出现了结团的情况,则进入非同步状态;如果没有,则继续保持在同步状态。如果接收到CA帧,则进入等待状态;如果没有,则保持在同步状态。所述结团情况是指SAEAS6802(时间触发以太网)中规定的。For the state transition in the synchronous state: judge whether to detect whether the agglomeration situation and the data receiving queue Q recv receive the CA frame, if the detection has the agglomeration situation, then enter the asynchronous state; if not, then continue to remain in sync status. If a CA frame is received, it enters a waiting state; if not, it remains in a synchronous state. The clustering situation mentioned is specified in SAEAS6802 (Time-Triggered Ethernet).

在本发明中,压缩控制器CMB在节点启动后,首先进入集成状态,判断在状态管理模块30中的定时时长D定时TD内是否收到新成员的大小达到状态门限值的IN帧,如果是,则进入同步状态;否则,进入非同步状态。In the present invention, after the node is started, the compression controller CM B first enters the integration state, and judges whether the size of the new member received in the state management module 30 reaches the state threshold value in the time duration D and time T D The IN frame, if yes, enters the synchronous state; otherwise, enters the asynchronous state.

对于在异步状态的状态转换:首先判断是否收到CS帧或者新成员的值大于状态门限值的CA帧,如果是,则进入使能状态;如果不是,则继续判断是否收到新成员的大小达到状态门限值的IN帧。如果收到新成员的大小达到状态门限值的IN帧,则进入同步状态;如果没有收到,则仍停留在异步状态。For a state transition in an asynchronous state: first determine whether a CS frame is received or the value of the new member is greater than the state threshold CA frame, if it is, enter the enable state; if not, continue to judge whether the size of the received new member reaches the state threshold IN frame. If the size of the new member received reaches the status threshold If the IN frame is not received, it will enter the synchronous state; if it is not received, it will still stay in the asynchronous state.

对于在使能状态的状态转换:判断F定时TF内是否收到数据帧,如果是,则仍停留在使能状态;如果不是,则进入等待状态。For the state transition in the enabling state: judge whether the data frame is received within the timing TF of F , if yes, then stay in the enabling state; if not, then enter the waiting state.

对于在等待状态的状态转换:判断G定时TG内是否收到新成员的大小达到状态门限值的IN帧,如果是,则进入同步状态;如果不是,则进入非同步状态。For the state transition in the waiting state: judge whether the size of the new member received within G timing T G reaches the state threshold The IN frame, if it is, enters the synchronous state; if not, then enters the asynchronous state.

对于在同步状态的状态转换:对是否出现结团状况进行检测,如果出现结团状况,则进入集成状态;如果没有,则仍停留在同步状态。For the state transition in the synchronous state: check whether there is a clumping situation, if there is a clumping situation, enter the integrated state; if not, then stay in the synchronous state.

在本发明中,同步客户端SCB在节点启动后,首先进入集成状态,判断是否收到新成员的大小达到状态门限值的IN帧,如果是,即转换进入同步状态;否则,仍停留在集成状态。In the present invention, the synchronization client SC B first enters the integrated state after the node starts, and judges whether the size of the received new member reaches the state threshold IN frame, if it is, the conversion enters the synchronous state; otherwise, it remains in the integrated state.

对于在同步状态的状态转换:对是否出现结团状况进行检测,如果出现结团状况,则进入集成状态;如果没有,则仍停留在同步状态。For the state transition in the synchronous state: check whether there is a clumping situation, if there is a clumping situation, enter the integrated state; if not, then stay in the synchronous state.

数据处理模块60Data processing module 60

参见图3所示,数据处理模块60主要包括数据帧生成单元601、数据帧发送单元602、数据帧接收单元603、数据帧固化单元604和数据帧压缩单元605。Referring to FIG. 3 , the data processing module 60 mainly includes a data frame generating unit 601 , a data frame sending unit 602 , a data frame receiving unit 603 , a data frame curing unit 604 and a data frame compressing unit 605 .

数据处理模块60在接收到数据帧后,根据节点状态 V User = { Z IN User , Z AS User , Z FL User , Z WT User , Z EA User , Z SY User } 中的任意一状态以及调用以太网协议指令数据库中的数据帧传输角色MBUser={SSMB,SCMB,DSMB,DCMB,DSCB,MSCB}任意一节点角色进行数据帧的处理,实现数据帧的生成、发送、接收、固化、压缩。After data processing module 60 receives data frame, according to node state V User = { Z IN User , Z AS User , Z FL User , Z WT User , Z EA User , Z Sy User } Any one of the states and call the data frame transmission role MB User in the Ethernet protocol instruction database = {SSM B , SCM B , DSM B , DCM B , DSC B , MSC B } any node role to process the data frame, Realize the generation, transmission, reception, curing and compression of data frames.

数据处理模块60依据节点角色配置来构建数据处理队列所述包括有数据发送队列Qsend、数据接收队列Qrecv、VL接收队列QVLrecv、数据固化队列Qperm、数据压缩队列Qcomp、数据收集队列Qcoll;采用集合形式表达为 D queue 20 = { Q send , Q recv , Q VLrecv , Q perm , Q comp , Q coll } . The data processing module 60 is configured according to the node role To build a data processing queue said Including data sending queue Q send , data receiving queue Q recv , VL receiving queue Q VLrecv , data curing queue Q perm , data compression queue Q comp , and data collection queue Q coll ; it is expressed as D. queue 20 = { Q send , Q recv , Q VLrecv , Q perm , Q comp , Q coll } .

在本发明中,所述的数据压缩队列Qcomp仅在压缩控制器中使用。In the present invention, the data compression queue Q comp is only used in the compression controller.

数据帧生成单元601Data frame generating unit 601

数据帧生成单元601第一方面依据数据帧传输角色MBUser={SSMB,SCMB,DSMB,DCMB,DSCB,MSCB}中的SSMB,SCMB来动态生成协议控制帧FR;In the first aspect, the data frame generation unit 601 dynamically generates the protocol control frame FR according to the SSM B and SCM B in the data frame transmission role MB User ={SSM B , SCM B , DSM B , DCM B , DSC B , MSC B };

所述的协议控制帧FR中包含有源节点地址、目的节点地址、和其传输所要经历的VL(Virtual Link,虚拟链路)信息 The protocol control frame FR contains the address of the source node, the address of the destination node, and the VL (Virtual Link, virtual link) information to be experienced by its transmission

所述FR的类型满足节点状态 V User = { Z IN User , Z AS User , Z FL User , Z WT User , Z EA User , Z SY User } 中的不同状态的规定。The type of the FR satisfies the node state V User = { Z IN User , Z AS User , Z FL User , Z WT User , Z EA User , Z Sy User } The provisions of the different states in .

参见图3A所示,第二方面依据状态信息及状态行为信息动态地生成协议控制帧PCF。其中,所生成的PCF分为冷启动(CS,ColdStart)帧、冷启动确认(CA,ColdStartAcknowledge)帧和集成(IN,Integrate)帧三种类型。Referring to FIG. 3A , the second aspect dynamically generates a protocol control frame PCF according to state information and state behavior information. The generated PCF is divided into three types: cold start (CS, ColdStart) frame, cold start confirmation (CA, ColdStartAcknowledge) frame and integration (IN, Integrate) frame.

所述的PCF是具有最小载荷(46bytes)的标准以太网帧,其以太网类型为0x891d。在数据帧生成单元601,首先生成28bytes的适用于时钟同步的PCF,保留18bytes以后分配。PCF的结构图如图3A所示;The PCF is a standard Ethernet frame with a minimum payload (46 bytes), and its Ethernet type is 0x891d. In the data frame generating unit 601, first generate 28 bytes of PCF suitable for clock synchronization, and reserve 18 bytes for distribution later. The structure diagram of PCF is shown in Fig. 3A;

具体的,在PCF的帧结构中,Specifically, in the PCF frame structure,

集成周期Ipcf=节点i的集成周期值 Integration period I pcf = integration period value for node i

新成员是一个32bit的变量,xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx;所生成的PCF的新成员值Spcf=发送节点的本地成员值这个新加下标应该有变化 The new member is a 32bit variable, xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx; the new member value of the generated PCF S pcf = the local member value of the sending node This new subscript should change

所模拟的交换式以太网中能够承载的最大的同步控制器个数为32个,初始化时,被配置为同步控制器的节点的本地成员值与自身同步控制器的序号相同,以第3个同步控制器的初始成员值为例,初始时,这个节点的本地成员值为0000 0000 0000 0000 00000000 0000 0100,因此,首次发送的PCF中的新成员=0000 0000 0000 0000 0000 00000000 0100;The maximum number of synchronous controllers that can be carried in the simulated switched Ethernet is 32. At initialization, the local member value of the node configured as a synchronous controller is the same as the serial number of its own synchronous controller. The third Take the initial member value of the synchronization controller as an example. Initially, the local member value of this node is 0000 0000 0000 0000 00000000 0000 0100. Therefore, the new member in the PCF sent for the first time = 0000 0000 0000 0000 0000 00000000 0100;

同步优先级=发送节点所处的同步优先级;Synchronization priority = the synchronization priority of the sending node;

同步域=发送节点所处的同步域;Synchronization domain = the synchronization domain where the sending node is located;

透明时钟域部分主要用来记录从PCF生成时刻起经过每一过程所经历的时间。PCF进入当前处理单元时的透明时钟记为PCF离开当前处理单元时的透明时钟记为如果生成数据帧的节点是源节点,则数据帧生成单元601中的PCF的透明时钟值 TC out 601 = 0 . The transparent clock domain part is mainly used to record the time elapsed in each process from the time when the PCF is generated. The transparent clock when the PCF enters the current processing unit is denoted as The transparent clock when the PCF leaves the current processing unit is denoted as If the node generating the data frame is the source node, the transparent clock value of the PCF in the data frame generating unit 601 TC out 601 = 0 .

数据帧发送单元602Data frame sending unit 602

数据帧发送单元602第一方面依据数据帧传输角色MBUser={SSMB,SCMB,DSMB,DCMB,DSCB,MSCB}中的MSCB来转发数据帧接收单元603接收的数据帧;然后执行第四和第五方面;In the first aspect, the data frame sending unit 602 forwards the data frame received by the data frame receiving unit 603 according to MSC B in the data frame transmission role MB User ={SSM B , SCM B , DSM B , DCM B , DSC B , MSC B } ;then execute the fourth and fifth aspects;

数据帧发送单元602第二方面依据数据帧传输角色MBUser={SSMB,SCMB,DSMB,DCMB,DSCB,MSCB}中的SSMB,SCMB来接收数据帧生成单元601输出的FR;The second aspect of the data frame sending unit 602 is to receive the output of the data frame generating unit 601 according to the SSM B and SCM B in the data frame transmission role MB User ={SSM B , SCM B , DSM B , DCM B , DSC B , MSC B } the FR;

第三方面,记录FR的发送时刻点第四方面,并将FR添加到节点的数据发送队列Qsend中。其中,FR入队和出队采用先入先出的方式。In the third aspect, record the sending time point of FR In the fourth aspect, add FR to the data sending queue Q send of the node. Among them, FR enters and exits the team in a first-in first-out manner.

第五方面,记录数据派发延迟时间TDC和发送延迟时间TSC,并更改FR中透明时钟的值。然后,依据数据派发延迟时间TDC、发送延迟时间TSC和公式得到离开数据帧发送单元602的透明时钟 In the fifth aspect, record the data distribution delay time TD C and the transmission delay time TS C , and change the transparent clock in FR value. Then, according to the data distribution delay time TD C , the transmission delay time TS C and the formula Obtain the transparent clock leaving the data frame sending unit 602

数据帧接收单元603Data frame receiving unit 603

图3B为数据帧接收单元603的流程图。数据帧接收单元603用于接收数据帧发送单元602发送的数据帧FR,并将接收到的数据帧存放入数据接收队列QVLrecvFIG. 3B is a flowchart of the data frame receiving unit 603 . The data frame receiving unit 603 is used to receive the data frame FR sent by the data frame sending unit 602, and store the received data frame into the data receiving queue Q VLrecv ;

第一方面,判断节点的VL接收队列QVLrecv是否为空,如果不为空,则说明接收到了数据帧,如果为空,则返回初始状态,等待数据帧的到达;In the first aspect, it is judged whether the VL receiving queue Q VLrecv of the node is empty, if it is not empty, it means that the data frame has been received, if it is empty, then return to the initial state, and wait for the arrival of the data frame;

第二方面,对于上述VL接收队列QVLrecv非空的情况,首先判断接收到的是否是有效的数据帧,如果是,则对数据帧进行信息提取处理;如果不是,则触发故障检测与处理模块70做丢弃处理。In the second aspect, for the non-empty situation of the above-mentioned VL receiving queue Q VLrecv , first judge whether the received data frame is valid, if yes, then perform information extraction processing on the data frame; if not, trigger the fault detection and processing module 70 for discarding.

所述信息提取处理是提取源节点和目的节点地址信息,记录接收时刻点Tr,记录由上一节点发送到当前节点的过程中节点间的线上传输延迟时间TWC,接收延迟时间TRC,更改透明时钟值 The information extraction process is to extract the source node and destination node address information, record the receiving time point T r , record the online transmission delay time TW C between nodes in the process of sending from the previous node to the current node, and receive the delay time TR C , changing the transparent clock value

所述更改透明时钟值的方式为依据线上传输延迟时间TWC、接收延迟时间TRC和公式得到离开数据帧接收单元603的透明时钟值 The method of changing the transparent clock value is based on the online transmission delay time TW C , the reception delay time TR C and the formula Get the transparent clock value leaving the data frame receiving unit 603

第三方面进行下述操作。依据第二方面所提取的源节点和目的节点地址信息,和数据帧传输角色MBUser={SSMB,SCMB,DSMB,DCMB,DSCB,MSCB}中的DSMB,DCMB判断当前节点是否为与目的节点地址信息一致的目的节点,如果是,则说明数据帧传输已完成,并将数据帧FR和接收到FR的接收时刻点Tr存放入节点的数据接收队列Qrecv中,触发数据帧固化单元604,开始进行对其进行固化操作;如果不是目的节点,则将数据帧FR传递给当前节点的数据帧发送单元602,继续数据发送过程,向目的节点发送数据帧FR。The third aspect performs the following operations. Based on the source node and destination node address information extracted in the second aspect, and the DSM B and DCM B in the data frame transmission role MB User ={SSM B , SCM B , DSM B , DCM B , DSC B , MSC B } Whether the current node is the destination node consistent with the address information of the destination node, if yes, it means that the data frame transmission has been completed, and the data frame FR and the receiving time point T r of the received FR are stored in the data receiving queue Q recv of the node , trigger the data frame solidification unit 604, and start its solidification operation; if it is not the destination node, then pass the data frame FR to the data frame sending unit 602 of the current node, continue the data sending process, and send the data frame FR to the destination node.

数据帧固化单元604Data frame curing unit 604

图3C为数据帧固化单元604的流程图。数据帧固化单元604实现对目的节点接收到的数据帧FR进行重排的功能。通过数据帧固化单元604,目的节点可以获得按照源节点发送时间顺序排列的一组数据帧。FIG. 3C is a flowchart of the data frame curing unit 604 . The data frame curing unit 604 implements the function of rearranging the data frames FR received by the destination node. Through the data frame curing unit 604, the destination node can obtain a group of data frames arranged in the order of sending time of the source node.

第一方面,对节点的数据接收队列Qrecv进行判断,判断节点是否接收到了数据帧,如果接收到即数据接收队列Qrecv不为空,则开始对接收到的数据帧的时刻点Tr进行处理,取出数据接收队列中头部成员(含时间及数据帧信息),对其进行固化操作,以获得固化时刻点Tp;如果为空,则返回初始状态,并继续等待数据接收队列Qrecv不为空的情况。In the first aspect, the data receiving queue Q recv of the node is judged to determine whether the node has received the data frame. If it is received, that is, the data receiving queue Q recv is not empty, the time point T r of the received data frame is started. Processing, take out the head member (including time and data frame information) in the data receiving queue, and perform curing operation on it to obtain the curing time point T p ; if it is empty, return to the initial state and continue to wait for the data receiving queue Q recv is not empty.

第二方面,对于数据接收队列Qrecv不为空的情况,首先判断根据数据帧FR中的帧类型部分判断是否为IN帧,如果是,则将固化好的IN帧和其固化时刻点Tp按照固化时刻点的顺序存放入节点的数据固化队列Qperm;如果不是,则不予处理。In the second aspect, for the case where the data receiving queue Q recv is not empty, first judge whether it is an IN frame according to the frame type part in the data frame FR, and if so, the cured IN frame and its curing time point T p Store the data into the node's data curing queue Q perm in the order of curing time points; if not, it will not be processed.

第三方面,对于数据接收队列Qrecv中数据帧的类型是IN帧的情况,再根据节点的角色类型BUser进行选择,如果节点角色为压缩控制器,则进入数据帧压缩单元605,开始数据压缩操作的过程;否则,即节点角色为同步控制器或者同步客户端,则进入时钟修正模块80,开始修正节点的本地时钟。In the third aspect, when the type of the data frame in the data receiving queue Q recv is an IN frame, then select according to the role type B User of the node, if the node role is a compression controller, then enter the data frame compression unit 605, and start data The process of the compression operation; otherwise, that is, the role of the node is a synchronization controller or a synchronization client, then enter the clock correction module 80, and start to correct the local clock of the node.

所述固化操作的方式如图3E所示。首先,依据数据传输最大延迟和数据帧FR的透明时钟的值TCn(假设目的节点为第n个节点,TCn为数据帧FR从源节点传输开始到达目的节点所经历的总时间)计算固化延迟时间。固化延迟时间为 The manner of the curing operation is shown in Figure 3E. First, according to the maximum delay of data transmission And the value TC n of the transparent clock of the data frame FR (assuming that the destination node is the nth node, TC n is the total time experienced by the data frame FR from the source node to the destination node) to calculate the curing delay time. The curing delay time is

然后,可以利用公式计算得到固化时刻点Tp。然后,继续根据数据帧FR结构中的帧类型信息判断所固化的数据帧类型是否为IN帧,如果是,则将计算过固化时刻点的数据帧和计算得到的固化时刻点Tp,按照固化时刻点Tp的先后顺序(时间越小越在队列前面)插入节点的数据固化队列Qperm,便于进行下一步的操作。然后判断目的节点角色配置是否为压缩控制器,如果是,则进入数据帧压缩单元605,开始执行后续操作;如果不是,则说明配置为同步控制器或者同步客户端,则进入时钟修正模块80,可以利用固化队列中的数据帧用于本地时钟的修正操作。Then, the formula can be used Calculate the curing time point T p . Then, continue to judge whether the cured data frame type is an IN frame according to the frame type information in the data frame FR structure. The order of the time point T p (the smaller the time, the front of the queue) is inserted into the data curing queue Q perm of the node, which is convenient for the next operation. Then judge whether the destination node role configuration is a compression controller, if yes, then enter the data frame compression unit 605, and start to perform subsequent operations; if not, then explain that the configuration is a synchronization controller or a synchronization client, then enter the clock correction module 80, The data frames in the curing queue can be used for the correction operation of the local clock.

数据帧压缩单元605Data frame compression unit 605

图3D所示为数据帧压缩单元605的流程图。数据帧压缩单元605主要实现对数据帧的固化时间点进行压缩的功能,是整个网络建立全局的时间基准中的很重要的单元。FIG. 3D is a flowchart of the data frame compression unit 605 . The data frame compression unit 605 mainly realizes the function of compressing the curing time point of the data frame, and is a very important unit in establishing a global time reference for the entire network.

第一方面,数据帧压缩单元605依据由数据帧固化单元604获得的固化后的数据帧FR进行收集操作。所述收集操作的方式为在一个不大于(其中,OW,observedwindow,为观察窗口,由公式计算得到)的时间窗口对数据进行收集,每个节点维持个计数器,用来记录在每个OW内所收集到的数据帧的个数,具体流程如图3D所示(图中,以为例)。In the first aspect, the data frame compression unit 605 performs the collection operation according to the cured data frame FR obtained by the data frame curing unit 604 . The method of the collection operation is in a not greater than (Where, OW, observedwindow, is the observation window, by the formula Calculated) time window to collect data, each node maintains A counter is used to record the number of data frames collected in each OW, and the specific process is as shown in Figure 3D (in the figure, with example).

依据由数据帧固化单元604获得的数据固化队列Qperm中的首元素Qperm[0]中包含的固化时刻点Tp-0开始启动数据帧压缩单元605,这个最早的固化时刻点即为数据帧压缩单元605所打开的时间窗口的起点,记为Tstart(其中,Tstart=Tp-0),并将其保存在节点的压缩队列Qcomp中,将计数器1的值置为1,然后,判断数据固化队列Qperm是否为空(即是否还有待取出的数据帧),如果为空,则判断当前时间是否已超过Tstart+3×OW,如果已超过,则不再继续收集数据帧,直接进入数据计算阶段,计算压缩时刻点;如果不为空,则继续取出当前固化队列的头部元素,获得其固化时刻点Tp-i,并对所得到的时间值进行判断,判断是否满足Tp-i≤Tstart+OW。如果满足Tp-i≤Tstart+OW,则说明这个数据帧符合要求,将其存放入数据压缩队列Qcomp,继续对数据固化队列Qperm中是否存在数据帧进行判断;如果不满足Tp-i≤Tstart+OW,则判断此时计数器1的值是否大于1。如果计数器1的值不大于1,则说明收集阶段结束,当前收到的数据帧是错误的数据帧,将其丢弃,并进入数据计算阶段,利用数据压缩队列Qcomp中的数据帧的固化时刻点计算压缩时刻点;如果计数器1的值大于1,则开启第二个接收窗口,对固化时刻点在(Tstart+OW,Tstart+2×OW]范围内的数据帧进行收集。如果固化时刻点在(Tstart+OW,Tstart+2×OW]范围内,则用计数器2记录固化时刻点在此范围内的数据帧的个数,并将其存放入数据压缩队列Qcomp,继续对数据固化队列Qperm中是否存在数据帧进行判断;如果不在此范围内,则判断此时计数器2的值是否大于等于1。如果计数器2的值小于1,则说明收集阶段结束,当前收到的数据帧是错误的数据帧,将其丢弃,并进入数据计算阶段,利用数据压缩队列Qcomp中的数据帧的固化时刻点计算压缩时刻点;如果此时计数器2的值大于等于1,则开启第三个接收窗口,对固化时刻点在(Tstart+2×OW,Tstart+3×OW]范围内的数据帧进行收集。如果固化时刻点在(Tstart+2×OW,Tstart+3×OW]范围内,则将其存放入数据压缩队列Qcomp,继续对数据固化队列Qperm中是否存在数据帧进行判断;如果不在此范围内,则说明接收到的是错误的数据帧,将其丢弃,并进入数据计算阶段,利用数据压缩队列Qcomp中的数据帧的固化时刻点计算压缩时刻点。重复上述过程,直至时间超过(本实施例中以为例,即直至时间超过(Tstart+3×OW))。在上述过程中,在时间窗内收集到的数据帧将被按照固化时刻点的顺序存入节点的数据压缩队列Qcomp中,每将一个数据帧放入数据压缩队列Qcomp,就修正一次节点的本地成员变量值=当前本地成员变量值+新成员(PCF内部参数),从而获得新的本地成员变量值。Start the data frame compression unit 605 according to the curing time point T p-0 contained in the first element Q perm [0] in the data curing queue Q perm obtained by the data frame curing unit 604. This earliest curing time point is the data The starting point of the time window opened by the frame compression unit 605 is recorded as T start (where T start =T p-0 ), and it is stored in the compression queue Q comp of the node, and the value of the counter 1 is set to 1, Then, judge whether the data curing queue Q perm is empty (that is, whether there are data frames to be taken out), if it is empty, judge whether the current time has exceeded T start + 3×OW, and if it has exceeded, do not continue to collect data frame, directly enter the data calculation stage, and calculate the compression time point; if it is not empty, continue to take out the head element of the current solidification queue, obtain its solidification time point T pi , and judge the obtained time value to determine whether it satisfies T pi ≤ T start +OW. If it satisfies T pi ≤ T start +OW, it means that the data frame meets the requirements, store it in the data compression queue Q comp , and continue to judge whether there is a data frame in the data curing queue Q perm ; if it does not satisfy T pi ≤ T start +OW, then judge whether the value of counter 1 is greater than 1 at this time. If the value of counter 1 is not greater than 1, it means that the collection phase is over, the currently received data frame is an incorrect data frame, discard it, and enter the data calculation phase, using the solidification time of the data frame in the data compression queue Q comp point to calculate the compression time point; if the value of counter 1 is greater than 1, open the second receiving window to collect the data frames whose curing time point is within the range of (T start +OW,T start +2×OW]. If curing When the time point is within the range of (T start +OW,T start +2×OW], use counter 2 to record the number of data frames within this range at the time point of solidification, and store it in the data compression queue Q comp , continue Judge whether there is a data frame in the data curing queue Q perm ; if it is not within this range, then judge whether the value of counter 2 is greater than or equal to 1 at this time. If the value of counter 2 is less than 1, it means that the collection phase is over and the current received The data frame is the wrong data frame, discard it, and enter the data calculation stage, and use the solidification time point of the data frame in the data compression queue Q comp to calculate the compression time point; if the value of the counter 2 is greater than or equal to 1 at this time, then Open the third receiving window to collect data frames whose curing time point is in the range of (T start +2×OW,T start +3×OW]. If the curing time point is in (T start +2×OW,T start +3×OW], store it in the data compression queue Q comp , and continue to judge whether there is a data frame in the data curing queue Q perm ; if it is not within this range, it means that the wrong data frame is received , discard it, and enter the data calculation stage, and use the curing time point of the data frame in the data compression queue Q comp to calculate the compression time point. Repeat the above process until the time exceeds (In this example, the For example, until the time exceeds (T start +3×OW)). In the above process, the data frames collected in the time window will be stored in the data compression queue Q comp of the node in the order of curing time points, and each time a data frame is put into the data compression queue Q comp , the node will be corrected once The local member variable value of = the current local member variable value + new member (PCF internal parameter), so as to obtain the new local member variable value.

第二方面,当收集过程结束后,开始进入计算阶段。依据收集过程中收集到的固化时刻点Tp-i(Tp-i代表第i(i≥0)个固化时刻点的值)计算压缩修正值 In the second aspect, when the collection process is over, it begins to enter the calculation phase. Calculate the compression correction value based on the curing time point T pi collected during the collection process (T pi represents the value of the i-th (i≥0) curing time point)

所述压缩修正值的计算方式为按照下面的计算式来计算:The calculation method of the compression correction value is to calculate according to the following calculation formula:

对于只有一个输入的情况,压缩修正值 For the case of only one input, the compression correction value

两个输入: D comp _ corr 605 = ( T p - 0 + T p - 1 ) / 2 - T p - 0 Two inputs: D. comp _ corr 605 = ( T p - 0 + T p - 1 ) / 2 - T p - 0

三个输入: D comp _ corr 605 = T p - 1 - T p - 0 Three inputs: D. comp _ corr 605 = T p - 1 - T p - 0

四个输入: D comp _ corr 605 = ( T p - 1 + T p - 2 ) / 2 - T p - 0 Four inputs: D. comp _ corr 605 = ( T p - 1 + T p - 2 ) / 2 - T p - 0

五个输入: D comp _ corr 605 = ( T p - 1 + T p - 2 + T p - 3 ) / 2 - T p - 0 Five inputs: D. comp _ corr 605 = ( T p - 1 + T p - 2 + T p - 3 ) / 2 - T p - 0

五个以上的输入: D comp _ corr 605 = Σ k = 1 n - 2 T p - k / ( n - 2 ) - T p - 0 f 0 User = 2 的情况下)More than five inputs: D. comp _ corr 605 = Σ k = 1 no - 2 T p - k / ( no - 2 ) - T p - 0 ( f 0 User = 2 in the case of)

第三方面,依据第二方面计算得到的压缩修正值计算压缩时刻点 In the third aspect, the compression correction value calculated according to the second aspect Calculate the compression time point

参见图3G所示,当收集完所有可用的数据帧后,依据计算得到的压缩修正值计算压缩过程的时延 D comp _ func 605 = ( f 0 User + 1 ) × OW + BD 0 User + D comp _ corr 605 , 进一步地,可以计算得到压缩时刻点然后,数据帧压缩单元605将计算好的压缩时刻点传递给时钟修正模块80,触发时钟修正模块80进行后续有关修正本地时钟的处理。As shown in Figure 3G, when all available data frames are collected, the delay of the compression process is calculated according to the calculated compression correction value D. comp _ func 605 = ( f 0 User + 1 ) × ow + BD 0 User + D. comp _ corr 605 , Further, the compression time point can be calculated Then, the data frame compression unit 605 will calculate the compression time point The data is transmitted to the clock correction module 80, and the clock correction module 80 is triggered to perform subsequent processing related to correcting the local clock.

故障检测与处理模块70Fault detection and processing module 70

所述故障检测与处理模块70实现对数据帧校验并进行错误处理、对结团的情况进行检测与处理、对仿真系统软件运行状况的检测与对错误的处理的功能。故障检测与处理模块70对仿真运行过程进行检测并根据不同的错误类型进行与错误类型所对应的处理,并将所出现的错误情况传递给状态管理模块40、数据处理模块60、时钟修正模块80、结果输出模块90。所述结团情况是指SAEAS6802(时间触发以太网)中规定的。The fault detection and processing module 70 implements the functions of verifying data frames and performing error processing, detecting and processing clumping, detecting the running status of the simulation system software, and processing errors. The fault detection and processing module 70 detects the simulation running process and performs processing corresponding to the error type according to different error types, and transmits the error situation that occurs to the state management module 40, the data processing module 60, and the clock correction module 80 , the result output module 90 . The clustering situation mentioned is specified in SAEAS6802 (Time-Triggered Ethernet).

参见图1所示,故障检测与处理模块70主要包括数据帧校验错误处理单元701、同步结团检测与处理单元702、异步结团检测与处理单元703和软件异常处理单元704。故障检测与处理模块70在节点启动后的整个过程中都在运行,负责检测整个过程中所可能出现的错误,并对错误进行处理。Referring to FIG. 1 , the fault detection and processing module 70 mainly includes a data frame verification error processing unit 701 , a synchronous clumping detection and processing unit 702 , an asynchronous clumping detection and processing unit 703 and a software exception processing unit 704 . The fault detection and processing module 70 runs during the whole process after the node is started, and is responsible for detecting errors that may occur during the entire process, and processing the errors.

数据帧校验错误处理单元701:当目的节点接收到数据帧时,判断数据帧格式是否正确,如果错误,则进入这个单元,对于错误的数据帧直接进行丢弃处理。Data frame check error processing unit 701: When the destination node receives the data frame, it judges whether the format of the data frame is correct, if it is wrong, it enters this unit, and directly discards the wrong data frame.

同步结团检测与处理单元702:检测交换式以太网中可能出现的结团情况,以防止出现交换式以太网中出现部分节点同步的情况。第一方面,同步结团检测与处理单元702在数据帧选择单元801结束后(即接收窗口关窗的时刻点)依据数据帧选择单元801所选择的最优数据帧内部的新成员的值对结团状况进行检测。其中,每个节点中存有一个本地变量Msync,用来记录数据帧选择单元801所选择的最优数据帧内部的新成员的值。第二方面,同步结团检测与处理单元702将同步结团检测的结果,即上述新成员的大小Msync,与状态门限值(角色配置为同步控制器时)或状态门限值(角色配置为压缩控制器时)或状态门限值(角色配置为同步客户端时)进行比较,从而将作出的处理决定转换给状态管理模块30。由状态管理模块30作用于状态转换模块40对节点状态进行转换。一般的,如果同步结团检测成功(即新成员大小小于门限值),则说明出现结团的情况,即说明同步出现了问题,开始汇报给状态管理模块30,状态管理模块30触发状态转换模块40将节点状态退回为非同步的状态,等待合适的时机重新发起同步。Synchronization clumping detection and processing unit 702: detect possible clumping in the switched Ethernet, so as to prevent synchronization of some nodes in the switched Ethernet. In the first aspect, the synchronous clumping detection and processing unit 702 is based on the value pair of new members in the optimal data frame selected by the data frame selection unit 801 after the end of the data frame selection unit 801 (that is, the moment when the receiving window is closed). Agglomeration status is checked. Wherein, each node stores a local variable M sync , which is used to record the value of the new member in the optimal data frame selected by the data frame selection unit 801 . In the second aspect, the synchronous clumping detection and processing unit 702 compares the result of the synchronous clumping detection, that is, the size M sync of the above-mentioned new member, with the state threshold (when the role is configured as a synchronous controller) or status threshold (when the role is configured as a compression controller) or status threshold (when the role is configured as a synchronous client) for comparison, so as to transfer the processing decision made to the state management module 30 . The state management module 30 acts on the state conversion module 40 to convert the node state. Generally, if the synchronous clumping detection is successful (that is, the size of the new member is less than the threshold value), then it indicates that there is a clumping situation, that is, there is a problem in the synchronization, and it starts to report to the state management module 30, and the state management module 30 triggers a state transition The module 40 returns the node state to an asynchronous state, and waits for an appropriate opportunity to re-initiate synchronization.

异步结团检测与处理单元703:检测网络中可能出现的结团状况,以防止出现网络中部分节点同步的情况。第一方面,利用一个大小为2的数组Masync[2]记录不同周期内预期外的数据帧的个数。所述预期外的数据帧即指在数据选择窗口中未能接收到的数据帧和在数据选择窗口中接收到的但是数据帧中集成周期数目与当前节点的集成周期不一致的数据帧。本发明中,利用Masync[偶数]记录偶数集成周期预期外的数据帧个数,利用Masync[奇数]记录奇数集成周期预期外的数据帧个数。在整个集成周期内,异步结团检测都始终执行。第二方面,对于角色配置为同步控制器和同步客户端的节点,在数据帧派发时刻点依据所记录的预期外的数据帧个数Masync[偶数](或Masync[奇数])与状态门限值进行比较;对于角色配置为压缩控制器的节点,在数据帧选择单元801结束后(即接收窗口关窗的时刻点),依据所记录的预期外的数据帧个数Masync[偶数](或Masync[奇数])与状态门限值进行比较,如果预期外的数据帧个数Masync[偶数](或Masync[奇数])大于状态门限值,则说明异步结团检测成功,即同步出现了问题,开始汇报给状态管理模块30,状态管理模块30触发状态转换模块50将节点当前状态退回为非同步的状态,等待合适的时机重新发起同步。Asynchronous clumping detection and processing unit 703: Detect possible clumping in the network, so as to prevent synchronization of some nodes in the network. In the first aspect, an array M async [2] with a size of 2 is used to record the number of unexpected data frames in different periods. The unexpected data frame refers to a data frame that cannot be received in the data selection window and a data frame that is received in the data selection window but the number of integration cycles in the data frame is inconsistent with the integration cycle of the current node. In the present invention, M async [even number] is used to record the unexpected number of data frames in the even-numbered integration period, and M async [odd number] is used to record the unexpected number of data frames in the odd-numbered integration period. Asynchronous clique detection is always performed throughout the integration cycle. In the second aspect, for nodes whose role is configured as a synchronization controller and a synchronization client, at the time point of data frame distribution According to the number of unexpected data frames recorded M async [even number] (or M async [odd number]) and the state threshold For comparison; for the node whose role is configured as a compression controller, after the end of the data frame selection unit 801 (that is, the moment when the receiving window is closed), according to the recorded unexpected number of data frames M async [even number] (or M async [odd number]) and state threshold For comparison, if the number of unexpected data frames M async [even number] (or M async [odd number]) is greater than the state threshold value, it means that the asynchronous cluster detection is successful, that is, there is a problem with the synchronization, and it starts to report to the state management module 30. The state management module 30 triggers the state transition module 50 to return the current state of the node to an asynchronous state, and wait for an appropriate opportunity to re-initiate synchronization.

软件异常处理单元704:这一单元主要处理软件出现异常时的各种情况,当软件出现异常时,会利用这一单元进行报警,报出错误原因,并且显示给用户,便于用户得知出错情况,同时,也会切换到结果输出模块50,输出相应结果,并自动终止软件运行过程。Software exception processing unit 704: This unit mainly deals with various situations when the software is abnormal. When the software is abnormal, this unit will be used to alarm, report the cause of the error, and display it to the user, so that the user can know the error situation , at the same time, it will also switch to the result output module 50, output the corresponding result, and automatically terminate the software running process.

时钟修正模块80Clock correction module 80

参见图1、图4所示,所述时钟修正模块80实现对节点的本地时钟进行修正的功能,对由数据处理模块60获得的数据帧信息进行处理,从而对本地时钟进行修正;修正结束后将修正结果和完成修正的时刻点传递给状态管理模块30,状态管理模块30将根据所获信息作用于其它模块触发与当前节点状态所对应的行为;在用户需求的情况下,将时钟修正结果传递给结果输出模块50对其进行输出;将时钟修正过程的数据帧及时间信息传递给故障检测与处理模块70进行处理。Referring to Fig. 1, shown in Fig. 4, described clock correction module 80 realizes the function that the local clock of node is corrected, and the data frame information obtained by data processing module 60 is processed, thereby corrects local clock; After correction finishes Pass the correction result and the time point when the correction is completed to the state management module 30, and the state management module 30 will act on other modules according to the obtained information to trigger the behavior corresponding to the current node state; in the case of user demand, the clock correction result Pass it to the result output module 50 to output it; pass the data frame and time information of the clock correction process to the fault detection and processing module 70 for processing.

进入时钟修正模块80后,首先节点利用数据帧选择单元801选择出最佳的数据帧FRbest(即接收窗口内新成员值最大的数据帧);并将这个数据帧FRbest及其时刻点传递给时钟修正计算单元802,触发时钟修正计算单元802利用所选的最佳数据帧的固化时刻点(当节点被配置为同步控制器或同步客户端时)或者压缩时刻点(当节点被配置为压缩控制器时)进行时钟修正值的计算,获得时钟修正值的大小,并将其传递给时钟修正执行单元803,时钟修正执行单元803利用所获得的时钟修正值在时钟修正执行时刻点执行对本地时钟的修正。经过时钟修正模块80对节点本地时钟的修正,网络中各个节点之间的本地时钟误差可以达到足够小的范围内,从而可达到全局的时钟同步。After entering the clock correction module 80, first the node uses the data frame selection unit 801 to select the best data frame FR best (that is, the data frame with the largest new member value in the receiving window); and transmits the data frame FR best and its time point For the clock correction calculation unit 802, the trigger clock correction calculation unit 802 uses the selected optimal data frame solidification time point (when the node is configured as a synchronization controller or a synchronization client) or compression time point (when the node is configured as When compressing the controller), calculate the clock correction value, obtain the size of the clock correction value, and pass it to the clock correction execution unit 803, and the clock correction execution unit 803 uses the obtained clock correction value to execute the clock correction execution time point Correction of the local clock. After the clock correction module 80 corrects the local clocks of the nodes, the local clock errors among the nodes in the network can be within a sufficiently small range, so that global clock synchronization can be achieved.

参见图4所示的数据帧选取最佳数据帧的流程图。对于目的节点角色配置为同步控制器或同步客户端的情况,当数据帧固化单元604执行结束后,开始进入时钟修正模块80里的数据帧选择单元801。Refer to the flow chart of selecting the best data frame from the data frame shown in FIG. 4 . For the case where the role of the destination node is configured as a synchronization controller or a synchronization client, after the execution of the data frame curing unit 604 is completed, it starts to enter the data frame selection unit 801 in the clock correction module 80 .

第一方面,对于节点所连接的每条信道(信道号记为j,信道总数记为J),首先判断节点的数据固化队列Qperm是否为空,如果为空,则返回数据帧固化单元604,等待接收固化好的IN帧;如果不为空,则取出数据固化队列Qperm的首元素Qperm[0],记录其固化时刻点TpIn the first aspect, for each channel connected to the node (the channel number is denoted as j, and the total number of channels is denoted as J), first judge whether the data curing queue Q perm of the node is empty, and if it is empty, return to the data frame curing unit 604 , waiting to receive the cured IN frame; if it is not empty, take out the first element Q perm [0] of the data curing queue Q perm , and record its curing time point T p .

第二方面,对于数据固化队列Qperm不为空的情况,判断所获得的固化后的IN帧的固化时刻点Tp是否在节点的接收窗口范围内并进一步判断该固化后的IN帧的集成周期与节点当前集成周期是否一致,如果是,则说明是可以利用的有效IN帧,继续判断是否是接收窗口内接收到的第一个的IN帧;如果不是,则触发故障检测与处理模块703。In the second aspect, if the data curing queue Q perm is not empty, it is judged whether the curing time point T p of the obtained IN frame after curing is within the receiving window range of the node and the integration of the IN frame after the curing is further judged. Whether the period is consistent with the current integration period of the node, if yes, it means that it is a valid IN frame that can be used, continue to judge whether it is the first IN frame received in the receiving window; if not, then trigger the fault detection and processing module 703 .

第三方面,依据第二方面接收窗口范围内的IN帧和最佳数据帧选择方法,选择出该信道的最佳数据帧FRbest-j。所述最佳数据帧选择方法的方式为:如果当前接收到的IN帧是接收窗口内接收到的第一个的有效IN帧,则将其存入节点缓冲区,并将其作为参照帧与之后在同一信道上的接收到的IN帧做比较;如果不是,则可以将其直接与上一个获得的参照帧进行比较。如果当前IN帧的新成员的值比参照帧小,则丢弃当前IN帧;否则,即当前帧的新成员的值大于等于参照帧的新成员的值,则丢弃参照帧,保存当前数据帧,并将其作为新的参照帧。In the third aspect, the best data frame FR best-j of the channel is selected according to the IN frame within the receiving window range of the second aspect and the best data frame selection method. The mode of described optimal data frame selection method is: if the current received IN frame is the first valid IN frame received in the receiving window, it is stored in the node buffer, and it is used as a reference frame with A later received IN frame on the same channel is compared; if not, it can be compared directly with the last obtained reference frame. If the value of the new member of the current IN frame is smaller than the reference frame, the current IN frame is discarded; otherwise, that is, the value of the new member of the current frame is greater than or equal to the value of the new member of the reference frame, the reference frame is discarded, and the current data frame is saved. and use it as the new frame of reference.

第四方面,将所选择的最佳IN帧FRbest-j以及FRbest-j的固化时刻点Tp-best-j存放入数据收集队列Qcoll(对于每一个信道都进行上述操作),并对节点的当前集成周期重新赋值。如果所获得的固化后的IN帧不在接收窗口范围内或者在接收窗口内但该固化后的IN帧的集成周期与节点当前集成周期是否一致,则触发故障检测与处理模块703。In the fourth aspect, the selected best IN frame FR best-j and the curing time point T p-best- j of FR best-j are stored in the data collection queue Q coll (the above operations are performed for each channel), and Reassigns the node's current integration cycle. If the obtained solidified IN frame is not within the range of the receiving window or is within the receiving window but whether the integration period of the solidified IN frame is consistent with the current integration period of the node, the fault detection and processing module 703 is triggered.

对于目的节点角色配置为压缩控制器的情况,当数据帧压缩单元605执行结束后,开始进入时钟修正模块80里的数据帧选择单元801。For the case where the role of the destination node is configured as a compression controller, after the execution of the data frame compression unit 605 is completed, it starts to enter the data frame selection unit 801 in the clock correction module 80 .

第一方面,判断节点的数据压缩队列Qcomp是否为空,如果为空,则返回数据帧压缩单元605,等待接收压缩好的数据帧;如果不为空,则取出数据压缩队列Qcomp的首元素Qcomp[0],记录其固化时刻点TqIn the first aspect, it is judged whether the data compression queue Q comp of the node is empty, if it is empty, then return to the data frame compression unit 605, and wait to receive the compressed data frame; if it is not empty, then take out the header of the data compression queue Q comp Element Q comp [0], record its solidification time point T q .

第二方面,对于数据压缩队列Qcomp不为空的情况,判断所获得的数据帧的压缩时刻点Tq是否在节点的接收窗口范围内并进一步判断该固化后的IN帧的集成周期与节点当前集成周期是否一致,如果是,则说明是可以利用的有效IN帧,判断是否是接收窗口内接收到的第一个的IN帧;如果不是,则触发故障检测与处理模块703。In the second aspect, if the data compression queue Q comp is not empty, judge whether the compression time point T q of the obtained data frame is within the receiving window range of the node and further judge the integration cycle of the cured IN frame and the node Whether the current integration cycle is consistent, if yes, it indicates that it is a valid IN frame that can be used, and judges whether it is the first IN frame received in the receiving window; if not, then trigger the fault detection and processing module 703.

第三方面,依据第二方面接收窗口范围内的IN帧和最佳数据帧选择方法,选择出该信道的最佳数据帧FRbest。所述最佳数据帧选择方法的方式为:如果当前接收到的IN帧是接收窗口内接收到的第一个的有效IN帧,则将其存入节点缓冲区,并将其作为参照帧与之后在同一信道上的接收到的IN帧做比较;如果不是,则可以将其直接与上一个获得的参照帧进行比较。如果当前IN帧的新成员的值比上一个获得的参照帧的小,则丢弃当前IN帧;否则,即新成员的值大于等于参照帧的新成员的值,则丢弃上一个数据帧,保存当前数据帧,并将其作为新的参照帧。In the third aspect, the best data frame FR best of the channel is selected according to the IN frame within the receiving window range of the second aspect and the best data frame selection method. The mode of described optimal data frame selection method is: if the current received IN frame is the first valid IN frame received in the receiving window, it is stored in the node buffer, and it is used as a reference frame with A later received IN frame on the same channel is compared; if not, it can be compared directly with the last obtained reference frame. If the value of the new member of the current IN frame is smaller than that of the last obtained reference frame, then discard the current IN frame; otherwise, that is, the value of the new member is greater than or equal to the value of the new member of the reference frame, then discard the previous data frame and save The current data frame and use it as the new reference frame.

第四方面,将所选择的最佳的IN帧FRbest以及FRbest的压缩时刻点Tq-best存放入数据收集队列Qcoll(对于每一个信道都进行上述操作),并对节点的当前集成周期重新赋值。如果所获得的压缩后的IN帧不在接收窗口范围内或者在接收窗口内但该固化后的IN帧的集成周期与节点当前集成周期是否一致,则触发故障检测与处理模块703。,则触发故障检测与处理模块703。In the fourth aspect, the selected best IN frame FR best and the compression time point T q-best of FR best are stored in the data collection queue Q coll (the above operations are performed for each channel), and the current integration of nodes Periodic reassignment. If the obtained compressed IN frame is not within the range of the receiving window or within the receiving window but whether the integration period of the solidified IN frame is consistent with the current integration period of the node, trigger the fault detection and processing module 703 . , the fault detection and processing module 703 is triggered.

对于目的节点角色配置为同步控制器或同步客户端的情况:首先,利用下式计算出预计接收的时刻点Tschd(也可以理解为本地时钟此时的时刻点): T schd = T dp 602 + 2 × E 0 User + D comp _ func 605 + TD C ; 每个节点在预计接收时刻点Tschd附近开启一个长度为的接收窗口,即接收窗口范围为当接收到数据帧固化单元604固化好的IN帧后,开始判断IN帧的固化时刻点Tp是否在接收窗口的范围内,如果是则继续对其进行操作,如果未在接收窗口范围内,则丢弃IN帧。表示FR的发送时刻点,表示数据传输最大延迟时间,表示依据固化时刻点计算的压缩修正值,TDC表示派发延迟时间。For the case where the role of the destination node is configured as a synchronization controller or a synchronization client: first, use the following formula to calculate the expected receiving time point T schd (also can be understood as the time point of the local clock at this time): T schd = T dp 602 + 2 × E. 0 User + D. comp _ func 605 + TD C ; Each node opens a network with a length of The receiving window of , that is, the receiving window range is After receiving the IN frame solidified by the data frame solidification unit 604, start to judge whether the solidification time point T p of the IN frame is within the scope of the receiving window, if so, continue to operate it, if not within the scope of the receiving window, Then the IN frame is discarded. Indicates the sending time point of FR, Indicates the maximum delay time of data transmission, Indicates the compression correction value calculated based on the curing time point, and TD C indicates the dispatch delay time.

对于目的节点配置为压缩控制器的情况,当数据帧压缩单元605执行结束后,开始进入时钟修正模块80里的数据帧选择单元801。首先,利用下式计算节点预计接收到IN帧的时刻点,Tschd(也可以理解为本地时钟此时的时刻点): T schd = T dp + E 0 User + D comp _ func 605 + TD C , (其中,Tdp为接收到的任一IN帧的起始时间点)每个节点在预计接收时刻点附近开启一个长度为的接收窗口,即接收窗口范围为当接收到数据帧压缩单元605压缩好的IN帧后,开始判断IN帧的时间是否在接收窗口的范围内,如果是则继续对其进行操作,如果未在接收窗口范围内,则丢弃IN帧。For the case where the destination node is configured as a compression controller, after the execution of the data frame compression unit 605 is completed, it starts to enter the data frame selection unit 801 in the clock correction module 80 . First, use the following formula to calculate the time point at which the node expects to receive the IN frame, T schd (it can also be understood as the time point of the local clock at this time): T schd = T dp + E. 0 User + D. comp _ func 605 + TD C , (Where, T dp is the starting time point of any received IN frame) Each node opens a length of The receiving window of , that is, the receiving window range is After receiving the IN frame compressed by the data frame compression unit 605, start to judge whether the time of the IN frame is within the scope of the receiving window, if so, continue to operate it, if not within the scope of the receiving window, then discard the IN frame .

对于目的节点配置为同步控制器或同步客户端的情况:For the case where the destination node is configured as a sync controller or a sync client:

第一方面,依据数据帧选择单元801中获取的数据收集队列Qcoll进行判断。判断数据收集队列Qcoll是否为空,如果为空,则说明各个节点间的时钟偏差太大,暂不执行操作,进入等待状态;如果不为空,则利用数据收集队列Qcoll中所收集到的最佳帧的固化时刻点Tp-best-j来对时钟修正值进行计算。其中,所述的数据收集队列Qcoll存储有每个信道中最佳的IN帧(具有最大的新成员的值),第j个信道的最佳固化时刻点为Tp-best-j)。In the first aspect, the judgment is made according to the data collection queue Q coll acquired in the data frame selection unit 801 . Determine whether the data collection queue Q coll is empty, if it is empty, it means that the clock deviation between each node is too large, do not execute the operation temporarily, and enter the waiting state; if it is not empty, use the data collected in the data collection queue Q coll The curing time point T p-best-j of the best frame is used to calculate the clock correction value. Wherein, the data collection queue Q coll stores the best IN frame (with the largest new member value) in each channel, and the best curing time point of the jth channel is T p-best-j ).

第二方面,利用公式计算时钟修正值并将时钟修正值传递给时钟修正执行单元803。In the second aspect, using the formula Calculating Clock Correction Values and correct the clock value Pass it to the clock correction execution unit 803.

对于目的角色配置为压缩控制器的情况,由于本发明中设定在每一条信道中默认只配置一个压缩控制器,所以,不存在对于同步控制器中存在的信道选择的问题,数据收集队列中最多只会收集到一个数据元素,所以可以直接利用这个最佳的数据元素(即具有最大的新成员值的IN帧),获得这个最佳的数据元素中所带有的压缩时刻点的时间Tq-best,之后计算时钟修正值 并将时钟修正值传递给时钟修正执行单元803。For the situation that the purpose role is configured as a compression controller, since only one compression controller is configured by default in each channel in the present invention, there is no problem of channel selection existing in the synchronous controller. Only one data element will be collected at most, so the best data element (that is, the IN frame with the largest new member value) can be directly used to obtain the time T of the compression time point contained in the best data element q-best , after which clock correction values are calculated and correct the clock value Pass it to the clock correction execution unit 803.

第一方面,时钟修正执行单元803依据数据帧选择单元传递的Tschd和计算时延值获得时钟修正时刻点Tclock-corr,并从时钟修正时刻点Tclock-corr开始修正本地时钟tlocalIn the first aspect, the clock correction execution unit 803 calculates the delay value according to the T schd delivered by the data frame selection unit The clock correction time point T clock-corr is obtained, and the local clock t local is corrected from the clock correction time point T clock-corr .

所述时钟修正时刻点的计算方式为: The calculation method of the clock correction time point is:

第二方面,节点在时钟修正时刻点Tclock-corr,对本地时钟tlocal做大小为的修正,修正后的本地时钟记为Dtlocal,则时钟值为 In the second aspect, at the clock correction time point T clock-corr , the node makes a size of the local clock t local , and the revised local clock is recorded as Dt local , then the clock value is

第三方面,对于目的节点角色配置为压缩控制器的情况,时钟修正执行单元803在对时钟修正结束后,在Tq-best时刻重新进入数据帧生成单元601,生成由压缩控制器作为源节点的数据帧。In the third aspect, for the case where the role of the destination node is configured as a compression controller, the clock correction execution unit 803 re-enters the data frame generation unit 601 at time T q-best after the clock correction is completed, and generates data frame.

结果输出模块50Result output module 50

参见图1所示,结果输出模块50:主要负责输出节点的当前节点状态DVUser、时钟修正值和修正后的本地时钟Dtlocal信息结果。Referring to Fig. 1, the result output module 50: mainly responsible for outputting the current node status DV User and clock correction value of the node and the corrected local clock Dt local information result.

在本发明中,结果输出模块50可以将上述信息以xml格式文件或者excel的格式文件输出。输出的格式文件用于直接传递给上层的程序接口,便于上层程序获得是否时钟同步等信息。In the present invention, the result output module 50 can output the above information in an xml format file or an excel format file. The output format file is used to directly pass to the program interface of the upper layer, so that the upper layer program can obtain information such as whether the clock is synchronized or not.

Claims (11)

1.一种模拟交换式以太网时钟同步的仿真系统,该仿真系统包括以太网协议指令数据库、定时器;所述以太网协议指令数据库和定时器是依据IEEE 802.3 ISO/IEC 8802-3标准规范和SAEAS 6802中所指出的指令、状态关联信息构建得到;其特征在于:还包括有节点及链路属性配置模块(10)、同步拓扑生成模块(20)、状态管理模块(30)、状态转换模块(40)、数据处理模块(60)、故障检测与处理模块(70)、时钟修正模块(80)和结果输出模块(50);1. A simulation system for analog switched Ethernet clock synchronization, the simulation system includes an Ethernet protocol command database and a timer; the Ethernet protocol command database and the timer are based on the IEEE 802.3 ISO/IEC 8802-3 standard specification It is constructed with the instruction and state association information pointed out in SAEAS 6802; it is characterized in that: it also includes a node and link attribute configuration module (10), a synchronous topology generation module (20), a state management module (30), a state transition module (40), data processing module (60), fault detection and processing module (70), clock correction module (80) and result output module (50); 节点及链路属性配置模块(10)依据实际以太网中的端系统、交换机以及端系统与交换机之间的物理连接,来配置所需的仿真用配置信息D10The node and link attribute configuration module ( 10 ) configures the required simulation configuration information D10 according to the end system in the actual Ethernet, the switch, and the physical connection between the end system and the switch; 同步拓扑生成模块(20)用于生成同步拓扑结构,并输出同步拓扑信息D20Synchronous topology generating module (20) is used to generate synchronous topology, and output synchronous topology information D 20 ; 状态管理模块(30),用于对节点角色和节点状态的执行行为进行管理;A state management module (30), configured to manage the execution behavior of node roles and node states; 状态转换模块(40)用于对节点状态进行切换;所述节点状态分别为集成状态、异步状态、等待状态、FLOOD状态、使能状态和同步状态;The state conversion module (40) is used to switch the node state; the node states are respectively integrated state, asynchronous state, waiting state, FLOOD state, enabling state and synchronous state; 数据处理模块(60)根据当前节点状态来完成数据帧的生成、发送、接收、固化、压缩;并在进行数据处理的过程中作用于状态管理模块通知状态管理模块当前是否接收到数据帧和数据帧的类型信息;在数据固化或者压缩完成后作用于时钟修正模块,将固化或压缩好的数据帧传递给时钟修正模块;在数据处理过程中,作用于故障检测与处理模块,将数据帧的信息传递给故障检测与处理模块;由数据帧生成单元(601)、数据帧发送单元(602)、数据帧接收单元(603)、数据帧固化单元(604)、数据帧压缩单元(605)构成;The data processing module (60) completes the generation, sending, receiving, curing, and compression of the data frame according to the current node state; The type information of the frame; after the data is solidified or compressed, it acts on the clock correction module, and passes the solidified or compressed data frame to the clock correction module; in the process of data processing, it acts on the fault detection and processing module, and the The information is transmitted to the fault detection and processing module; it is composed of a data frame generation unit (601), a data frame sending unit (602), a data frame receiving unit (603), a data frame curing unit (604), and a data frame compression unit (605) ; 故障检测与处理模块(70),用于对数据帧校验并进行错误处理;对结团的情况进行检测与处理;对仿真运行状况的检测处理;由数据帧校验错误处理单元(701)、同步结团检测与处理单元(702)、异步结团检测与处理单元(703)和软件异常处理单元(704)构成;Fault detection and processing module (70), used for data frame verification and error handling; The situation of agglomeration is detected and processed; The detection and processing of the simulation operation status; The data frame verification error processing unit (701) , a synchronous clumping detection and processing unit (702), an asynchronous clumping detection and processing unit (703) and a software exception processing unit (704); 时钟修正模块(80),用于修正节点角色的本地时钟;由数据帧选择单元(801)、时钟修正计算单元(802)和时钟修正执行单元(803)构成;A clock correction module (80), used to correct the local clock of the node role; consists of a data frame selection unit (801), a clock correction calculation unit (802) and a clock correction execution unit (803); 结果输出模块(50),用于将当前状态信息的结果、时钟修正值大小和节点的当前本地时钟值以xml格式文件或者excel的格式文件输出;Result output module (50), for the result of current state information, clock correction value size and the current local clock value of node with the format file output of xml format file or excel; 所述节点及链路属性配置模块(10)第一方面调用以太网协议指令数据库中的来配置连接信息第二方面调用以太网协议指令数据库中的TDC,TSC,TWC,TRC,进行初始赋值,得到赋值后的仿真配置信息 Described node and link attribute configuration module (10) call in the Ethernet protocol command database in the first aspect to configure connection information The second aspect calls the Ethernet protocol instruction database TD C ,TS C ,TW C ,TR C , Perform initial assignment to obtain the simulation configuration information after assignment 为节点间的物理连接,任意一节点的标识号记为node; is the physical connection between nodes, and the identification number of any node is marked as node; 为运行仿真系统时设置的时钟精度; The clock precision set when running the simulation system; 为运行仿真系统时设置的集成周期长度; is the integration cycle length set when running the simulation system; 为运行仿真系统时设置的最大集成周期个数; is the maximum number of integration cycles set when running the simulation system; 为运行仿真系统时设置的网络容错个数; It is the number of network fault tolerance set when running the simulation system; TDC为派发延迟时间;TD C is the distribution delay time; TSC为发送延迟时间;TS C is the transmission delay time; TWC为线上传输延迟时间;TW C is the online transmission delay time; TRC为接收延迟时间;TR C is the receiving delay time; 为数据传输最大延迟时间; is the maximum delay time of data transmission; 为运行仿真系统时设置的时钟漂移; is the clock drift set when running the simulation system; 所述同步拓扑生成模块(20)第一方面用于接收第二方面调用以太网协议指令数据库中的节点角色BUser按照同步化方式进行节点角色配置得到同步拓扑结构。The first aspect of the synchronous topology generating module (20) is used for receiving The second aspect calls the node role B User in the Ethernet protocol command database and Configure node roles in a synchronized manner Get a synchronous topology. 2.根据权利要求1所述的模拟交换式以太网时钟同步的仿真系统,其特征在于:状态转换模块(40)接收到状态管理模块(30)传递的信息后:2. the emulation system of analog switched Ethernet clock synchronization according to claim 1 is characterized in that: after the state transition module (40) receives the information that the state management module (30) transmits: 同步控制器SMB在节点启动后,首先进入集成状态,判断A定时TA内是否收到数据帧,如果收到,则继续判断其类型;如果没有收到则进入异步状态;如果收到的数据帧类型为IN帧,则继续判断节点的本地成员值是否达到状态门限值如果不是IN帧,则判断是否为CA帧;对于上述收到的PCF是IN帧的情况,如果节点的本地成员值达到状态门限值则进入同步状态;如果不是,则进入等待状态;对于上述收到的数据帧不是IN帧的情况,如果收到的PCF是CA帧,则进入等待状态;如果不是,则进入非同步状态;After the node is started, the synchronous controller SM B first enters the integration state, and judges whether A receives a data frame within the timing T A , and if it receives it, continues to judge its type; if it does not receive it, it enters the asynchronous state; if it receives If the data frame type is an IN frame, continue to judge whether the local member value of the node reaches the state threshold If it is not an IN frame, then judge whether it is a CA frame; for the above-mentioned situation where the received PCF is an IN frame, if the local member value of the node reaches the state threshold value Then enter the synchronous state; if not, then enter the waiting state; for the above-mentioned situation that the received data frame is not an IN frame, if the received PCF is a CA frame, then enter the waiting state; if not, then enter the asynchronous state; 对于在异步状态的状态转换:同样判断是否在B定时TB收到数据帧,如果收到,则进一步判断收到的数据帧类型;如果没有收到,则仍停留在异步状态;如果为CA帧,则进入等待状态;如果不是,则进一步判断是否为CS帧;如果是CS帧,则进入FLOOD状态;如果不是,即为IN帧,则进入同步状态;For the state transition in the asynchronous state: also judge whether the data frame is received at B timing TB, if received, then further judge the type of the received data frame; if not received, then still stay in the asynchronous state; if it is CA frame, enter the waiting state; if not, further judge whether it is a CS frame; if it is a CS frame, enter the FLOOD state; if not, it is an IN frame, then enter the synchronization state; 对于等待状态的状态转换:同样判断是否E在定时TE内收到数据帧,如果收到,则仍停留在等待状态,如果不是,则判断节点的本地成员值是否达到状态门限值如果节点本地成员值达到状态门限值则进入同步状态;如果没有达到状态门限值则进入异步状态;For the state transition of the waiting state: it is also judged whether E receives the data frame within the timing TE, if it is received, it still stays in the waiting state, if not, then judges whether the local member value of the node reaches the state threshold If the node's local membership value reaches the status threshold Then enter the synchronization state; if the state threshold is not reached Then enter the asynchronous state; 对于在FLOOD状态的状态转换:同样判断是否在在状态管理模块(30)中的定时时长内收到PCF,如果收到,则继续判断接收到的PCF的类型;如果没有收到,则判断是否满足配置信息条件;对于上述规定时间内收到PCF的情况,继续判断接收到的PCF是否为CS帧;如果是,则继续保持在FLOOD状态;如果不是,则判断是否为CA帧;如果是CA帧,则进入等待状态;如果不是,则判断是否满足配置信息条件;对于上述没有在状态管理模块(30)中的定时时长内接收到PCF的情况,如果满足配置信息条件,则进入异步状态,如果不满足,则仍停留在FLOOD状态;所述定时时长和配置信息条件依据状态管理模块(30)中FLOOD状态下中而定;For the state transition in the FLOOD state: judge whether to receive PCF equally in the timing duration in state management module (30), if receive, then continue to judge the type of the PCF that receives; If not received, then judge whether Satisfy the configuration information conditions; for the PCF received within the specified time, continue to judge whether the received PCF is a CS frame; if yes, continue to maintain the FLOOD state; if not, judge whether it is a CA frame; Frame, then enter waiting state; If not, then judge whether to satisfy configuration information condition; For above-mentioned situation that does not receive PCF in the timing duration in state management module (30), if satisfy configuration information condition, then enter asynchronous state, If not satisfied, then still stay in the FLOOD state; said timing duration and configuration information condition are based on the FLOOD state in the state management module (30) depends on; 对于在同步状态的状态转换:对是否检测出结团情况和数据接收队列Qrecv是否收到CA帧进行判断,如果检测出现了结团的情况,则进入异步状态;如果没有,则继续保持在同步状态;如果接收到CA帧,则进入等待状态;如果没有,则保持在同步状态;为同步控制器SMB在集成状态的执行行为;For the state transition in the synchronous state: judge whether the clumping situation is detected and whether the data receiving queue Q recv receives the CA frame, if the clumping situation is detected, enter the asynchronous state; if not, continue to keep in the synchronous state state; if a CA frame is received, it enters a waiting state; if not, it remains in a synchronous state; is the execution behavior of the synchronization controller SM B in the integrated state; 压缩控制器CMB在节点启动后,首先进入集成状态,判断在状态处理模块(30)中的定时时长D定时TD内是否收到新成员的大小达到状态门限值的IN帧,如果是,则进入同步状态;否则,进入异步状态;对于在异步状态的状态转换:首先判断是否收到CS帧或者新成员的值大于状态门限值的CA帧,如果是,则进入使能状态;如果不是,则继续判断是否收到新成员的大小达到状态门限值的IN帧;如果收到新成员的大小达到状态门限值的IN帧,则进入同步状态;如果没有收到,则仍停留在异步状态;对于在使能状态的状态转换:判断F定时TF内是否收到数据帧,如果是,则仍停留在使能状态;如果不是,则进入等待状态;对于在等待状态的状态转换:判断G定时TG内是否收到新成员的大小达到状态门限值的IN帧,如果是,则进入同步状态;如果不是,则进入异步状态;对于在同步状态的状态转换:对是否出现结团状况进行检测,如果出现结团状况,则进入集成状态;如果没有,则仍停留在同步状态;After the node starts, the compression controller CM B first enters the integration state, and judges whether the size of the new member received in the state processing module (30) reaches the state threshold value in the time duration D and time T D If it is an IN frame, enter the synchronous state; otherwise, enter the asynchronous state; for the state transition in the asynchronous state: first determine whether the CS frame is received or the value of the new member is greater than the state threshold CA frame, if it is, enter the enable state; if not, continue to judge whether the size of the received new member reaches the state threshold IN frame; if the size of the received new member reaches the status threshold If it does not receive the IN frame, it will enter the synchronous state; if it is not received, it will still stay in the asynchronous state; for the state transition in the enabled state: judge whether the data frame is received in the F timing TF, if it is, it will still stay in the enabled state. If not, then enter the waiting state; for the state transition in the waiting state: judge whether the size of the new member received in G timing T G reaches the state threshold value IN frame, if it is, then enter the synchronous state; if not, then enter the asynchronous state; for the state transition in the synchronous state: detect whether there is agglomeration, if there is agglomeration, then enter the integrated state; if not , it still stays in the synchronous state; 同步客户端SCB在节点启动后,首先进入集成状态,判断是否收到新成员的大小达到状态门限值的IN帧,如果是,即转换进入同步状态;否则,仍停留在集成状态;对于在同步状态的状态转换:对是否出现结团状况进行检测,如果出现结团状况,则进入集成状态;如果没有,则仍停留在同步状态。After the node is started, the synchronization client SC B first enters the integration state, and judges whether the size of the new member received reaches the state threshold IN frame of IN frame, if it is, that is, the conversion enters the synchronous state; otherwise, it still stays in the integrated state; for the state transition in the synchronous state: detect whether there is agglomeration situation, if there is an agglomeration situation, then enter the integrated state; if If not, it remains in sync. 3.根据权利要求1所述的模拟交换式以太网时钟同步的仿真系统,其特征在于:数据帧生成单元(601)第一方面依据数据帧传输角色MBUser={SSMB,SCMB,DSMB,DCMB,DSCB,MSCB}中的SSMB,SCMB来动态生成协议控制帧FR;第二方面依据状态信息及状态行为信息动态地生成协议控制帧PCF;3. the emulation system of analog switched Ethernet clock synchronization according to claim 1 is characterized in that: the first aspect of data frame generation unit (601) is based on data frame transmission role MB User ={SSM B , SCM B , DSM B , DCM B , DSC B , MSC B } in SSM B , SCM B to dynamically generate the protocol control frame FR; the second aspect is to dynamically generate the protocol control frame PCF according to the state information and state behavior information; SSMB为用于传输数据帧的同步控制器作为源节点;SSM B is a synchronization controller used to transmit data frames as a source node; SCMB为用于传输数据帧的压缩控制器作为源节点;SCM B is a compression controller used to transmit data frames as a source node; DSMB为用于传输数据帧的同步控制器作为目的节点;DSM B is a synchronization controller used to transmit data frames as a destination node; DCMB为用于传输数据帧的压缩控制器作为目的节点;DCM B is a compression controller used to transmit data frames as a destination node; DSCB为用于传输数据帧的同步客户端作为目的节点;DSC B is a synchronization client for transmitting data frames as a destination node; MSCB为用于传输数据帧的同步客户端作为中间节点;MSC B is a synchronization client for transmitting data frames as an intermediate node; 数据帧发送单元(602)第一方面依据数据帧传输角色MBUser={SSMB,SCMB,DSMB,DCMB,DSCB,MSCB}中的MSCB来转发数据帧接收单元(603)接收的数据帧;然后执行第四和第五方面;第二方面依据数据帧传输角色MBUser={SSMB,SCMB,DSMB,DCMB,DSCB,MSCB}中的SSMB,SCMB来接收数据帧生成单元(601)输出的FR;第三方面,记录FR的发送时刻点第四方面,并将FR添加到节点的数据发送队列Qsend中;第五方面,记录数据派发延迟时间TDC和发送延迟时间TSC,并更改FR中透明时钟的值;然后,依据数据派发延迟时间TDC、发送延迟时间TSC和公式得到离开数据帧发送单元(602)的透明时钟 The first aspect of the data frame sending unit (602) forwards the data frame receiving unit (603) according to MSC B in the data frame transmission role MB User ={SSM B , SCM B , DSM B , DCM B , DSC B , MSC B } Received data frame; then perform the fourth and fifth aspects; the second aspect is based on the data frame transmission role MB User = SSM B , SCM in {SSM B , SCM B , DSM B , DCM B , DSC B , MSC B } B to receive the FR output by the data frame generating unit (601); in the third aspect, record the sending time point of FR In the fourth aspect, add FR to the node’s data sending queue Q send ; in the fifth aspect, record the data dispatch delay time TD C and send delay time TS C , and change the transparent clock in FR value; then, according to the data distribution delay time TD C , sending delay time TS C and the formula Obtain the transparent clock leaving the data frame sending unit (602) 数据帧接收单元(603)用于接收数据帧发送单元(602)发送的数据帧FR,并将接收到的数据帧存放入数据接收队列QVLrecv;第一方面,判断节点的VL接收队列QVLrecv是否为空,如果不为空,则说明接收到了数据帧,如果为空,则返回初始状态,等待数据帧的到达;第二方面,对于上述VL接收队列QVLrecv非空的情况,首先判断接收到的是否是有效的数据帧,如果是,则对数据帧进行信息提取处理;如果不是,则触发故障检测与处理模块(70)做丢弃处理;所述信息提取处理是提取源节点和目的节点地址信息,记录接收时刻点Tr,记录由上一节点发送到当前节点的过程中节点间的线上传输延迟时间TWC,接收延迟时间TRC,更改透明时钟值所述更改透明时钟值的方式为依据线上传输延迟时间TWC、接收延迟时间TRC和公式得到离开数据帧接收单元(603)的透明时钟值第三方面进行下述操作;依据第二方面所提取的源节点和目的节点地址信息,和数据帧传输角色MBUser={SSMB,SCMB,DSMB,DCMB,DSCB,MSCB}中的DSMB,DCMB判断当前节点是否为与目的节点地址信息一致的目的节点,如果是,则说明数据帧传输已完成,并将数据帧FR和接收到FR的接收时刻点Tr存放入节点的数据接收队列Qrecv中,触发数据帧固化单元(604),开始进行对其进行固化操作;如果不是目的节点,则将数据帧FR传递给当前节点的数据帧发送单元(602),继续数据发送过程,向目的节点发送数据帧FR;The data frame receiving unit (603) is used to receive the data frame FR sent by the data frame sending unit (602), and deposits the received data frame into the data receiving queue Q VLrecv ; in the first aspect, judge the VL receiving queue Q VLrecv of the node Is it empty? If it is not empty, it means that the data frame has been received. If it is empty, it will return to the initial state and wait for the arrival of the data frame; in the second aspect, for the above-mentioned VL receiving queue Q VLrecv is not empty, first judge the reception Arrived whether it is an effective data frame, if so, then carry out information extraction processing to data frame; If not, then trigger fault detection and processing module (70) to do discarding processing; Described information extraction processing is to extract source node and destination node Address information, record the receiving time point T r , record the online transmission delay time TW C between nodes in the process of sending from the previous node to the current node, receive delay time TR C , change the transparent clock value The method of changing the transparent clock value is based on the online transmission delay time TW C , the reception delay time TR C and the formula Get the transparent clock value leaving the data frame receiving unit (603) The third aspect performs the following operations; according to the source node and destination node address information extracted in the second aspect, and the data frame transmission role MB User ={SSM B , SCM B , DSM B , DCM B , DSC B , MSC B } DSM B and DCM B in DSM B judge whether the current node is the destination node consistent with the address information of the destination node, if yes, it means that the data frame transmission has been completed, and store the data frame FR and the receiving time point T r of the received FR into In the data receiving queue Q recv of the node, trigger the data frame curing unit (604), start to carry out its curing operation; if it is not the destination node, then pass the data frame FR to the data frame sending unit (602) of the current node, continue Data sending process, sending data frame FR to the destination node; 数据帧固化单元(604)实现对目的节点接收到的数据帧FR进行重排的功能;通过数据帧固化单元(604),目的节点可以获得按照源节点发送时间顺序排列的一组数据帧;第一方面,对节点的数据接收队列Qrecv进行判断,判断节点是否接收到了数据帧,如果接收到即数据接收队列Qrecv不为空,则开始对接收到的数据帧的时刻点Tr进行处理,取出数据接收队列中头部成员,对其进行固化操作,以获得固化时刻点Tp;如果为空,则返回初始状态,并继续等待数据接收队列Qrecv不为空的情况;第二方面,对于数据接收队列Qrecv不为空的情况,首先判断根据数据帧FR中的帧类型部分判断是否为IN帧,如果是,则将固化好的IN帧和其固化时刻点Tp按照固化时刻点的顺序存放入节点的数据固化队列Qperm;如果不是,则不予处理;第三方面,对于数据接收队列Qrecv中数据帧的类型是IN帧的情况,再根据节点的角色类型BUser进行选择,如果节点角色为压缩控制器,则进入数据帧压缩单元(605),开始数据压缩操作的过程;否则,即节点角色为同步控制器或者同步客户端,则进入时钟修正模块(80),开始修正节点的本地时钟;The data frame curing unit (604) realizes the function of rearranging the data frame FR received by the destination node; through the data frame curing unit (604), the destination node can obtain a group of data frames arranged according to the sending time order of the source node; the second On the one hand, judge the data receiving queue Q recv of the node to judge whether the node has received the data frame, if it is received, that is, the data receiving queue Q recv is not empty, start processing the time point T r of the received data frame , take out the head member in the data receiving queue, and perform curing operations on it to obtain the curing time point T p ; if it is empty, return to the initial state and continue to wait for the data receiving queue Q recv to be not empty; the second aspect , for the case that the data receiving queue Q recv is not empty, first judge whether it is an IN frame according to the frame type part in the data frame FR, and if it is, the cured IN frame and its curing time point T p are determined according to the curing time The order of the points is stored in the data curing queue Q perm of the node; if not, it will not be processed; in the third aspect, if the type of the data frame in the data receiving queue Q recv is an IN frame, then according to the role type B User of the node Select, if the node role is a compression controller, then enter the data frame compression unit (605), and start the process of data compression operation; otherwise, that is, the node role is a synchronization controller or a synchronization client, then enter the clock correction module (80) , start to correct the local clock of the node; 数据帧压缩单元(605)主要实现对数据帧的固化时间点进行压缩的功能,是整个网络建立全局的时间基准中的很重要的单元;第一方面,数据帧压缩单元(605)依据由数据帧固化单元(604)获得的固化后的数据帧FR进行收集操作;第二方面,当收集过程结束后,开始进入计算阶段;依据收集过程中收集到的固化时刻点Tp-i计算压缩修正值第三方面,依据第二方面计算得到的压缩修正值计算压缩时刻点 The data frame compression unit (605) mainly realizes the function of compressing the curing time point of the data frame, and is a very important unit in the whole network to establish a global time reference; in the first aspect, the data frame compression unit (605) is based on data The frame curing unit (604) collects the cured data frame FR obtained by the frame curing unit (604); in the second aspect, when the collection process ends, it starts to enter the calculation stage; calculate the compression correction value according to the curing time point T pi collected during the collection process In the third aspect, the compression correction value calculated according to the second aspect Calculate the compression time point 4.根据权利要求1所述的模拟交换式以太网时钟同步的仿真系统,其特征在于:所述故障检测与处理模块(70)实现对数据帧校验并进行错误处理、对结团的情况进行检测与处理、对仿真系统软件运行状况的检测与对错误的处理的功能;4. the emulation system of analog switched Ethernet clock synchronization according to claim 1, is characterized in that: described fault detection and processing module (70) realizes data frame verification and carries out error handling, to the situation of clumping The functions of detection and processing, detection of the operating status of the simulation system software and processing of errors; 数据帧校验错误处理单元(701):当目的节点接收到数据帧时,判断数据帧格式是否正确,如果错误,则进入这个单元,对于错误的数据帧直接进行丢弃处理;Data frame verification error processing unit (701): when the destination node receives the data frame, it is judged whether the format of the data frame is correct, if it is wrong, it enters this unit, and directly discards the erroneous data frame; 同步结团检测与处理单元(702):检测交换式以太网中可能出现的结团状况,以防止出现交换式以太网中出现部分节点同步的情况;A synchronous clustering detection and processing unit (702): detects a possible clustering condition in the switched Ethernet, so as to prevent the synchronization of some nodes in the switched Ethernet; 第一方面,同步结团检测与处理单元(702)在数据帧选择单元(801)结束后依据数据帧选择单元(801)所选择的最优数据帧内部的新成员的值对结团状况进行检测;In the first aspect, after the end of the data frame selection unit (801), the synchronous clumping detection and processing unit (702) performs the clumping condition according to the value of the new member in the optimal data frame selected by the data frame selection unit (801). detection; 其中,每个节点中存有一个本地变量Msync,用来记录数据帧选择单元(801)所选择的最优数据帧内部的新成员的值;Wherein, a local variable M sync is stored in each node, which is used to record the value of the new member inside the optimal data frame selected by the data frame selection unit (801); 第二方面,同步结团检测与处理单元(702)将同步结团检测的结果,即上述新成员的大小Msync,与状态门限值或状态门限值或状态门限值进行比较,从而将作出的处理决定转换给状态管理模块(30);由状态管理模块(30)作用于状态转换模块(40)对节点状态进行转换;一般的,如果同步结团检测成功,则说明出现结团的状态,即说明同步出现了问题,开始汇报给状态管理模块(30),状态管理模块(30)触发状态转换模块(40)将节点状态退回为非同步的状态,等待合适的时机重新发起同步;In the second aspect, the synchronous clumping detection and processing unit (702) combines the result of the synchronous clumping detection, that is, the size M sync of the above-mentioned new member, with the state threshold or state threshold or state threshold Compare, thereby the processing decision that will make is converted to state management module (30); Act on state conversion module (40) by state management module (30) and node state is converted; Generally, if synchronous clumping detects success, then Explain that the state of clustering occurs, that is, there is a problem in the synchronization, and it starts to report to the state management module (30), and the state management module (30) triggers the state transition module (40) to return the node state to an asynchronous state, waiting for a suitable Time to re-initiate synchronization; 异步结团检测与处理单元(703):检测网络中可能出现的结团状况,以防止出现网络中部分节点同步的情况;Asynchronous clustering detection and processing unit (703): detect possible clustering conditions in the network, so as to prevent synchronization of some nodes in the network; 第一方面,利用一个大小为(2)的数组Masync[2]记录不同周期内预期外的数据帧的个数;所述预期外的数据帧即指在数据选择窗口中未能接收到的数据帧和在数据选择窗口中接收到的但是数据帧中集成周期数目与当前节点的集成周期不一致的数据帧;利用Masync[偶数]记录偶数集成周期预期外的数据帧个数,利用Masync[奇数]记录奇数集成周期预期外的数据帧个数;在整个集成周期内,异步结团检测都始终执行;In the first aspect, use a size to be (2) array M async [2] to record the number of unexpected data frames in different cycles; the unexpected data frames refer to those that fail to receive in the data selection window The data frame and the data frame received in the data selection window but the number of integration cycles in the data frame is inconsistent with the integration cycle of the current node; use M async [even number] to record the unexpected number of data frames in the even integration cycle, use M async [Odd number] Record the number of unexpected data frames in the odd-numbered integration cycle; throughout the entire integration cycle, asynchronous cluster detection is always performed; 第二方面,对于角色配置为同步控制器和同步客户端的节点,在数据帧派发时刻点依据所记录的预期外的数据帧个数Masync[偶数]或Masync[奇数]与状态门限值进行比较;对于角色配置为压缩控制器的节点,在数据帧选择单元(801)结束后,依据所记录的预期外的数据帧个数Masync[偶数]或Masync[奇数]与状态门限值进行比较,如果预期外的数据帧个数Masync[偶数]或Masync[奇数]大于状态门限值,则说明异步结团检测成功,即同步出现了问题,开始汇报给状态管理模块(30),状态管理模块(30)触发状态转换模块(40)将节点状态退回为非同步的状态,等待合适的时机重新发起同步;In the second aspect, for nodes whose role is configured as a synchronization controller and a synchronization client, at the time point of data frame distribution According to the number of unexpected data frames recorded M async [even number] or M async [odd number] and the state threshold Compare; For the node that role is configured as a compression controller, after the data frame selection unit (801) ends, according to the recorded unexpected number of data frames M async [even number] or M async [odd number] and the state threshold value For comparison, if the unexpected number of data frames M async [even number] or M async [odd number] is greater than the state threshold value, it means that the asynchronous cluster detection is successful, that is, there is a problem in synchronization, and it starts to report to the state management module (30 ), the state management module (30) triggers the state transition module (40) to return the node state to an asynchronous state, waiting for an appropriate opportunity to re-initiate synchronization; 软件异常处理单元(704):这一单元主要处理软件出现异常时的各种情况,当软件出现异常时,会利用这一单元进行报警,报出错误原因,并且显示给用户,便于用户得知出错情况,同时,也会切换到结果输出模块(50),输出相应结果,并自动终止软件运行过程。Software exception processing unit (704): This unit mainly deals with various situations when the software is abnormal. When the software is abnormal, it will use this unit to alarm, report the cause of the error, and display it to the user, so that the user can know In the case of an error, at the same time, it will also switch to the result output module (50), output the corresponding result, and automatically terminate the software running process. 5.根据权利要求1所述的模拟交换式以太网时钟同步的仿真系统,其特征在于:时钟修正模块(80)实现对节点的本地时钟进行修正的功能,对由数据处理模块(60)获得的数据帧信息进行处理,从而对本地时钟进行修正;修正结束后将修正结果和完成修正的时刻点传递给状态管理模块(30);5. the emulation system of analog switched Ethernet clock synchronization according to claim 1, is characterized in that: clock correction module (80) realizes the function that the local clock of node is revised, to obtained by data processing module (60) Process the data frame information of the local clock, thereby correcting the local clock; after the correction is completed, the correction result and the time point of completing the correction are passed to the state management module (30); 对于目的节点角色配置为同步控制器或同步客户端的情况,当数据帧固化单元(604)执行结束后,开始进入时钟修正模块(80)里的数据帧选择单元(801);第一方面,对于节点所连接的每条信道,首先判断节点的数据固化队列Qperm是否为空,如果为空,则返回数据帧固化单元(604),等待接收固化好的IN帧;如果不为空,则取出数据固化队列Qperm的首元素Qperm[0],记录其固化时刻点Tp;第二方面,对于数据固化队列Qperm不为空的情况,判断所获得的固化后的IN帧的固化时刻点Tp是否在节点的接收窗口范围内并进一步判断该固化后的IN帧的集成周期与节点当前集成周期是否一致,如果是,则说明是可以利用的有效IN帧,继续判断是否是接收窗口内接收到的第一个的IN帧;如果不是,则触发故障检测与处理模块(703);第三方面,依据第二方面接收窗口范围内的IN帧和最佳数据帧选择方法,选择出该信道的最佳数据帧FRbest-j;第四方面,将所选择的最佳IN帧FRbest-j以及FRbest-j的固化时刻点Tp-best-j存放入数据收集队列Qcoll,并对节点的当前集成周期重新赋值;如果所获得的固化后的IN帧不在接收窗口范围内或者在接收窗口内但该固化后的IN帧的集成周期与节点当前集成周期是否一致,则触发故障检测与处理模块(703)。For the situation that the destination node role is configured as a synchronous controller or a synchronous client, after the execution of the data frame solidification unit (604), start to enter the data frame selection unit (801) in the clock correction module (80); in the first aspect, for Each channel connected to the node first judges whether the data solidification queue Q perm of the node is empty, if empty, then returns to the data frame solidification unit (604), and waits to receive the solidified IN frame; if not empty, then take out The first element Q perm [0] of the data curing queue Q perm , record its curing time point T p ; second aspect, for the situation that the data curing queue Q perm is not empty, judge the curing time of the obtained IN frame after curing Whether the point T p is within the receiving window range of the node and further judge whether the integration period of the solidified IN frame is consistent with the current integration period of the node, if yes, it means that it is a valid IN frame that can be used, and continue to judge whether it is a receiving window In the first IN frame that receives in; If not, then trigger fault detection and processing module (703); The third aspect, according to the IN frame and the best data frame selection method in the receiving window range of the second aspect, select out The best data frame FR best-j of this channel; In the fourth aspect, the selected best IN frame FR best-j and the curing time point T p-best- j of FR best- j are stored in the data collection queue Q coll , and re-assign the current integration period of the node; if the obtained solidified IN frame is not within the receiving window range or within the receiving window but the integration period of the solidified IN frame is consistent with the current integration period of the node, trigger A fault detection and processing module (703). 6.根据权利要求1所述的模拟交换式以太网时钟同步的仿真系统,其特征在于:时钟修正模块(80)实现对节点的本地时钟进行修正的功能,对由数据处理模块(60)获得的数据帧信息进行处理,从而对本地时钟进行修正;修正结束后将修正结果和完成修正的时刻点传递给状态管理模块(30);6. the emulation system of analog switched Ethernet clock synchronization according to claim 1, is characterized in that: clock correction module (80) realizes the function that the local clock of node is revised, to obtained by data processing module (60) Process the data frame information of the local clock, thereby correcting the local clock; after the correction is completed, the correction result and the time point of completing the correction are passed to the state management module (30); 对于目的节点角色配置为压缩控制器的情况,当数据帧压缩单元(605)执行结束后,开始进入时钟修正模块(80)里的数据帧选择单元(801);第一方面,判断节点的数据压缩队列Qcomp是否为空,如果为空,则返回数据帧压缩单元(605),等待接收压缩好的数据帧;如果不为空,则取出数据压缩队列Qcomp的首元素Qcomp[0],记录其固化时刻点Tq;第二方面,对于数据压缩队列Qcomp不为空的情况,判断所获得的数据帧的压缩时刻点Tq是否在节点的接收窗口范围内并进一步判断该固化后的IN帧的集成周期与节点当前集成周期是否一致,如果是,则说明是可以利用的有效IN帧,判断是否是接收窗口内接收到的第一个的IN帧;如果不是,则触发故障检测与处理模块(703);第三方面,依据第二方面接收窗口范围内的IN帧和最佳数据帧选择方法,选择出信道的最佳数据帧FRbest;第四方面,将所选择的最佳的IN帧FRbest以及FRbest的压缩时刻点Tq-best存放入数据收集队列Qcoll,并对节点的当前集成周期重新赋值;如果所获得的压缩后的IN帧不在接收窗口范围内或者在接收窗口内但该固化后的IN帧的集成周期与节点当前集成周期是否一致,则触发故障检测与处理模块(703)。For the situation that the destination node role is configured as a compression controller, after the execution of the data frame compression unit (605), start to enter the data frame selection unit (801) in the clock correction module (80); Whether the compressed queue Q comp is empty, if empty, then return to the data frame compression unit (605), waiting to receive the compressed data frame; if not empty, then take out the first element Q comp [0] of the data compressed queue Q comp , record its curing time point T q ; secondly, for the data compression queue Q comp is not empty, judge whether the compression time point T q of the obtained data frame is within the receiving window range of the node and further judge the curing time point T q Whether the integration period of the last IN frame is consistent with the current integration period of the node, if yes, it means that it is a valid IN frame that can be used, and judge whether it is the first IN frame received in the receiving window; if not, trigger a fault Detection and processing module (703); In the third aspect, according to the IN frame and the best data frame selection method in the receiving window range of the second aspect, select the best data frame FR best of the channel; in the fourth aspect, the selected The best IN frame FR best and the compression time point T q-best of FR best are stored in the data collection queue Q coll , and the current integration cycle of the node is reassigned; if the obtained compressed IN frame is not within the receiving window range Or within the receiving window but whether the integration period of the solidified IN frame is consistent with the current integration period of the node, trigger the fault detection and processing module (703). 7.根据权利要求1所述的模拟交换式以太网时钟同步的仿真系统,其特征在于:时钟修正模块(80)实现对节点的本地时钟进行修正的功能,对由数据处理模块(60)获得的数据帧信息进行处理,从而对本地时钟进行修正;修正结束后将修正结果和完成修正的时刻点传递给状态管理模块(30);7. the emulation system of analog switched Ethernet clock synchronization according to claim 1, is characterized in that: clock correction module (80) realizes the function that the local clock of node is revised, to obtained by data processing module (60) Process the data frame information of the local clock, thereby correcting the local clock; after the correction is completed, the correction result and the time point of completing the correction are passed to the state management module (30); 对于目的节点角色配置为同步控制器或同步客户端的情况:首先,利用下式计算出预计接收的时刻点Tschd每个节点在预计接收时刻点Tschd附近开启一个长度为的接收窗口,即接收窗口范围为当接收到数据帧固化单元(604)固化好的IN帧后,开始判断IN帧的固化时刻点Tp是否在接收窗口的范围内,如果是则继续对其进行操作,如果未在接收窗口范围内,则丢弃IN帧;For the case where the role of the destination node is configured as a synchronous controller or a synchronous client: first, use the following formula to calculate the expected receiving time point T schd : Each node opens a network with a length of The receiving window of , that is, the receiving window range is After receiving the IN frame solidified by the data frame solidification unit (604), start to judge whether the solidification time point T p of the IN frame is within the scope of the receiving window, if so, continue to operate it, if not within the scope of the receiving window , the IN frame is discarded; 表示FR的发送时刻点; Indicates the sending time point of FR; 表示数据传输最大延迟时间; Indicates the maximum delay time of data transmission; 表示依据固化时刻点计算的压缩修正值; Indicates the compression correction value calculated based on the curing time point; TDC表示派发延迟时间。TD C represents the dispatch delay time. 8.根据权利要求1所述的模拟交换式以太网时钟同步的仿真系统,其特征在于:时钟修正模块(80)实现对节点的本地时钟进行修正的功能,对由数据处理模块(60)获得的数据帧信息进行处理,从而对本地时钟进行修正;修正结束后将修正结果和完成修正的时刻点传递给状态管理模块(30);8. the emulation system of analog switched Ethernet clock synchronization according to claim 1, is characterized in that: clock correction module (80) realizes the function that the local clock of node is revised, to obtained by data processing module (60) Process the data frame information of the local clock, thereby correcting the local clock; after the correction is completed, the correction result and the time point of completing the correction are passed to the state management module (30); 对于目的节点配置为压缩控制器的情况,当数据帧压缩单元(605)执行结束后,开始进入时钟修正模块(80)里的数据帧选择单元(801);首先,利用下式计算节点预计接收到IN帧的时刻点,Tschd每个节点在预计接收时刻点附近开启一个长度为的接收窗口,即接收窗口范围为当接收到数据帧压缩单元(605)压缩好的IN帧后,开始判断IN帧的时间是否在接收窗口的范围内,如果是则继续对其进行操作,如果未在接收窗口范围内,则丢弃IN帧。For the situation that the destination node is configured as a compression controller, after the data frame compression unit (605) executes, it starts to enter the data frame selection unit (801) in the clock correction module (80); at first, use the following formula to calculate the expected reception of the node To the point in time of the IN frame, T schd : Each node opens a network with a length of The receiving window of , that is, the receiving window range is After receiving the IN frame compressed by the data frame compression unit (605), start to judge whether the time of the IN frame is within the scope of the receiving window, if so, continue to operate it, if not within the scope of the receiving window, then discard IN frame. 9.根据权利要求1所述的模拟交换式以太网时钟同步的仿真系统,其特征在于:时钟修正模块(80)实现对节点的本地时钟进行修正的功能,对由数据处理模块(60)获得的数据帧信息进行处理,从而对本地时钟进行修正;修正结束后将修正结果和完成修正的时刻点传递给状态管理模块(30);9. the emulation system of analog switched Ethernet clock synchronization according to claim 1, is characterized in that: clock correction module (80) realizes the function that the local clock of node is revised, to obtained by data processing module (60) Process the data frame information of the local clock, thereby correcting the local clock; after the correction is completed, the correction result and the time point of completing the correction are passed to the state management module (30); 对于目的节点配置为同步控制器或同步客户端的情况,第一方面,依据数据帧选择单元(801)中获取的数据收集队列Qcoll进行判断;判断数据收集队列Qcoll是否为空,如果为空,则说明各个节点间的时钟偏差太大,暂不执行操作,进入等待状态;如果不为空,则利用数据收集队列Qcoll中所收集到的最佳帧的固化时刻点Tp-best-j来对时钟修正值进行计算;第二方面,利用公式计算时钟修正值并将时钟修正值传递给时钟修正执行单元(803)。For the situation that the destination node is configured as a synchronous controller or a synchronous client, in the first aspect, judge according to the data collection queue Q coll obtained in the data frame selection unit (801); judge whether the data collection queue Q coll is empty, if empty , it means that the clock deviation between each node is too large, do not execute the operation temporarily, and enter the waiting state; if it is not empty, use the curing time point T p-best- of the best frame collected in the data collection queue Q coll j to calculate the clock correction value; second aspect, using the formula Calculating Clock Correction Values and correct the clock value Pass it to the clock correction execution unit (803). 10.根据权利要求1所述的模拟交换式以太网时钟同步的仿真系统,其特征在于:时钟修正模块(80)实现对节点的本地时钟进行修正的功能,对由数据处理模块(60)获得的数据帧信息进行处理,从而对本地时钟进行修正;修正结束后将修正结果和完成修正的时刻点传递给状态管理模块(30);10. the emulation system of analog switched Ethernet clock synchronization according to claim 1, is characterized in that: clock correction module (80) realizes the function that the local clock of node is revised, to obtained by data processing module (60) Process the data frame information of the local clock, thereby correcting the local clock; after the correction is completed, the correction result and the time point of completing the correction are passed to the state management module (30); 对于目的角色配置为压缩控制器的情况,由于在每一条信道中默认只配置一个压缩控制器,所以,不存在对于同步控制器中存在的信道选择的问题,数据收集队列中最多只会收集到一个数据元素,所以可以直接利用这个最佳的数据元素,获得这个最佳的数据元素中所带有的压缩时刻点的时间Tq-best,之后计算时钟修正值 并将时钟修正值传递给时钟修正执行单元(803);第一方面,时钟修正执行单元(803)依据数据帧选择单元传递的Tschd和计算时延值获得时钟修正时刻点Tclock-corr,并从时钟修正时刻点Tclock-corr开始修正本地时钟tlocal;第二方面,节点在时钟修正时刻点Tclock-corr,对本地时钟tlocal做大小为的修正,修正后的本地时钟记为Dtlocal,则时钟值为第三方面,对于目的节点角色配置为压缩控制器的情况,时钟修正执行单元(803)在对时钟修正结束后,在Tq-best时刻重新进入数据帧生成单元(601),生成由压缩控制器作为源节点的数据帧。For the case where the destination role is configured as a compression controller, since only one compression controller is configured in each channel by default, there is no problem of channel selection in the synchronization controller, and the data collection queue will only collect at most A data element, so the best data element can be directly used to obtain the time T q-best of the compression time point contained in the best data element, and then calculate the clock correction value and correct the clock value Delivered to the clock correction execution unit (803); in the first aspect, the clock correction execution unit (803) transmits the T schd and the calculation delay value according to the data frame selection unit Obtain the clock correction time point T clock-corr , and start to correct the local clock t local from the clock correction time point T clock-corr ; secondly, at the clock correction time point T clock-corr , the node makes a size for the local clock t local , and the revised local clock is recorded as Dt local , then the clock value is In the third aspect, for the case where the role of the destination node is configured as a compression controller, the clock correction execution unit (803) re-enters the data frame generation unit (601) at T q-best time after the clock correction is completed, and generates device as the data frame of the source node. 11.根据权利要求1所述的模拟交换式以太网时钟同步的仿真系统,其特征在于状态管理模块(30)对状态的管理为:11. the emulation system of analog switched Ethernet clock synchronization according to claim 1, is characterized in that state management module (30) is to the management of state: 第一方面,依据同步拓扑生成模块(20)的D20、状态转换模块(40)、数据处理模块(60)、故障检测与处理模块(70)和时钟修正模块(80)中的信息,综合分析,生成与状态转换模块(40)中的节点状态相匹配的执行行为;In the first aspect, according to the information in the D 20 of the synchronous topology generation module (20), the state transition module (40), the data processing module (60), the fault detection and processing module (70) and the clock correction module (80), the integrated Analyze and generate execution behaviors that match the node states in the state transition module (40); 第二方面,将由第一方面得到的执行行为传递给所述相匹配的执行行为是指,当状态转换模块(40)传递的节点状态为集成状态时:同步控制器SMB在集成状态的执行行为压缩控制器CMB在集成状态的执行行为同步客户端SCB在集成状态的执行行为 In the second aspect, passing the execution behavior obtained by the first aspect to the matching execution behavior refers to that when the node state transferred by the state transition module (40) is an integrated state: the execution of the synchronous controller SM B in the integrated state Behavior Execution Behavior of Compression Controller CM B in Integrated State Execution behavior of synchronization client SC B in integrated state 当状态转换模块(40)传递的节点状态为同步状态时:同步控制器SMB在同步状态的执行行为压缩控制器CMB在同步状态的执行行为同步客户端SCB在同步状态的执行行为 When the node state delivered by the state transition module (40) is a synchronous state: the execution behavior of the synchronous controller SM B in the synchronous state Execution Behavior of Compression Controller CM B in Synchronous State Execution behavior of sync client SC B in sync state 当状态转换模块(40)传递的节点状态为异步状态时:同步控制器SMB在异步状态的执行行为压缩控制器CMB在异步状态的执行行为 When the node state delivered by the state transition module (40) is an asynchronous state: the execution behavior of the synchronous controller SM B in the asynchronous state Execution Behavior of Compression Controller CM B in Asynchronous State 当状态转换模块(40)传递的节点状态为等待状态时:同步控制器SMB在等待状态的执行行为压缩控制器CMB在等待状态的执行行为 When the node state delivered by the state transition module (40) is a waiting state: the execution behavior of the synchronization controller SM B in the waiting state Execution Behavior of Compression Controller CM B in Waiting State 当状态转换模块(40)传递的节点状态为FLOOD状态时:同步控制器SMB在FLOOD状态的执行行为当状态转换模块(40)传递的节点状态为使能状态时:压缩控制器CMB在使能状态的执行行为 When the node state delivered by the state transition module (40) is the FLOOD state: the execution behavior of the synchronization controller SM B in the FLOOD state When the node state delivered by the state transition module (40) is the enable state: the execution behavior of the compression controller CM B in the enable state 首先,对于角色配置为同步控制器的节点:First, for a node whose role is configured as a sync controller: (A)所述同步控制器SMB在集成状态的执行行为是指:在A定时TA内,状态管理模块(30)对数据处理模块(60)传递的数据固化队列Qperm中的元素进行判断,判断其中是否有数据元素,如果有则进一步判断收到的数据帧FR的类型:如果为CA帧,则触发状态转换模块(40)将节点状态转换为等待状态,并触发同步结团检测与处理单元(702)将Msync置为1;如果为IN帧,则继续判断同步成员变量是否达到状态门限值若达到,则触发状态转换模块(40)将节点状态转换为同步状态,并开始触发数据处理模块(60)对上述IN帧进行记录并利用数据处理模块(60)执行对IN帧的处理;若未达到,则触发状态转换模块(40)将节点状态转换为等待状态;如果A定时TA结束后,数据固化队列Qperm仍为空,则触发状态转换模块(40)将节点状态转换为非同步状态,将定时时长设置为TB,触发数据处理模块(60)中的数据帧生成单元(601),开始生成CS帧,之后按照数据处理模块(60)中的各个单元顺序进行操作,发起握手过程;(A) The execution behavior of the synchronous controller SM B in the integrated state Means: in A timing TA , the state management module (30) judges the elements in the data solidification queue Q perm delivered by the data processing module (60), judges whether there are data elements therein, and if there is, then further judges the receipt The type of the data frame FR: if it is a CA frame, then the trigger state transition module (40) is converted to a waiting state with the node state, and triggers the synchronous cluster detection and processing unit (702) to set M sync to 1; if it is IN frame, continue to judge whether the synchronization member variable reaches the state threshold If reach, then trigger state conversion module (40) node state is converted into synchronous state, and start to trigger data processing module (60) to record above-mentioned IN frame and utilize data processing module (60) to carry out the processing to IN frame; Do not reach, then trigger state transition module (40) node state is converted into waiting state; If after A timing T A finishes, data curing queue Q perm is still empty, then trigger state transition module (40) node state is converted into non- Synchronous state, the timing duration is set to TB , triggers the data frame generation unit (601) in the data processing module (60), starts to generate CS frame, then operates according to each unit sequence in the data processing module (60), initiates Handshake process; (B)所述同步控制器SMB在异步状态的执行行为是指:在B定时TB内,对数据处理模块(60)传递的数据固化队列Qperm中的元素进行判断,判断其中是否有数据元素,如果有则进一步判断收到的数据帧类型:如果为CS帧,则触发状态转换模块(40)将节点状态转换为FLOOD状态;如果为CA帧,则触发状态转换模块(40)将节点状态转换为等待状态,并触发同步结团检测与处理单元(702)将Msync置为1;如果为IN帧,则继续判断同步成员变量是否达到如果节点同步成员变量达到则触发状态转换模块(40)将节点状态转换为同步状态,并开始触发数据处理模块(60)对其进行记录并在数据处理模块(60)执行对IN帧的处理;若未达到,则触发状态转换模块(40)将节点状态转换为等待状态;如果B定时TB结束后,节点的数据固化队列Qperm仍为空,则触发状态转换模块(40)将节点状态转换为异步状态,此时,触发数据处理模块(60)中的数据帧生成单元(601),开始生成CS帧,之后按照数据处理模块(60)中的各个单元顺序进行操作,发起握手过程;(B) Execution behavior of the synchronous controller SM B in an asynchronous state Refer to: in B timing TB, the element in the data solidification formation Q perm that data processing module (60) transmits is judged, judges whether there is data element wherein, if then further judges the data frame type that receives: if If it is a CS frame, then the trigger state conversion module (40) converts the node state into a FLOOD state; if it is a CA frame, then the trigger state conversion module (40) converts the node state into a waiting state, and triggers a synchronous clumping detection and processing unit (702) M sync is set to 1; if it is an IN frame, then continue to judge whether the synchronization member variable reaches If the node synchronization member variable reaches Then the trigger state conversion module (40) converts the node state into a synchronous state, and starts to trigger the data processing module (60) to record it and perform the processing to the IN frame in the data processing module (60); if not reached, trigger State conversion module (40) converts the node state into a waiting state; if after the timing TB of B ends, the data solidification queue Q perm of the node is still empty, then the trigger state conversion module (40) converts the node state into an asynchronous state, and this , trigger the data frame generation unit (601) in the data processing module (60), start to generate the CS frame, then operate according to the order of each unit in the data processing module (60), and initiate the handshake process; (C)所述同步控制器SMB在FLOOD状态的执行行为是指:状态管理模块30根据节点当前的变量配置信息设定定时时长;(C) Execution behavior of the synchronous controller SM B in the FLOOD state Refer to: the state management module 30 sets the timing duration according to the current variable configuration information of the node; 所述变量配置信息包括flood_recv和closed_window;The variable configuration information includes flood_recv and closed_window; 在C定时TC内,对数据处理模块(60)传递的数据固化队列Qperm中加入的元素进行判断,判断其中是否有数据元素,如果有,则进一步判断收到的PCF帧类型:如果为CS帧,则触发状态转换模块(40)将节点状态再次置为FLOOD状态;In the timing TC of C , the element added in the data solidification queue Q perm delivered by the data processing module (60) is judged to judge whether there is a data element in it, if there is, then further judge the PCF frame type received: if it is CS frame, then triggering state transition module (40) node state is set to FLOOD state again; 如果为CA帧,且在flood_recv值为1,closed_window值为0的配置情况下,则触发状态转换模块(40)将节点状态转换为等待状态;If it is a CA frame, and under the configuration situation that the flood_recv value is 1 and the closed_window value is 0, then the state transition module (40) is triggered to convert the node state to a waiting state; 在C定时TC结束后,节点的数据固化队列Qperm仍为空,则判断flood_recv值与closed_window值,如果都为0时,则触发状态转换模块(40)将节点状态再次置为FLOOD状态,并触发数据处理模块(60)发送CA帧,同时,将flood_recv赋值为1;After C timing T C ends, the data solidification queue Q perm of node is still empty, then judge flood_recv value and closed_window value, if when all being 0, then triggering state conversion module (40) node state is put into FLOOD state again, And trigger data processing module (60) to send CA frame, meanwhile, flood_recv is assigned a value of 1; 如果flood_recv值为1,closed_window值为0时,则在I定时TI内,继续对数据处理模块(60)传递的数据固化队列Qperm中的元素进行判断,判断其中是否有数据元素,如果没有,则触发状态转换模块(40)将节点状态再次置为FLOOD状态,不进行状态转换;If the flood_recv value is 1, and the closed_window value is 0, then within I timing T1, continue to judge the elements in the data curing queue Q perm delivered by the data processing module (60), judge whether there is a data element in it, if not , then the trigger state transition module (40) is set to the FLOOD state again with the node state, and does not carry out state transition; 如果flood_recv值与closed_window值都为1时,则在J定时TJ内,继续对数据处理模块(60)传递的数据固化队列Qperm中的元素进行判断,判断其中是否有数据元素,如果没有,则触发状态转换模块(40)将节点状态转换为异步状态,将flood_recv值与closed_window值赋为0;If the flood_recv value and the closed_window value are all 1, then in J timing T J , continue to judge the elements in the data curing queue Q perm delivered by the data processing module (60), judge whether there is a data element therein, if not, Then the trigger state conversion module (40) converts the node state into an asynchronous state, and assigns flood_recv value and closed_window value to 0; (D)所述同步控制器SMB在等待状态的执行行为是指:在E定时TE内,对数据处理模块(60)传递的数据固化队列Qperm中的元素进行判断,判断其中是否有数据元素,如果有,则进一步判断收到的数据帧类型:如果为CS帧,则触发状态转换模块(40)将节点状态转换为FLOOD状态;如果为CA帧,则触发状态转换模块(40)将节点状态继续停留在等待状态,并触发同步结团检测与处理单元(702)将Msync置为1;如果数据接收队列Qrecv为空,并且节点的本地成员值达到状态门限值则触发状态转换模块(40)将节点状态转换为同步状态,同时触发数据处理模块(60)中的数据帧生成单元(601),开始生成IN帧,即帧内新成员=节点的本地成员值,以发起同步过程;如果节点的本地成员值没有达到状态门限值则则触发状态转换模块(40)将节点状态转换为异步状态;(D) Execution behavior of the synchronous controller SM B in the waiting state Refer to: in E timing TE, judge the element in the data solidification queue Q perm that data processing module (60) transmits, judge whether there is data element wherein, if have, then further judge the data frame type that receives: If it is a CS frame, then the trigger state transition module (40) converts the node state to the FLOOD state; if it is a CA frame, then the trigger state transition module (40) continues to stay in the waiting state with the node state, and triggers synchronous clumping detection and The processing unit (702) sets M sync to 1; if the data receiving queue Q recv is empty, and the local member value of the node reaches the state threshold value Then the trigger state conversion module (40) converts the node state into a synchronous state, and triggers the data frame generation unit (601) in the data processing module (60) simultaneously, and starts to generate an IN frame, that is, the local member value of new member=node in the frame , to initiate the synchronization process; if the node's local membership value does not reach the state threshold Then trigger the state transition module (40) to convert the node state into an asynchronous state; (E)所述同步控制器SMB在同步状态的执行行为是指:在这一状态下,冷启动握手已成功,各个节点的时钟差保持在所设置的时钟精度的范围内;状态管理模块(30)在每个集成周期的起点触发数据处理模块(60)生成IN帧,并对其进行发送、接收、固化等操作;触发时钟修正模块(80)在接收到固化好的IN帧后进行时钟修正;触发故障检测与处理模块(70)对运行过程进行监视,利用故障检测与处理模块(70)中的同步结团检测与处理单元(702)和异步结团检测与处理单元(703)对同步过程中是否出现结团的情况进行检测,并做出处理;在同步状态,数据处理模块(60)将传递的数据固化队列Qperm中加入的元素反馈给状态管理模块(30)进行判断,如果是IN帧,则继续保持在同步状态,继续后续操作;如果是CA帧,则预示着当前出现了不同步的状况,触发状态转换模块(40)将节点状态转换为等待状态,开始等待重新发起同步过程;故障检测与处理模块(70)将检测出的问题汇报给状态管理模块(30),当同步结团检测与处理单元(702)或异步结团检测与处理单元(703)检测出结团的情况时,将出现的情况汇报给状态管理模块(30),状态管理模块(30)触发状态转换模块(40)将当前状态转换为异步状态;(E) The execution behavior of the synchronous controller SM B in the synchronous state Means: in this state, the cold start handshake has been successful, and the clock difference of each node remains within the scope of the set clock accuracy; the state management module (30) triggers the data processing module (60) at the starting point of each integration cycle ) generates an IN frame, and performs operations such as sending, receiving, and solidifying it; the trigger clock correction module (80) performs clock correction after receiving the solidified IN frame; the trigger fault detection and processing module (70) performs the operation process Monitoring, utilizing the synchronous clumping detection and processing unit (702) and the asynchronous clumping detection and processing unit (703) in the fault detection and processing module (70) to detect whether there is clumping in the synchronous process, and make Processing; in the synchronous state, the data processing module (60) feeds back the elements added in the data solidification queue Q perm delivered to the state management module (30) to judge, if it is an IN frame, then continue to remain in the synchronous state, and continue the follow-up operation If it is a CA frame, it indicates that there is an asynchronous situation at present, and the trigger state transition module (40) converts the node state to a waiting state, and begins to wait for re-initiation of the synchronization process; fault detection and processing module (70) will detect report to the state management module (30), when the synchronous clumping detection and processing unit (702) or the asynchronous clumping detection and processing unit (703) detects the clumping situation, the situation will be reported to the status management module (30), the state management module (30) triggers the state transition module (40) to convert the current state into an asynchronous state; 对于配置为压缩控制器的节点:根据状态转换模块(40)传递的不同的状态信息进行讨论;For a node configured as a compression controller: discuss according to different state information delivered by the state transition module (40); (A)所述压缩控制器CMB在集成状态的执行行为是指:在D定时TD内,对数据处理模块(60)传递的数据固化队列Qperm中的元素进行判断,判断其中是否有数据元素,如果有则进一步判断收到的数据帧类型:如果为CS或者CA帧,则视为不该出现的情况,直接对数据帧进行丢弃;如果为IN帧,则继续判断同步成员变量是否达到状态门限值若同步成员变量达到状态门限值则触发状态转换模块(40)将节点状态转换为同步状态,并开始触发数据处理模块(60)对其进行记录并利用数据处理模块(60)和时钟修正模块(80)进行相应操作;若未达到,则对数据帧进行丢弃;如果D定时TD结束后,节点的数据固化队列Qperm仍为空,则进入触发状态转换模块(40)将节点状态转换为异步状态;(A) Execution behavior of the compression controller CM B in the integrated state Refer to: in D timing T D , the element in the data solidification queue Q perm that data processing module (60) transmits is judged, judges whether there is data element wherein, if then further judges the data frame type that receives: if If it is a CS or CA frame, it will be regarded as something that should not happen, and the data frame will be discarded directly; if it is an IN frame, continue to judge whether the synchronization member variable reaches the state threshold If the synchronization member variable reaches the state threshold Then the trigger state conversion module (40) converts the node state into a synchronous state, and starts to trigger the data processing module (60) to record it and utilize the data processing module (60) and the clock correction module (80) to carry out corresponding operations; if not Reach, then data frame is discarded; If after D timing T D ends, the data solidification queue Q perm of node is still empty, then enter triggering state conversion module (40) and node state is converted into asynchronous state; (B)所述压缩控制器CMB在异步状态的执行行为是指:对数据处理模块(60)传递的节点的数据固化队列Qperm中的元素进行判断,判断其中是否有数据元素,如果有则进一步判断收到的数据帧类型:如果为CS帧,或者为CA帧并且接收到的CA帧的成员值信息大于状态门限值则触发状态转换模块(40)将节点状态转换为使能状态,并且触发数据处理模块(60)利用数据帧生成单元(601)生成CS或者CA帧,并按照数据处理模块(60)中的步骤将数据帧生成并发送出去;如果为IN帧,并且IN帧的新成员的值大于状态门限值则触发状态转换模块(40)将节点状态转换为同步状态,并触发数据处理模块(60)后续处理;如果数据固化队列Qperm一直为空,则节点一直停留在异步状态;为压缩控制器CMB从异步状态至同步状态的门限值;(B) Execution behavior of the compression controller CM B in an asynchronous state Refer to: judge the elements in the data solidification queue Q perm of the node delivered by the data processing module (60), judge whether there are data elements in it, if there is, then further judge the received data frame type: if it is a CS frame, or It is a CA frame and the member value information of the received CA frame is greater than the status threshold Then the trigger state conversion module (40) converts the node state into an enabled state, and the trigger data processing module (60) utilizes the data frame generation unit (601) to generate CS or CA frames, and according to the steps in the data processing module (60) Generate and send the data frame; if it is an IN frame, and the value of the new member of the IN frame is greater than the state threshold Then the trigger state conversion module (40) converts the node state into a synchronous state, and triggers the data processing module (60) subsequent processing; if the data solidification queue Q perm is always empty, then the node stays in the asynchronous state; is the threshold value of the compression controller CM B from the asynchronous state to the synchronous state; 所述的数据处理模块(60)中的步骤包括:由于所生成的数据帧与接收到的数据帧格式基本一致,因此,在生成新的数据帧时,采取对接收到的PCF内部结构进行更改的方法,修改该帧的透明时钟域为0,并在数据处理过程中添加新的VL信息,按照数据处理模块(60)中的后续步骤将其发送回相应目的节点;The steps in the described data processing module (60) include: because the generated data frame is substantially consistent with the received data frame format, therefore, when generating a new data frame, the received PCF internal structure is changed The method for modifying the transparent clock domain of the frame is 0, and adding new VL information in the data processing process, and sending it back to the corresponding destination node according to the subsequent steps in the data processing module (60); (C)所述压缩控制器CMB在使能状态的执行行为是指:在F定时TF内,对数据处理模块(60)传递的数据固化队列Qperm中的元素进行判断,判断其中是否有数据元素,如果有则进一步判断收到的数据帧类型:如果为CS或者IN帧,则视为错误的情况,直接对数据帧进行丢弃,不予操作;如果接收到CA帧,则将对此CA帧进行转发操作,触发数据处理模块(60)生成CA帧,并按照数据处理模块(60)中的步骤将数据帧发送出去;在此状态下,每收到一个CA帧,就执行转发行为,由于所生成的数据帧与接收到的数据帧格式基本一致,因此,在生成新的数据帧时,采取对接收到的PCF内容进行更改的方法,修改该帧的透明时钟域,并在数据处理过程中添加新的VL,按照数据处理模块(60)中的后续步骤将其发送回相应目的节点,在接收到数据帧的情况下,节点继续停留在当前状态,不进行状态转换;如果在F定时TF结束后,节点数据接收队列Qrecv仍为空,即未收到新的数据,则触发状态转换模块(40)将节点状态转换为等待状态;(C) Execution behavior of the compression controller CM B in an enabled state Refer to: in F timing TF, the element in the data solidification formation Q perm that data processing module (60) transmits is judged, judges whether there is data element wherein, if then further judges the data frame type that receives: if If it is a CS or IN frame, it is regarded as an error, and the data frame is directly discarded without operation; if a CA frame is received, the CA frame will be forwarded, and the data processing module (60) is triggered to generate a CA frame , and send the data frame according to the steps in the data processing module (60); in this state, whenever a CA frame is received, the forwarding behavior is performed, because the generated data frame is basically consistent with the received data frame format , therefore, when generating a new data frame, take the method of changing the received PCF content, modify the transparent clock domain of the frame, and add a new VL in the data processing process, according to the data processing module (60) The follow-up steps send it back to the corresponding destination node. In the case of receiving the data frame, the node continues to stay in the current state without state transition; if the node data receiving queue Q recv is still empty after the end of F timing TF , that is, no new data is received, then the state transition module (40) is triggered to convert the node state to a waiting state; (D)所述压缩控制器CMB在等待状态的执行行为是指:在G定时TG内,对数据处理模块(60)传递的数据固化队列Qperm中的元素进行判断,判断其中是否有数据元素,如果有则进一步判断收到的数据帧类型:如果为CS或者CA帧,则视为错误的情况,直接对数据帧进行丢弃,不予操作;如果为IN帧,并且IN帧的新成员的值状态门限值则触发状态转换模块(40)将节点状态转换为同步状态,并触发数据处理模块(60)和时钟修正模块(80)对所接收到的数据帧进行操作;如果G定时TG结束后,节点的数据固化队列Qperm中一直为空,即未收到新的数据,则触发状态转换模块(40)将节点状态转换为非同步状态;(D) Execution behavior of the compression controller CM B in the waiting state Refer to: in G timing T G , the element in the data solidification queue Q perm that data processing module (60) transmits is judged, judges whether there is data element wherein, if then further judges the data frame type that receives: if If it is a CS or CA frame, it is regarded as an error, and the data frame is discarded directly, and no operation is performed; if it is an IN frame, and the value state threshold of the new member of the IN frame Then the trigger state conversion module (40) converts the node state into a synchronous state, and triggers the data processing module (60) and the clock correction module (80) to operate on the received data frame; if G timing T G ends, the node It is always empty in the data solidification queue Q perm , that is, no new data is received, then the state transition module (40) is triggered to convert the node state to an asynchronous state; (E)所述压缩控制器CMB在同步状态的执行行为是指:当处于这一状态时,说明冷启动握手成功,各个节点的时钟差保持在所设置的时钟精度的范围内;状态管理模块(30)根据数据处理模块(60)所反馈的数据帧进行相应操作:如果接收到固化后的CS或者CA帧,则视为错误的情况,直接对数据帧进行丢弃,不予操作;如果接收到固化后的IN帧,则触发数据处理模块(60)中的数据帧压缩单元(605),对IN帧进行收集,压缩等操作,并利用时钟修正模块(80)进行时钟修正,利用故障检测与处理模块(70)中的同步结团检测与处理单元(702)和异步结团检测与处理单元(703)对同步过程中是否出现结团的情况进行检测,并做出处理;故障检测与处理模块(70)将检测出的问题汇报给状态管理模块(30),当同步结团检测与处理单元(702)或异步结团检测与处理单元(703)检测出结团的情况时,将出现的情况汇报给状态管理模块(30),状态管理模块(30)触发状态转换模块(40)将节点状态转换为集成状态,从而重新等待开始握手同步的过程;如果没有检测出结团的情况,则继续保持在同步状态,同时还按照数据处理模块(60)中处理数据时的相应情况更新节点的本地配置信息;(E) Execution behavior of the compression controller CM B in a synchronous state Refers to: when in this state, it means that the cold start handshake is successful, and the clock difference of each node remains within the range of the clock accuracy set; the state management module (30) according to the data frame fed back by the data processing module (60) Carry out corresponding operation: if receive the CS after curing or CA frame, then regard as the situation of error, directly discard data frame, do not give operation; If receive the IN frame after curing, then trigger data processing module (60) The data frame compression unit (605) in the IN frame is collected, compressed and other operations, and the clock correction module (80) is used to correct the clock, and the synchronous cluster detection and processing unit in the fault detection and processing module (70) is used (702) and asynchronous clumping detection and processing unit (703) detect whether clumping occurs in the synchronous process, and make processing; Fault detection and processing module (70) reports the detected problem to the state management module (30), when the synchronous clumping detection and processing unit (702) or the asynchronous clumping detection and processing unit (703) detect the situation of clumping, the situation that occurs will be reported to the status management module (30), the status management module (30) trigger state transition module (40) node state is converted into integrated state, thereby wait again to start the process of handshake synchronization; If the situation of clustering is not detected, then continue to remain in the synchronous state, also according to the data processing module ( 60) when processing data in the corresponding situation updates the local configuration information of the node; 对于配置为同步客户端的节点:根据状态转换模块(40)传递的不同的状态信息进行讨论;For the node configured as a synchronous client: discuss according to the different state information delivered by the state transition module (40); (A)所述同步客户端SCB在集成状态的执行行为是指:首先对数据处理模块(60)传递的数据固化队列Qperm中的元素进行判断,判断其中是否有数据元素,如果有则进一步判断收到的数据帧类型:如果是IN帧,则进一步判断其同步成员变量是否达到状态门限值如果是,则触发状态转换模块(40)将节点状态转换为同步状态,并且触发数据处理模块(60),按照数据处理模块(60)中收到IN帧时的方法对其进行处理,并且对节点的本地信息进行一定的更新;如果不是,即未能达到状态门限值则说明还没有能够达到同步的状态,继续触发数据处理模块(60),执行相应的数据转发操作;如果接收到的PCF类型为CS或者CA帧,也继续触发数据处理模块(60),执行相应的数据转发操作;(A) Execution behavior of the synchronization client SC B in the integrated state Refer to: first judge the elements in the data curing queue Q perm delivered by the data processing module (60), judge whether there are data elements in it, if there is, then further judge the received data frame type: if it is an IN frame, then further Determine whether its synchronization member variable reaches the state threshold If yes, then the trigger state conversion module (40) converts the node state into a synchronous state, and triggers the data processing module (60), processes it according to the method when receiving the IN frame in the data processing module (60), and to The local information of the node must be updated; if not, the state threshold cannot be reached Then explain the state that can not reach synchronization yet, continue to trigger data processing module (60), carry out corresponding data forwarding operation; If the PCF type that receives is CS or CA frame, also continue to trigger data processing module (60), carry out corresponding data forwarding operation; (B)所述同步客户端SCB在同步状态的执行行为是指:状态管理模块(30)触发数据处理模块(60)、时钟修正模块(80)等对接收到的IN帧进行处理,并对节点当前的本地时钟进行修正,同时,触发故障检测与处理模块(70)对是否出现结团情况进行检测,如果出现,则触发状态转换模块(40)将当前状态转换为集成状态;否则,仍然保持在同步状态;同时,对节点的当前配置信息进行相应的修改。(B) The execution behavior of the synchronization client SC B in the synchronization state Refers to: the state management module (30) triggers the data processing module (60), the clock correction module (80), etc. to process the received IN frame, and corrects the current local clock of the node, and at the same time, triggers fault detection and processing Module (70) detects whether there is agglomeration, if it occurs, then triggers the state transition module (40) to convert the current state into an integrated state; otherwise, it remains in the synchronous state; at the same time, the current configuration information of the node is correspondingly Modifications.
CN201310664838.6A 2013-12-09 2013-12-09 A Simulation System for Simulating Switched Ethernet Clock Synchronization Active CN103647682B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310664838.6A CN103647682B (en) 2013-12-09 2013-12-09 A Simulation System for Simulating Switched Ethernet Clock Synchronization

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310664838.6A CN103647682B (en) 2013-12-09 2013-12-09 A Simulation System for Simulating Switched Ethernet Clock Synchronization

Publications (2)

Publication Number Publication Date
CN103647682A CN103647682A (en) 2014-03-19
CN103647682B true CN103647682B (en) 2016-08-10

Family

ID=50252843

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310664838.6A Active CN103647682B (en) 2013-12-09 2013-12-09 A Simulation System for Simulating Switched Ethernet Clock Synchronization

Country Status (1)

Country Link
CN (1) CN103647682B (en)

Families Citing this family (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103986601B (en) * 2014-05-16 2017-10-10 北京东土科技股份有限公司 A kind of message transmissions time delay acquisition methods and device
CN104009893B (en) * 2014-06-16 2017-03-29 北京航空航天大学 A kind of method that can strengthen clock synchronous fault-tolerant suitable for monitoring inside compression main controller
CN104660477A (en) * 2015-03-02 2015-05-27 中国航空无线电电子研究所 Star topology network constructing method based on time triggered bus
CN106059701B (en) * 2016-08-17 2018-06-08 北京航空航天大学 A kind of clock that Ethernet is triggered by capturing the Protocol Control frame testing time synchronizes the device of correction value
CN106877967B (en) * 2017-03-21 2019-07-16 中车株洲电力机车研究所有限公司 IEEE1588 transparent clock residence time measurement method and its device
CN107342833B (en) * 2017-06-15 2019-03-15 西安微电子技术研究所 A kind of time trigger Ethernet exchanging control method
CN109150559B (en) * 2017-06-15 2022-05-31 中国航空工业集团公司洛阳电光设备研究所 Time-triggered Ethernet simulation system
CN107453939B (en) * 2017-06-15 2021-03-23 西安微电子技术研究所 Time-triggered Ethernet solidification point parallel monitoring device
CN107359952B (en) * 2017-06-15 2019-02-22 西安微电子技术研究所 A kind of clock Dynamic Compression towards time-triggered network
CN107147465B (en) * 2017-06-30 2019-03-01 西安微电子技术研究所 A kind of exchange clock isochronous controller and control method towards time-triggered network
CN107342834B (en) * 2017-06-30 2019-01-04 西安微电子技术研究所 A kind of multi-channel adaptive clock correction algorithm towards time trigger communication
CN108429595B (en) * 2018-01-21 2019-06-21 西安电子科技大学 Device and method for clock synchronization of switching equipment based on AS6802 standard
CN109150354B (en) * 2018-08-03 2020-01-10 湖南华芯通网络科技有限公司 Method for calculating compression correction value in time-triggered Ethernet
CN110176976B (en) * 2019-06-28 2021-02-09 中车青岛四方车辆研究所有限公司 Train time calibration system and method and time calibration equipment
CN113541991B (en) * 2020-04-20 2022-09-27 中车唐山机车车辆有限公司 Train network control system and communication control method based on time sensitive network
CN111641470B (en) * 2020-05-08 2022-08-02 哈尔滨工程大学 Time consistency synchronization method for distributed simulation
CN112073981B (en) * 2020-08-27 2023-12-22 中国航空无线电电子研究所 Network system integrating uTTE and uAFDX communication modes
CN114006853B (en) * 2021-11-12 2022-12-27 西安云维智联科技有限公司 TTE network switch clock synchronization test method
CN114006852B (en) * 2021-11-12 2022-12-23 西安云维智联科技有限公司 TTE network end node clock synchronization test method
CN114826465B (en) * 2022-02-25 2024-12-03 中国航空工业集团公司西安航空计算技术研究所 Clock synchronization function execution monitoring system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201740864U (en) * 2009-09-30 2011-02-09 广东电网公司电力科学研究院 Digital electric energy meter check device based on simulate traceability method
CN102665237A (en) * 2012-04-24 2012-09-12 北京邮电大学 Simulative Ir interface protocol conformance testing device and interoperability testing method
CN202815819U (en) * 2012-07-30 2013-03-20 中国航天科工集团第三研究院第八三五七研究所 Distributed testing device based on LXI (LAN extensions for instrumentation) bus architecture

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050192788A1 (en) * 2004-02-27 2005-09-01 Hobson Louis B. Simulating processor performance states
US8302043B2 (en) * 2009-09-17 2012-10-30 International Business Machines Corporation Verification of logic circuit designs using dynamic clock gating

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201740864U (en) * 2009-09-30 2011-02-09 广东电网公司电力科学研究院 Digital electric energy meter check device based on simulate traceability method
CN102665237A (en) * 2012-04-24 2012-09-12 北京邮电大学 Simulative Ir interface protocol conformance testing device and interoperability testing method
CN202815819U (en) * 2012-07-30 2013-03-20 中国航天科工集团第三研究院第八三五七研究所 Distributed testing device based on LXI (LAN extensions for instrumentation) bus architecture

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
AFDX实时流量的时间确定性中间件接入模型研究;易娟,何锋,王彤;《电光与控制》;20130716;第20卷(第7期);全文 *
一种AFDX网络虚拟链路的路由配置算法;刘成,何锋,王彤,周立;《电光与控制》;20110309;第17卷(第12期);全文 *

Also Published As

Publication number Publication date
CN103647682A (en) 2014-03-19

Similar Documents

Publication Publication Date Title
CN103647682B (en) A Simulation System for Simulating Switched Ethernet Clock Synchronization
WO2022100411A1 (en) Method for measuring forwarding time characteristics of tsn, and terminal
CN106059701B (en) A kind of clock that Ethernet is triggered by capturing the Protocol Control frame testing time synchronizes the device of correction value
CN109150559B (en) Time-triggered Ethernet simulation system
CN107819539B (en) A device and method for realizing time-triggered Ethernet terminal system
CN107147465B (en) A kind of exchange clock isochronous controller and control method towards time-triggered network
CN102123073B (en) Packet reordering method and device
US12047300B2 (en) Packet forwarding method, device, and system
CN107257311A (en) A kind of time triggered communication blended data based on virtual link sends dispatching method
CN102201907A (en) Method for realizing distributed simulation synchronization
Pahlevan et al. Evaluation of tsn dynamic configuration model for safety-critical applications
CN106850331B (en) An Ethernet frame sending device with synchronous clock function in the field of transportation
CN103746878B (en) Simulation system for measuring transmission time of SpaceWire data packets
CN108833366B (en) Control frame compression method based on AS6802 protocol
CN114285541B (en) A Time Triggered Ethernet Scheduling Table Generation Method Based on Delay Error
CN103457815B (en) A kind of construction method being applicable to the moment dispatch list of SpaceWire network
CN118694702A (en) Incremental Scheduling Method for Time-Sensitive Networks Based on Link Status
Zhang et al. Modeling time-triggered ethernet in systemc/tlm for virtual prototyping of cyber-physical systems
CN101771597A (en) Multi-message convergence transmission method for field level industrial wireless network
Tariq et al. Analysis of synchronization in distributed avionics systems based on time-triggered Ethernet
CN107018095B (en) System and method for simulating exchange unit based on discrete event
CN115733759A (en) Simulation model system for TTFC message scheduling
Simon et al. Ethernet with time sensitive networking tools for industrial networks
CN103812634B (en) Fieldbus networks control system and its Networked-induced delay computational methods
Ashjaei et al. The design and implementation of a simulator for switched ethernet networks

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant