1 Introduction and functional overview
【功能】
Time Synchronization between different applications and/or ECUs
【目的】
be able to track such events in time or to trigger them at an accurate point in time.
【方式】
ATime Synchronization APIis offered to the Application, so it can retrieve the time information synchronized with other entities / ECUs.
【提供协议】
For the format,message sequences and semanticsof the time synchronization pro
tocols to use, please refer to theProtocol Requirements Specicification (PRS)of the
AUTOSAR Time synchronization Protocol (see [1]).
The Time Synchronization functionality is then offered by means of different "Time
Base Resources" (from now on referred to asTBR).
不同类型的TBR等效化设计 归于Synchronized Time Base Manager (StbM)提供。
These TBRs are classified in different types. These types have an equivalent design
to the types of the time bases offered in the Synchronized Time Base Manager speci
fication [2] (from now on referred to asStbM). The classification is the following:
•Synchronized Master Time Base
•Offset Master Time Base
•Synchronized Slave Time Base
•Offset Slave Time Base
As in StbM, the TBRs offered by the Time Synchronization module (TS from now on),
are also synchronized with other Time Bases on other nodes of a distributed system.
The Application consumes the time information provided and managed by the TBRs.
Therefore, the TBRs serve as Time Base brokers, offering access to Synchronized
Time Bases. By doing so, the TS module abstracts from the "real" Time Base provider.
【总结】
TS代替了硬件真实的时钟,由包含TS的StbM提供不同类型的TBR给需要同步时间的APP使用。
2.2 Definitions
2.2.1 ara::core::SteadyClock
Definition:TS is usingara::core::SteadyClockas the basis for its interfaces
and for synchronization with the daemon process realizing the time-sync protocol.
2.2.2 Time Base Application
1.Active Application
This kind of Applicationautonomously calls the TSeither:
•Toread timeinformation from the TBRs
•Toupdate the Time Basemaintained by a TBR, according to application information.
2.Notification Application
This feature will be provided at a later release/version of the TS.
7.1 General Overview of TS
【实现基础】
For the Adaptive Platform, threedifferent technologieswere considered tofulfill such
Time Synchronization requirements. These technologies were:
•StbM of the Classic Platform
•Library chrono - either std::chrono (C++11) or boost::chrono [8]
•The Time posix interface [9]
7.1.1 Base functionality of every Time Base
Every Time Base has to provide a minimum set of functionality, as listed below:
•offer possibility to obtain the current timestamp
•creating a snapshot of its parameters
【Time Base Status】状态
【Rate Deviation】时间漂移率 可能每个应用对时间飘了的容忍不一样
【Clock Time Value】
Reading the clock’s time value is very likely the most commonly performed operation
by the applications interacting with TS.
To ensure type safe handling of time values, the timepoint is provided as std::chrono
structure.
7.3 Normal Operation
7.3.1 Introduction
A Global Time network consists of a Time Master and at least one Time Slave. For
each Time Domain, the Time Master is distributing the Global Time Base to the con
nected Time Slaves via Time Synchronization messages. The Time Slave corrects the
received Global Time Base taking into account the Time Stamp at the transmitter side
and the own generated receiver Time Stamp.
The local time of a Slave Time Base will be maintainedautonomouslyand updated
whenever a new time value is received from its associated Master Time Base.
--从机根据主机发送的时间戳和接收到的时间戳算本地用的全局时基
其他具体使用的接口 状态 和实现机制先不讨论了。先明白是干啥的吧。