规范标准

Timings and repetitions for Server Service and Event Handlers

status

  • When the Down Phase is entered (coming from states other than init), the API SoAd_CloseSoCon() shall be called for all Socket Connections associated with this Server Service Instance.
    当进入Down Phase(来自init以外的状态)时,应为与此Server Service Instance相关联的所有Socket Connections调用API SoAd_CloseSoCon()。
  • When the calculated random timer expires and the parameter
    当计算的随机计时器到期并且参数:
    • SdServerTimerInitialOfferRepetitionsMaxdoes not equals ‘0’, the Repetition Phase shall be entered.
      SdServerTimerInitialOfferRepetitionsMaxdoes不等于‘0’,应进入Repetition阶段。
    • SdServerTimerInitialOfferRepetitionsMaxequal ‘0’, the Main Phase shall be entered.
      SdServerTimerInitialOfferRepetitionsMaxequal‘0’,应进入Main阶段。
  • If Sd_ServerServiceSetState() is called with a state other than SD_SERVER_SERVICE_AVAILABLE while being in Initial Wait Phase:
    如果在处于初始等待阶段时使用SD_SERVER_SERVICE_AVAILABLE以外的状态调用Sd_ServerServiceSetState():
    • Enter the Down Phase.
      进入Down阶段。
    • Set all associated EventHandler to SD_EVENT_HANDLER_RELEASED and report it to the BswM by calling the API BswM_Sd_EventHandlerCurrentState.
      将所有关联的EventHandler设置为SD_EVENT_HANDLER_RELEASED,并通过调用API BswM_Sd_EventHandlerCurrentState将其报告给BswM。
    • Cancle all relevant timers for service instance.
      取消服务实例的所有相关计时器。
  • If Sd_ServerServiceSetState() is called with a state other than SD_SERVER_SERVICE_AVAILABLE (i.e. SD_SERVER_SERVICE_DOWN ) while being in Repetition Phase.
    如果在处于Repetition阶段时使用SD_SERVER_SERVICE_AVAILABLE(即SD_SERVER_SERVICE_DOWN)以外的状态调用Sd_ServerServiceSetState():
    • Leave this phase and enter the Down Phase.
      离开此阶段并进入Down Phase.
    • Send a StopOfferService.
      发送StopOfferService。
    • All associated EventHandler which state is not SD_EVENT_HANDLER_RELEASED shall be changed to SD_EVENT_HANDLER_RELEASED and indicated to the BswM by calling the API BswM_Sd_EventHandlerCurrentState().
      所有相关的EventHandler,如果状态不是SD_EVENT_HANDLER_RELEASED都应更改为SD_EVENT_HANDLER_RELEASED,并通过调用API BswM_Sd_EventHandlerCurrentState()指示给BswM。
  • If Sd_LocalIpAddrAssignmentChg() is called with a state other than “TCPIP_IPADDR_STATE_ASSIGNED” while being in Repetition Phase, this phase shall be left and the Down Phase shall be entered.
    如果在处于Repetition阶段时以“TCPIP_IPADDR_STATE_ASSIGNED”以外的状态调用Sd_LocalIpAddrAssignmentChg(),则应保留此阶段并进入Down阶段。
  • If the TCP/IP connection has been lost (Socket connection is other than SOAD_SOCON_ONLINE), the Service Discovery Module shall leave the Repetition Phase and enter the Wait Phase.
    如果TCP / IP连接丢失(套接字连接不是SOAD_SOCON_ONLINE),则服务发现模块应离开Repetition阶段并进入Wait阶段。
  • The Service Discovery Module shall stay in the Main Phase for the configured Server Service as long as the following conditions apply:
    只要满足以下条件,服务发现模块将保留在配置的服务器服务的main阶段:
    • Server Service is in state “AVAILABLE” (i.e. Sd_ServerServiceSetState()has been called with State “SD_SERVER_SERVICE_AVAILABLE”)
      服务器服务处于“AVAILABLE”状态(即已使用状态“SD_SERVER_SERVICE_AVAILABLE”调用Sd_ServerServiceSetState())
    • IP address is assigned and can be used (i.e. Sd_LocalIpAddrAssignmentChg has been called with status TCPIP_IPADDR_STATE_ASSIGNED)
      分配了IP地址并可以使用(即已调用Sd_LocalIpAddrAssignmentChg,状态为TCPIP_IPADDR_STATE_ASSIGNED)
  • If the API LocalIpAddrAssignmentChg has been called with a state other than TCPIP_IPADDR_STATE_ASSIGNED
    如果使用TCPIP_IPADDR_STATE_ASSIGNED以外的状态调用API LocalIpAddrAssignmentChg
    • The Service Discovery Module shall leave the Main Phase and enter the DOWN Phase
      服务发现模块应离开Main阶段并进入DOWN阶段
    • All EventHandler which are not in state SD_EVENT_HANDLER_RELEASED shall be set to SD_EVENT_HANDLER_RELEASED and be indicated to the BswM module by calling the API BswM_Sd_EventHandlerCurrentState ⌋()
      所有未处于SD_EVENT_HANDLER_RELEASED状态的EventHandler都应设置为SD_EVENT_HANDLER_RELEASED并通过调用API BswM_ Sd_EventHandlerCurrentState报告给BswM模块
  • If the TCP/IP connection has been lost (Socket connection is other than SOAD_SOCON_ONLINE), the Service Discovery Module shall leave the Main Phase and enter the Wait Phase
    如果TCP / IP连接丢失(套接字连接不是SOAD_SOCON_ONLINE),则服务发现模块应离开Main阶段并进入Wait阶段。
  • If the API Server Sd_ServerServiceSetState() is called with state “SD_SERVER_SERVICE_DOWN” while the IP address is still assigned (i.e. Sd_LocalIpAddrAssignmentChg has been called with state TCPIP_IPADDR_STATE_ASSIGNED), the Service Discovery module shall.
    如果分配的IP地址有效(即已使用状态TCPIP_IPADDR_STATE_ASSIGNED调用Sd_LocalIpAddrAssignmentChg),且使用状态“SD_SERVER_SERVICE_DOWN”调用APISd_ServerServiceSetState(),则服务发现模块应。
    • send a StopOfferService
      发送StopOfferService
    • enter the DOWN Phase
      进入DOWN阶段
    • all subscriptions of the eventgroup(s) of this service instance shall be deleted and SD_EVENT_HANDLER_RELEASED and reported to BswM using the API BswM_Sd_EventHandlerCurrentState
      应删除此服务实例的事件组的所有订阅,并使用API BswM_Sd_EventHandlerCurrentState将SD_EVENT_HANDLER_RELEASED报告给BswM

Timings and repetitions for Server Service and Event Handlers

Eventgroup received

  • If a SubscribeEventgroup Entry or StopSubscribeEventgroup Entry are received within the Initial Wait Phase (or other phases) for an Event Handler of this Server Service Instance, it shall only be processed within the Service Discovery. Please refer to the according sequence diagrams and section 7.6.4.
    如果在此服务器服务实例的事件处理程序的Initial Wait Phase (或其他阶段)内收到了SubscribeEventgroup Entry或StopSubscribeEventgroup Entry,则只能在Service Discovery中处理它。

“SubscribeEventgroup” entry received:

  • Send a SubscribeEventgroupAck / Nack entry using Unicast considering the appropriate delay without changing the current counter value and without influencing the current running repetition timer/repetition phase or timer/main phase.
    考虑适当的延迟, 使用Unicast发送SubscribeEventgroupAck / Nack entry, 且不改变当前Counter值,也不影响当前运行的timer。
  • Call the BswM with the API BswM_Sd_EventHandlerCurrentState() with state SD_EVENT_HANDLER_REQUESTED only if the state for this EventHandler changed (i.e. has not been SD_EVENT_HANDLER_REQUESTED) .
    仅当此此EventHandler的状态改变(即尚不是SD_EVENT_HANDLER_REQUESTED)时,将状态SD_EVENT_HANDLER_REQUESTED赋值给API BswM_Sd_EventHandlerCurrentState() 并通知BswM。
  • Start the TTL timer according to the value received via the SubscribeEventgroup Entry.
    按照通过SubscribeEventgroup Entry获取的值启动TTL计时器。

“SubscribeEventgroup” entry received:

  • If the TTL of a received SubscribeEventgroup Entry expires, the following step shall be performed in the following order:
    如果收到的SubscribeEventgroup Entry的TTL到期,则按以下顺序执行以下步骤:
  • If this has been the last subscribed client, report “SD_EVENT_HANDLER_RELEASED” to the BswM by calling the API BswM_Sd_EventHandlerCurrentState() and update the state within the Service Discovery Module.
    如果这是最后一个订阅的客户端,则通过调用API BswM_Sd_EventHandlerCurrentState()将状态更新为 “SD_EVENT_HANDLER_RELEASED”,并报告给BswM报告。

StopSubscribeEventgroup Entry:

  • Stop the TTL timer for this client
    停止这个客户端的TTL计时器
  • Update State
    更新状态
  • If this has been the last subscribed client, report “SD_EVENT_HANDLER_RELEASED” to the BswM by calling the API BswM_Sd_EventHandlerCurrentState()
    如果这是最后一个订阅的客户端,则通过调用API BswM_Sd_EventHandlerCurrentState()更新状态为” SD_EVENT_HANDLER_RELEASED”并报告给BswM

Timings and repetitions for Server Service and Event Handlers

Find” entry received

In repetition phase:

Send an “OfferService Entry” considering the appropriate delay without changing the current counter value and without influencing the current running repetition timer.
在不改变当前counter值且不影响当前运行的重复计时器的情况下,考虑适当的延迟, 发送“OfferService Entry”。

Note: Currently this specification does not allow sending “FindService Entries” using unicast. For compatibility reasons receiving such entries shall be supported.

In Main Phase:

Send an “OfferService Entry” considering the appropriate delay .
考虑适当的延迟,发送“OfferService Entry” 。

Note: Currently this specification does not allow sending “FindService Entries” using unicast. For compatibility reasons receiving such entries shall be supported.

Timings and repetitions for Server Service and Event Handlers

Communication phases Server

  • Especially after starting multiple ECUs, the multicast messages of the Service Discovery come with the risk of overflowing ECUs with too many messages. Therefore, the Service Discovery can be configured with a suitable message sending behavior.
    特别是在启动多个ECU之后,Service Discovery的多播消息可能会因为消息过多而导致ECU溢出。 因此,可以使用适当的消息发送行为配置Service Discovery。
  • For every Server Service Instance different phases are defined as shown in following figure :
    对于每个服务器服务实例,定义了不同的阶段,如下图所示
    • Down
    • Available
      • Initial Wait Phase
      • Repetition Phase
      • Main Phase

Interaction of the AUTOSAR Service Discovery module

  • The AUTOSAR Service Discovery module offers functionality to detect and offer available services – i.e. functional entities – within the vehicle network. To do so, it makes use of the IP Multicast and so called SOME/IP-SD messages.
    AUTOSAR服务发现模块用来在车辆网络内检测和提供可用服务(即功能实体)。 为此,它使用IP多播和所谓的SOME / IP-SD消息。
  • The Service Discovery module (Sd) is located between the AUTOSAR BSW Mode Manager module (BswM) and the AUTOSAR Socket Adaptor module (SoAd).
    Service Discovery模块(Sd)位于AUTOSAR BSW模式管理器模块(BswM)和AUTOSAR套接字适配器模块(SoAd)之间。


Overview of Services and Eventgroups