AUTOSAR
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    2
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # StateManagement ###### tags: `專題` * State Management (project specific) * ![](https://i.imgur.com/fw1iXhB.png) * responsible for all aspects of Operational State Management including handling of incoming events, determining the currentsetofactiveFunction Group States, prioritization of these events/requests setting the corresponding internal States. * Incoming events : AUTOSAR Adaptive Platform Application or Adaptive Application will change the value of "Trigger" fields which provided by SM to issued Incoming events * evaluate these events and decide based on: * Event type * Event priority * Application identifier (is not supported in this release) * the first two items are project specific * handling the following states: * Machine State * Function Group State * may contain one or more state machines, which might be more or less loosely coupled depending on project needs. * for initiating Function Groupand Machine State transitions by requesting them from Execution Management. * how to get into certain state -> interacts with the Execution Management interface to request Function Groups (might additionally depend on NM state) and the Machine State to enter specific state * provid access to its internal state via ara::com services. Using certain interface: * Notifier * getting current state * Trigger * requesting new state * Adaptive Applications and AUTOSAR Adaptive Platform Applications can register to the events of the "Notifier" fields and can change their internal behavior by writing to the "Trigger" fields (and may provide their own property or event via an ara com interface) * If an State Managements internal State change is triggered then Execution Management may be requested to set Function Groups or Machine State into new Function Group State. And The state change request for Function Groups can be issued by several AUTOSAR Adaptive Platform Applications: * Platform Health Management : to trigger error recovery * Diagnostic Management : to switch the system into different diagnostic states and to issue resets of the system. * Update and Configuration Management : to switch the system into states where software or configuration can be updated and updates can be verified. * Network Management : to coordinate required functionality and network state.(This is no active request by NM ) * Dependices to other functional clusters * don't depend: * OS interface: no direct interfact to the OS. All OS depndencies are abstracted by the Execution Management * depend: * Execution Manager interface: * is depend on it to start and stop processes(as part of defined Function Groups or Machine States) * additionally uses the StateClient functionality of Execution Management to inform Execution Management about State Management Process State * performs the State transitions and controls the actual set of running Modelled Processes, depending on the current States. * Plarform Health Managemet: * Plarform Health Managemet supervises configured entites and informs State Management when any of these entites fails. * shall monitor and supervise SM * Diagnostic Management: * Diagnostic Management request different reset types for a Diagnostic Address at SM. * SM prevenets the system from shutting down during an active diagnostics session * Update And Configuration Management: * It coordinates the update sequence with State Management to set a set of Function Groups(affected by the update) to dedicated States. * Network Management: * provide: * multiple NetworkHandle fields * State Management registers to and reacts on changes of these fields issued by Network Management * represents a set of (partial) networks * responsible for en- and disabling (partial) networks. * ara::com fields (NetworkHandle) where each of the fields represents a set of (partial) networks. * evaluates the NetworkCurrentState field to set Function Groups to the corresponding Function Group State and set the NetworkRequestedState field in dependency of Function Groups and their Function Group State . * SM shall prevent network from shutting down during an active update or diagnostic session. * State : * Machine State * goal : In general, Machine States are used to control machine lifecycle (startup/shutdown/restart) and Modelled Processes of platform level Applications * is a specific type of Function Group State * are determined and requested by the State Management functional cluster * The Function Group States, including the Machine State, define the current set of running Modelled Processes. * Each Application can declare in its Execution Manifests in which Function Group States its Modelled Pro- cesses have to be running. ![](https://i.imgur.com/0Ob65dY.png) > Execution Management terminates running Modelled Processes and then starts Modelled Processesactive in the new state before confirming the state change to State Management. * state : * introduce: * State Management will run in every Machine State (this includes Startup, Shutdown and Restart) * there is always a software entity that can introduce changes in the current state of the Machine * Execution Management will be controlled by State Management and therefore it should not execute any Function Group State changes on its own. * start-up: * If system integrator doesn’t configure State Manage- ment to be started in Startup Machine State, then Machine will never be able transit to any other state and will be stuck forever in it * Shutdown * Restart * Function Group State * goal : Function Group States individually control Modelled Processes which belong to groups of functionally coherent user level Applications. * To support this use case ( If more than one group of functionally coherent Applications is installed on the same machine ) , additional Function Groups and Function Group States can be configured * Execution Management terminates not longer needed Modelled Processes and then starts Modelled Processes active in the new Function Group State before confirming the state change to State Management. ### interact * State Management should be configured to run in every Machine State (this includes Startup, Shutdown and Restart) other than Off. This expectation is needed to ensure that there is always a software entity that can introduce changes in the current state of the Machine. #### Interaction between the SM and Adaptive Applications ![](https://i.imgur.com/BOXMV7e.png) * State Management provides a service interface TriggerOut with a Notifier field,where **each Adaptive Application** can subscribe to,thus it is informed whenever a State Managements internal State changes. * In the opposite way each Adaptive Application can influence the behavior of State Management by writing to the Trigger fields provided * To have the possibility and flexibility to address different groups of Modelled Processes a new communication pattern called CommunicationGroups which defines a kind of compound service with a proxy and a skeleton was introduced. * it is essential, that a client replies to each server request, independently if the request could be fulfilled by the client or not. * With this approach a server can: * broadcast a message to all clients in the group * send a message to a dedicated client in the group * can get a list of all clients in the group * receive the replies from all clients in the group * Conclusion: * State Management as a server of (multiple) CommunicationGroups can send a message to all the clients in a group and can check if all clients answered the request with expected answer #### PowerModes for Adaptive (Platform) Applications * The PowerModes are intended to influence the internal behavior of all Processes in the system. * This PowerMode is used to realize the so called "late-wakeup", where a new wakeup reason is found during a proceeding shutdown * there are three modes supported * "On" : A Modelled Process that receives this PowerMode behaves normally as it has been spawned by ExecutionManagement. It is used to "undo" the other PowerMode requests. Modelled Processes that are just spawned should behave like an "On" is requested as PowerMode. * EX : When the new wakeup reason is found an "On" request will be sent to the Modelled Pro- cesses, thus they can immediately continue with their "normal" work without the need to be spawned again * "Suspend" : This PowerMode is intended to be used as a signal to the Modelled Processes that the system is suspended( e.g. to RAM or to disc). Tt will be project-specific and might depend on the environment. * "Off" : A Modelled Process that receives this PowerMode behaves like it receives a SIGTERM from Execution Management, beside exiting. * Modelled Processes that support the PowerModes are expected to behave like they would have received an "On" request when they are entering "Running" state when being spawned by Execution Management to keep compatibility with Modelled Processes which do not support the PowerModes. #### Diagnostic Reset for Adaptive (Platform) Applications * The rationale behind this is to change the behavior of Modelled Processes without the need to terminate and restart them. -> This service is intended to influence Modelled Processes that are addressed by Diagnostic Address. * The reaction to the request itself is project- specific. #### Interaction with Platform Health Management * Platform Health Management is responsible for monitoring supervised entities via local supervision(s) and checking the status of health channels. * Failures in local supervision(s) will be accumulated in a global supervision whose scope is a single Function Group (or a part of it). * When State Management receives notification from Platform Health Manage- ment it can evaluate the information from the notification and initiate the project-specific actions to recover from the failure #### Interaction with Diagnostic Management * Diagnostic Management is responsible for diagnosing, configuring and resetting Diagnostic Addresses. * Diagnostic Management provides the ara::diag::EcuResetRequest interface to forward ECU Reset service requests to State Management * State Management has to keep track of reset causes and has to reset the persistent reset cause when it is newly spawned. * several different reset types have to be carried out to fulfill functionality of Diagnostic Management : * hardReset * keyOffOnReset * may be translated by State Managements internal logic to stop and start the Function Group * softReset * may be translated by State Managements internal logic to request Modelled Processes to perform internal functionality without the need to terminate and start them again * customReset * All Modelled Processes which should support this feature have to use the ara::com methods #### Interaction with Update and Configuration Management * Update and Configuration Management is responsible for installing, removing or updating Software Clusters as smallest updatable entity. * system integrator has to limit usage of this interface to Update and Configuration Management by configuring Identity and Access Manage- ment. * Procedure: 1. Update and Configuration Management will ask State Man- agement if it is allowed to perform an update. The decision will depend on current state of the machine (or whole vehicle) 2. As soon as State Management allows updating, it is necessary that State Man- agement denies any further request for a new update session. (multiple update sessions at a time shall be not allowed.) 3. As soon as State Management allows updating, it is necessary that State Man- agement prevents system from shutting down. 4. Update and Configuration Management has to inform State Management when no more operations for the update have to be done, thus State Management can clear now the information about an ongoing update and can continue its regular job. * if it is necerry to shut down the machine -> Additionally State Management has to persist the information about an ongoing update session, thus, after a machine restart (independently if restart was expected or not), Update and Configuration Management can continue to update. * During the update there will be up to three different steps, depending if a Software Cluster is installed, removed or updated. * prepareupdate * in this step, State Management will at least set all the Function Groups, given as parameter, to Off state. And Update and Configura- tion Management will perform the real update * prepare verify * perform a verification of the update * at least set all the Function Groups, given as parameter, to Verify state. * These request will be reported to Update and Configuration Management as failed when any of the Function Groups could not be set to the requested Function Group State * prepare rollback * When any of these steps fails,Update and Configuration Management can decide to revert previous changes.Therefore Update and Configuration Management uses PrepareRollback function * PrepareRollback function will at least set all the Function Groups, given as parameter, to Off state. * ps : When a Software Cluster is removed by Update and Configuration Man- agement, VerifyUpdate will never be called by Update and Configuration Management. Contrary to that PrepareUpdate will never be called, when a new Software Cluster is installed into the Machine. #### Interaction with Network Management ![](https://hackmd.io/_uploads/ry1i7IQP2.jpg) * To be portable between different ECUs the Adaptive Applications should not have the need to know which networks are needed to fulfill its functionality, because on different ECUs the networks could be configured differently. * The NetworkHandles are defined in the Machine Manifest and are there assigned to a Function Group State. * Whenever (partial) networks are activated or deactivated from outside request and this set of (partial) networks is represented by a NetworkHandle in Machine Manifest Network Management will change the value of the corresponding NetworkHandle. And State Management is notified about the change, because it has registered to all availabe NetworkHandle fields. * State Managements shall change the value of the NetworkHandle when a Function Group has to change its Function Group State. Network Management will recognize this change and will change the state of the (partial) networks accordingly to the NetworkHandle. * afterrun : * a Function Group stays longer in its Function Group State when the causing (partial) network set has been switched off * a (partial) net- work is longer available than the causing Function Group has been switched to Function Group State ’Off’. #### Interaction with Execution Management ![](https://hackmd.io/_uploads/r1Ajm8QD2.jpg) * Execution Management is used to execute the Function Group State changes. * The decision to change the state might come from inside of State Management based on State Managements States or might be requested at State Management from an external Adaptive Application. * Execution Management returns the result of the request. #### State Management in a virtualized/hierarchical environment * Each of the virtual machines contain State Management and there may have a lot of virtual machines. * To have coordinated control over the several virtual machines there has to be virtual machine which supervises the whole ECU state. This is not only valid for a virtualized environment, but for a hierarchical environment, too. * State Management shall be able to register to the "Trigger" fields of a supervising State Management instance to receive information about the whole ECU state.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully