Time synchronization device and method based on ELS frame

文档序号:1830687 发布日期:2021-11-12 浏览:37次 中文

阅读说明:本技术 一种基于els帧的时间同步装置与方法 (Time synchronization device and method based on ELS frame ) 是由 陈艇 刘勤让 刘东辉 吕平 沈剑良 李沛杰 刘冬培 汤先拓 刘宗海 张文建 于 2021-07-29 设计创作,主要内容包括:本发明公开一种基于ELS帧的时间同步装置与方法,该方法包括:定时器模块,CPU模块,处理器内部存储模块,DMA模块及FC端口模块;定时器模块根据用户设置的最大计数周期性的触发DMA模块向FC端口模块搬移CSU帧帧;CPU模块根据用户发送的CSR帧进行CSU帧的组装;处理器内部存储模块存储CPU模块组装后的CSU帧;DMA模块将处理器内部存储模块中的CSU帧搬移到FC端口模块上;FC端口模块在发送方向使用本地实时RTC值替换CSU帧内部的时间信息;或在接收方向解析CSU帧的时间信息并更新本地RTC值。本发明利用DMA模块将处理器内部存储模块中的CSU帧搬移到FC端口模块的发送缓冲中,无需CPU模块进行调度,工作效率高。(The invention discloses a time synchronization device and a method based on ELS frames, wherein the method comprises the following steps: the system comprises a timer module, a CPU module, a processor internal storage module, a DMA module and an FC port module; the timer module periodically triggers the DMA module to move the CSU frame to the FC port module according to the maximum count set by a user; the CPU module assembles the CSU frame according to the CSR frame sent by the user; the internal storage module of the processor stores the CSU frame assembled by the CPU module; the DMA module moves the CSU frame in the internal storage module of the processor to the FC port module; the FC port module uses the local real-time RTC value to replace the time information in the CSU frame in the sending direction; or parsing the time information of the CSU frame and updating the local RTC value in the receiving direction. The invention utilizes the DMA module to move the CSU frame in the internal storage module of the processor to the sending buffer of the FC port module without the need of the CPU module for scheduling, and has high working efficiency.)

1. An ELS frame-based time synchronization apparatus, comprising: the system comprises a timer module, a CPU module, a processor internal storage module, a DMA module and an FC port module;

the timer module is used for moving an ELS time synchronization frame to the FC port module according to the maximum counting periodicity trigger DMA module set by a user;

the CPU module is used for assembling an ELS time synchronization frame according to an ELS time synchronization request frame sent by a user;

the processor internal storage module is used for storing the ELS time synchronization frame assembled by the CPU module;

the DMA module is used for moving ELS time synchronization frames in the internal storage module of the processor to the FC port module;

the FC port module is used for replacing time information in an ELS time synchronization frame with a local real-time RTC value in the sending direction; or for parsing the time information of the ELS time sync frame and updating the local RTC value in the receiving direction.

2. The ELS frame-based time synchronizer of claim 1, wherein a maximum count of said timer module is configurable by a user.

3. The ELS frame-based time synchronizer of claim 1, wherein said FC port module is a controller conforming to FC protocol.

4. A time synchronization method based on ELS frames is characterized by comprising the following steps:

the CPU module assembles an ELS time synchronization frame according to an ELS time synchronization request frame received from a client and stores the ELS time synchronization frame assembled by the CPU to an internal storage module of the processor;

when the counting of the timer module is overtime, the DMA module is triggered to move an ELS time synchronization frame to the FC port module;

replacing the time information of the ELS time synchronization frame with the local real-time RTC value in the FC port module in the sending direction, and sending the recombined ELS time synchronization frame to the FC port module of the docking equipment;

and after receiving the recombined ELS time synchronization frame, the FC port module of the docking equipment updates a local RTC value according to the time information of the analyzed ELS time synchronization frame, and finally realizes the time synchronization of the system.

5. The ELS frame-based time synchronization method of claim 4, wherein said assembling of ELS time synchronization frames comprises:

step a1, powering on the CPU module, resetting and releasing, opening up a memory in the memory module in the processor for storing the ELS time synchronization frame, and waiting for receiving the ELS time synchronization request frame;

step a2, when receiving an ELS time synchronization request frame, extracting a source address identifier FC _ ID in the ELS time synchronization request frame as a destination address identifier of a response frame corresponding to the ELS request frame, and pressing the ELS time synchronization response frame into an ELS time synchronization frame buffer;

step a3, updating the effective depth value of ELS time synchronization frame buffer of the DMA module.

6. The ELS frame-based time synchronization method of claim 4, wherein the moving of the ELS time synchronization frame comprises:

b1, powering on the CPU module, resetting and releasing, setting the maximum count of the sending period timer module of the ELS time synchronization frame, and starting the timer module;

b2, when the count of the timer module reaches the maximum count, triggering the DMA module to transmit, and the DMA module moves the ELS time synchronization frame cached in the storage module inside the processor to the sending frame cache inside the FC port module;

step b3, waiting for the completion of DMA transfer, and preparing to carry out next ELS time synchronization frame transfer.

Technical Field

The invention belongs to the technical field of system time synchronization, and particularly relates to an ELS frame-based time synchronization device and method.

Background

Two time synchronization modes are defined in the FC-FS protocol, which are respectively based on Extended Link Service (ELS) time synchronization and raw Signal (PS) time synchronization, in a time-synchronized FC network, a time synchronization Server (Server) is generally provided, and other endpoints or switching devices in the network are called time synchronization clients (clients), and Real Time Clock (RTC) counters are integrated in the time synchronization servers. The time synchronization server is responsible for sending ELS frames or original signals with local RTC values to other clients of the network, when the clients receive the time synchronization frames or the original signals, the RTC in the time synchronization frames or the original signals are analyzed, then the local RTC of each client is updated, and time synchronization with the server is achieved.

According to a Fibre Channel Framing and Signaling-4 (FC-FS-4) protocol, ELS time synchronization is that a client sends a time synchronization request frame (CSR) to a time synchronization server first, after a server agrees, a time synchronization (update) frame (CSU) is sent to a corresponding client, the CSU frame is provided with a timestamp for generating the CSU frame by a time synchronization server, the client analyzes the timestamp after receiving the CSU frame and then updates a local RTC to realize time synchronization of the client and the server, the server generally sends the CSU frame to each requested client at regular time, and the phenomenon that the local RTC is increased along with time accumulation due to crystal oscillator errors and other reasons is prevented. The PS time synchronization server side sends continuous SYNx, SYNy and SYNz primitive signals at fixed time, wherein the SYNx, SYNy and SYNz primitive signals carry clock information, each primitive signal is 32bit, the client side receives and analyzes time values carried in the SYNx, SYNy and SYNz primitive signals, and then a local clock counter is updated to realize clock synchronization. PS time synchronization is a broadcast type time synchronization, and is suitable for a scene requiring system-wide or more device synchronization, while ELS time synchronization is a one-to-one time synchronization, and is suitable for a scene where less devices pass through.

Disclosure of Invention

Aiming at the problem of low efficiency of the existing method for realizing the ELS frame based time synchronization server, the invention provides the ELS frame based time synchronization device and method, which can effectively realize the ELS frame based time synchronization server.

In order to achieve the purpose, the invention adopts the following technical scheme:

one aspect of the present invention provides a time synchronization apparatus based on ELS frames, including: the system comprises a timer module, a CPU module, a processor internal storage module, a DMA module and an FC port module;

the timer module is used for moving an ELS time synchronization frame to the FC port module according to the maximum counting periodicity trigger DMA module set by a user;

the CPU module is used for assembling an ELS time synchronization frame according to an ELS time synchronization request frame sent by a user;

the processor internal storage module is used for storing the ELS time synchronization frame assembled by the CPU module;

the DMA module is used for moving ELS time synchronization frames in the internal storage module of the processor to the FC port module;

the FC port module is used for replacing time information in an ELS time synchronization frame with a local real-time RTC value in the sending direction; or for parsing the time information of the ELS time sync frame and updating the local RTC value in the receiving direction.

Further, the maximum count of the timer module may be configurable by a user.

Further, the FC port module is a controller conforming to the FC protocol.

The invention provides a time synchronization method based on ELS frames, which comprises the following steps:

the CPU module assembles an ELS time synchronization frame according to an ELS time synchronization request frame received from a client and stores the ELS time synchronization frame assembled by the CPU to an internal storage module of the processor;

when the counting of the timer module is overtime, the DMA module is triggered to move an ELS time synchronization frame to the FC port module;

replacing the time information of the ELS time synchronization frame with the local real-time RTC value in the FC port module in the sending direction, and sending the recombined ELS time synchronization frame to the FC port module of the docking equipment;

and after receiving the recombined ELS time synchronization frame, the FC port module of the docking equipment updates a local RTC value according to the time information of the analyzed ELS time synchronization frame, and finally realizes the time synchronization of the system.

Further, the assembling of the ELS time synchronization frame includes:

step a1, powering on the CPU module, resetting and releasing, opening up a memory in the memory module in the processor for storing the ELS time synchronization frame, and waiting for receiving the ELS time synchronization request frame;

step a2, when receiving an ELS time synchronization request frame, extracting a source address identifier FC _ ID in the ELS time synchronization request frame as a destination address identifier of a response frame corresponding to the ELS request frame, and pressing the ELS time synchronization response frame into an ELS time synchronization frame buffer;

step a3, updating the effective depth value of ELS time synchronization frame buffer of the DMA module.

Further, the moving of the ELS time synchronization frame includes:

b1, powering on the CPU module, resetting and releasing, setting the maximum count of the sending period timer module of the ELS time synchronization frame, and starting the timer module;

b2, when the count of the timer module reaches the maximum count, triggering the DMA module to transmit, and the DMA module moves the ELS time synchronization frame cached in the storage module inside the processor to the sending frame cache inside the FC port module;

step b3, waiting for the completion of DMA transfer, and preparing to carry out next ELS time synchronization frame transfer.

Compared with the prior art, the invention has the following beneficial effects:

1. the invention utilizes the DMA module to move ELS time synchronization frames in the internal storage module of the processor to the sending buffer of the FC port module without the need of a CPU module for scheduling, thereby having high working efficiency;

2. the invention uses ELS time synchronization frame which is cached by the internal storage module of the processor and is assembled by the CPU module, and moves the ELS time synchronization frame to the sending cache of the FC port module when the counting of the timer module is overtime, and meanwhile, the maximum counting of the timer module can be configured by a user, thus realizing the assembly and the movement of the ELS time synchronization frame by the software module;

3. the invention provides a method for modifying ELS time synchronization frame time information by hardware (FC port module) in a sending direction, so that the time information of the ELS time synchronization frame meets the real-time requirement, and the time information of the ELS time synchronization frame is analyzed in a receiving direction to update a local RTC value, thereby achieving the purpose of time synchronization.

Drawings

FIG. 1 is a schematic structural diagram of an ELS frame-based time synchronization apparatus according to an embodiment of the present invention;

FIG. 2 is a basic flowchart of a method for time synchronization based on ELS frames according to an embodiment of the present invention;

FIG. 3 is a flowchart illustrating an ELS time synchronization frame assembly process of an ELS frame-based time synchronization method according to an embodiment of the present invention;

FIG. 4 is a flowchart illustrating an ELS time synchronization frame moving process of an ELS frame-based time synchronization method according to an embodiment of the present invention;

fig. 5 is a schematic diagram of a system architecture suitable for an ELS frame-based time synchronization method according to an embodiment of the present invention.

Detailed Description

For the sake of understanding, some terms appearing in the detailed description of the invention are explained below:

fc (fiber channel) is a high-speed serial transmission bus proposed by the american standards institute (ANSI) in 1988, has the characteristics of high bandwidth, high reliability and high stability, and is mainly applied to many fields such as avionics, audio and video processing, and large data transmission. The FC switching chip conforms to an FC (fiber channel) communication protocol and is provided with a switching chip with multiple ports, low delay and high reliability. With the continuous development of information technology, the application environment of the switch chip is increasingly complex. In an actual application environment, in order to ensure real-time performance of interconnected devices in the same system, time synchronization operation between the devices is required.

The invention is further illustrated by the following examples in conjunction with the accompanying drawings:

as shown in fig. 1, an aspect of the present invention provides an ELS frame-based time synchronization apparatus, including:

the system comprises a timer module, a CPU module, a processor internal storage module, a DMA module and an FC port module;

the timer module is used for moving an ELS time synchronization frame (CSU frame) to the FC port module according to the maximum counting periodicity trigger DMA module set by a user;

the CPU module is used for assembling an ELS time synchronization frame according to an ELS time synchronization request frame (CSR frame) sent by a user;

the processor internal storage module is used for storing the ELS time synchronization frame assembled by the CPU module;

the DMA module is used for moving ELS time synchronization frames in the internal storage module of the processor to the FC port module;

the FC port module is used for replacing time information in an ELS time synchronization frame with a local real-time RTC value in the sending direction; or for parsing the time information of the ELS time sync frame and updating the local RTC value in the receiving direction.

Further, the maximum count of the timer module may be configurable by a user.

Further, the FC port module is a controller conforming to the FC protocol.

In particular, the time synchronization apparatus based on ELS frame proposed by the present invention can be implemented in a switch chip or an endpoint device.

On the basis of the foregoing embodiment, as shown in fig. 2, another aspect of the present invention provides a time synchronization method based on ELS frames, including:

the CPU module assembles an ELS time synchronization frame according to an ELS time synchronization request frame received from a client and stores the ELS time synchronization frame assembled by the CPU to an internal storage module of the processor;

when the counting of the timer module is overtime, the DMA module is triggered to move an ELS time synchronization frame to the FC port module;

replacing the time information of the ELS time synchronization frame with the local real-time RTC value in the FC port module in the sending direction, and sending the recombined ELS time synchronization frame to the FC port module of the docking equipment;

and after receiving the recombined ELS time synchronization frame, the FC port module of the docking equipment updates a local RTC value according to the time information of the analyzed ELS time synchronization frame, and finally realizes the time synchronization of the system.

Further, as shown in fig. 3, the assembling of the ELS time synchronization frame includes:

step a1, powering on the CPU module, resetting and releasing, opening up a memory in the memory module in the processor for storing the ELS time synchronization frame, and waiting for receiving the ELS time synchronization request frame;

step a2, when receiving an ELS time synchronization request frame, extracting a source address identifier (FC _ ID) in the ELS time synchronization request frame as a destination address identifier of a response frame corresponding to the ELS request frame, and pressing the ELS time synchronization response frame into an ELS time synchronization frame buffer;

step a3, updating the effective depth value of ELS time synchronization frame buffer of the DMA module.

Further, as shown in fig. 4, the moving of the ELS time synchronization frame includes:

b1, powering on the CPU module, resetting and releasing, setting the maximum count of the sending period timer module of the ELS time synchronization frame, and starting the timer module;

b2, when the count of the timer module reaches the maximum count, triggering the DMA module to transmit, and the DMA module moves the ELS time synchronization frame cached in the storage module inside the processor to the sending frame cache inside the FC port module;

step b3, waiting for the completion of DMA transfer, and preparing to carry out next ELS time synchronization frame transfer.

Specifically, as shown in fig. 5, in the system architecture applicable to the time synchronization method based on ELS frames of the present invention, in the sending direction, after the software moves the CSU frame to the sending frame buffer of the hardware, the local RTC count value is used to replace the time information in the CSU frame, and the reassembled CSU frame is transmitted to the peer device through the sending channel. In the receiving direction, after the receiving channel receives the CSU frame, the time information of the CSU frame is extracted, the local RTC is updated, and the time synchronization with the docking equipment is realized.

To sum up:

1. the invention utilizes the DMA module to move ELS time synchronization frames in the internal storage module of the processor to the sending buffer of the FC port module without the need of a CPU module for scheduling, thereby having high working efficiency;

2. the invention uses ELS time synchronization frame which is cached by the internal storage module of the processor and is assembled by the CPU module, and moves the ELS time synchronization frame to the sending cache of the FC port module when the counting of the timer module is overtime, and meanwhile, the maximum counting of the timer module can be configured by a user, thus realizing the assembly and the movement of the ELS time synchronization frame by the software module;

3. the invention provides a method for modifying ELS time synchronization frame time information by hardware (FC port module) in a sending direction, so that the time information of the ELS time synchronization frame meets the real-time requirement, and the time information of the ELS time synchronization frame is analyzed in a receiving direction to update a local RTC value, thereby achieving the purpose of time synchronization.

The above shows only the preferred embodiments of the present invention, and it should be noted that it is obvious to those skilled in the art that various modifications and improvements can be made without departing from the principle of the present invention, and these modifications and improvements should also be considered as the protection scope of the present invention.

9页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:时钟校准电路、时钟校准方法及相关设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!