Adaptive Construction of Finite State Machines in Applications Based on User-Related Conditions.
Configurable finite state machines in applications address the inflexibility of existing frameworks by enabling dynamic user interface adaptations based on user interactions, improving user experience and functionality through human-readable configuration files.
Patent Information
- Application Number
- JP2024517484
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2021-10-14
- Filing Date
- 2022-10-13
- Publication Date
- 2024-10-29
AI Technical Summary
Existing application frameworks lack the ability to dynamically and interactively adapt user interfaces based on user interactions, leading to inflexible and non-interactive user experiences, particularly in complex scenarios involving branching logic and user conditions.
The implementation of configurable finite state machines (FSMs) defined by human-readable configuration files, which are translated into machine-readable instructions to manage user interface elements and transitions, allowing applications to dynamically respond to user actions and conditions.
Enables dynamic and interactive user interfaces that can handle complex branching logic, provide personalized experiences, and improve application functionality by allowing non-developers to customize application behavior through configuration files, enhancing user engagement and adaptability.
Smart Images

Figure 2024539548000001_ABST
Abstract
Description
[Technical field]
[0001] (Related Applications) This application claims priority to U.S. Provisional Patent Application No. 63,255 / 603, entitled "Adaptive Configuration of Finite State Machines in Applications Based on User Related Conditions," filed October 14, 2021, which is incorporated by reference in its entirety herein. [Background technology]
[0002] An application executing on a computing device may provide a user interface that includes various elements for display. The application may be configured to perform user interface actions in response to user interaction with the elements of the user interface. Summary of the Invention
[0003] Aspects of the present disclosure are directed to a system and method for configuring finite state machines (FSMs) for an application. At least one server may identify a configuration file for the application. The configuration file may include human readable instructions that define a plurality of FSMs for a corresponding plurality of routines to address user states. Each of the plurality of FSMs may identify (i) a plurality of states, including at least a first state and a second state, each of which may identify an output that the state provides through the application, and (ii) a plurality of transitions, each of which may identify an event that is detected through the application to transition from the first state to the second state. The events may correspond to user actions performed through the application of the respective routine. The at least one server may generate intermediate instructions that define the plurality of FSMs using the human readable instructions of the configuration file. The at least one server may provide the intermediate instructions generated from the configuration file to the application to generate machine readable instructions that define the plurality of FSMs to be selectively invoked by the application.
[0004] In some embodiments, each transition of the plurality of transitions in at least one FSM of the plurality of FSMs may specify an event to be detected via a user interface element of the application. The event may correspond to a user action to be performed for a respective routine. In some embodiments, at least one transition of the plurality of transitions in a first FSM of the plurality of FSMs may specify an event for invoking a second FSM of the plurality of FSMs defined by human readable instructions in a configuration file. In some embodiments, at least one state of the plurality of states in at least one FSM of the plurality of FSMs may identify one or more user interface elements for presenting an output via the application.
[0005] In some embodiments, the at least one server may receive a script from a computing device that includes human readable instructions generated using a development application. In some embodiments, the at least one server may use a transpiler to convert the human readable instructions into intermediate instructions that are compiled by the application when loaded. In some embodiments, the at least one server may send to a client device intermediate instructions that are loaded by an application installed on the client device.
[0006] In some embodiments, the at least one server may select intermediate instructions to provide to the application in response to a request for a routine to address a user state of the application. In some embodiments, the at least one server may send a content item for presentation via a user interface element of the application in response to the application invoking a first FSM of the plurality of FSMs upon detection of an event that transitions from a first state to a second state. In some embodiments, the at least one server may receive a record entry from the application on the client device identifying a user action associated with the detected event via a user interface element of the application.
[0007] Aspects of the present disclosure are directed to a system and method for processing finite state machines (FSMs) on an application. The application, when executed on a client device, may load machine-readable instructions that define a plurality of FSMs corresponding to a plurality of routines for addressing a user state. The application may identify the plurality of FSMs defined by the machine-readable instructions. Each FSM of the plurality of FSMs may identify (i) a respective first state in a plurality of states that each specifies an output to be provided through the application, and (ii) a plurality of transitions from the respective current state, each transition of the plurality of transitions specifying a respective event to be detected through the application to transition the corresponding FSM from the first state to a second state. The respective event may correspond to a user action performed through the application for the respective routine. The application may detect a user action performed through the application that corresponds to the respective event specified by at least one of the plurality of transitions specified in the FSM of the plurality of FSMs. In response to detecting the user action, the application may update the FSM from the respective first state to a second state and provide an output resulting from the second state.
[0008] In some embodiments, the application may generate machine-readable instructions by compiling intermediate instructions defining the FSMs received from the server, hi some embodiments, the application may identify machine-readable instructions for corresponding routines to load based on a user state to be addressed.
[0009] In some embodiments, the application may replace the second machine-readable instructions with the machine-readable instructions in response to receiving a configuration update including machine-readable instructions to address the user's condition. In some embodiments, the application may send a record entry to the server identifying a user action associated with the event detected via a user interface element of the application.
[0010] In some embodiments, the application may use the event bus to monitor invocation of the FSM in response to a user action corresponding to a respective event specified by at least one of the transitions in the respective current state. In some embodiments, the application may retrieve a content item from a server for presentation via a user interface element of the application according to an output specified by the second state of the FSM. In some embodiments, the application may present one or more user interface elements on the application according to an output specified by the second state of the FSM.
[0011] In some embodiments, each transition of the plurality of transitions in at least one FSM of the plurality of FSMs may specify an event that is detected via a user interface element of the application. The event may correspond to a user action to be performed for a respective routine. In some embodiments, at least one transition of the plurality of transitions in a first FSM of the plurality of FSMs may specify an event that invokes a second FSM of the plurality of FSMs defined by machine-readable instructions in a configuration file.
[0012] Aspects of the present disclosure are directed to systems and methods for configuring finite state machines (FSMs) for an application. At least one server may specify a configuration file for the application. The configuration file may define a plurality of FSMs for a corresponding plurality of routines for addressing the states. Each of the plurality of FSMs may specify a plurality of states including at least a first state and a second state, each state specifying an output of an individual routine of the plurality of routines. The output may specify one or more graphical elements for a user interface of the application. Each of the plurality of FSMs may specify a plurality of transitions, each of the transitions specifying an event to be detected via a user interface of the application to transition from a first state to a second state. The event may correspond to an action performed via the application on the individual routine. The at least one server may use the configuration file to generate machine-readable instructions that define the plurality of FSMs to be selectively invoked by the application. The at least one server may provide the machine-readable instructions generated from the configuration file for inclusion in the application.
[0013] In some embodiments, the at least one server may receive, for storage in a logging database, record entries associated with interactions detected on a user interface of the application that match actions corresponding to events specified by at least one of the plurality of transitions. In some embodiments, the at least one server may provide a content item to a client device for presentation as one of one or more graphical elements for a user interface of the application in response to a request for content.
[0014] Aspects of the present disclosure are directed to a system and method for processing finite state machines (FSMs) on an application. A client device may identify a plurality of FSMs defined by machine-readable instructions for the application. The plurality of FSMs may be for a corresponding plurality of routines for addressing a condition. Each of the plurality of FSMs may identify a plurality of states including at least a first state and a second state, each state may specify an output for an individual routine in the plurality of routines. The output may specify one or more graphical elements for a user interface of the application. Each of the plurality of FSMs may specify a plurality of transitions, each of the transitions specifying an event to be detected via a user interface of the application to transition from a first state to a second state. The event may correspond to an action performed via the application for the individual routine. The client device may determine that an interaction detected on a user interface of the application matches an action corresponding to an event specified by at least one transition of an FSM of the plurality of FSMs. In response to the determination, the client device may invoke the FSM to update a current state of the FSM to a next state and modify the user interface to present one or more graphical elements specified with an output for the next state.
[0015] In some embodiments, the client device may maintain a current state of each FSM in a plurality of FSMs for the application. The current state may be associated with one or more of a plurality of transitions. In some embodiments, the client device may transmit, for storage in a logging database, record entries associated with interactions detected on a user interface of the application that match actions corresponding to events specified by at least one transition. [Brief description of the drawings]
[0016] The above and other objects, aspects, features, and advantages of the present disclosure will become more apparent and be better understood by referring to the following description taken in conjunction with the accompanying drawings. [Figure 1] 1 illustrates a block diagram of an architecture of a system for managing plug-ins in accordance with an exemplary embodiment. [Diagram 2] 1 illustrates a screenshot of a user interface for defining a finite state machine (FSM) used in a system for managing plug-ins according to an exemplary embodiment. [Diagram 3] 1 illustrates a block diagram of an architecture of an event bus in a system for managing plug-ins in accordance with an illustrative embodiment; [Figure 4] 1 illustrates a block diagram of an event bus interfacing with multiple finite state machines in a system for managing plug-ins according to an illustrative embodiment. [Diagram 5] 1 illustrates a flow diagram of a process for unlocking skills in a system for managing plug-ins in accordance with an illustrative embodiment. [Figure 6] 4 illustrates a block diagram of a sequence of events and states on an event bus of a system for managing plug-ins in accordance with an illustrative embodiment; [Figure 7] 1 illustrates a block diagram of a system for managing layouts for plug-ins in accordance with an illustrative embodiment. [Figure 8] 1 illustrates a block diagram of a platform in a system for managing layouts for plug-ins in accordance with an illustrative embodiment. [Figure 9] 1 illustrates a block diagram of a tree for defining user interface rendering in a system for managing plug-in layouts in accordance with an exemplary embodiment; [Figure 10] 4 illustrates a block diagram of an example user interface used by the system to manage the layout of plug-ins in accordance with an example embodiment. [Figure 11]1 illustrates a flow diagram of a process for analyzing configurations in a system for managing layouts in a plug-in in accordance with an illustrative embodiment. [Figure 12] 4 illustrates a block diagram of a configuration tree generated by a system for managing plug-in layouts according to an illustrative embodiment; [Figure 13] 4 illustrates an example block diagram of a tree and navigation screen generated by a system for managing plug-in layouts according to an exemplary embodiment. [Figure 14] FIG. 2 is a block diagram of a theme configuration used in a system for managing layouts for plug-ins in accordance with an illustrative embodiment. [Figure 15] 1 illustrates a flow diagram of a process for merging themes according to priority in a system for managing layouts for plug-ins in accordance with an illustrative embodiment. [Figure 16] FIG. 1 illustrates a block diagram of a system for providing finite state machines (FSMs) to applications in accordance with an illustrative embodiment. [Figure 17A] 1 illustrates a block diagram of a process for generating instructions in a system for providing finite state machines (FSMs) to applications in accordance with an illustrative embodiment. [Figure 17B] FIG. 1 illustrates a block diagram of a process for processing finite state machines (FSMs) in a system for providing finite state machines (FSMs) to applications in accordance with an illustrative embodiment. [Figure 17C] 1 illustrates a block diagram of a process for modifying a user interface in a system for providing a finite state machine to an application in accordance with an illustrative embodiment. [Figure 18A] 1 illustrates a flow diagram of a method for configuring finite state machines (FSMs) on an application in accordance with an illustrative embodiment. [Figure 18B] 1 illustrates a flow diagram of a method for processing finite state machines (FSMs) on an application in accordance with an illustrative embodiment. [Figure 19]1 illustrates a block diagram of a server system and a client computer system in accordance with an exemplary embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0017] For purposes of reading the following description of the various embodiments, the following listing of sections of this specification and their respective contents may be helpful.
[0018] Section A describes a front-end platform and architecture for a behavior engine for configuring applications to execute finite state machines (FSMs).
[0019] Section B describes a front-end platform and architecture for a layout engine for defining an application's user interface according to finite state machines (FSMs).
[0020] Section C describes embodiments of systems and methods for configuring and processing finite state machines on finite state machines (FSMs).
[0021] Section D describes network and computing environments useful for practicing the embodiments described herein.
[0022] (A. Behavior Engine Platform and Architecture) A layout engine may be configured to build screens and content, but may not be able to handle more than a simple sequence of screens. This may not be sufficient to support a rich content platform. For example, if a flow has different logic branches based on user input, the layout engine may not be designed to handle this. Another scenario is when an application receives a push notification in the middle of a flow, the decision of whether to interrupt the flow or not may not be well defined.
[0023] To address these challenges, the logic for running an application may be defined in a domain-specific language so that clinical operations can be customized rather than hardwired into the application, providing the ability to control the functionality of the application, especially if the clinical operations can control not only the content but also the logic by which that content is presented.
[0024] (1. Context) A layout engine may support the design and arrangement of user interfaces (UIs), allowing non-developers (e.g., clinicians) to build content for various clinical operations. In addition to supporting the layout of components on screens, the layout engine may also support navigation stacks (e.g., tabs, stacks, and modals). A layout engine may be limited to supporting linear content, such as a sequence of screens where next and back are the only options without any reinforcement. However, operation of the application may involve complex branching decisions, interruptions in flow, and user interactions. These complexities may involve changes in the flow of screens, error conditions, and application programming interface (API) calls to change the display of the user interface.
[0025] To solve such problems, a behavior engine that defines customized logic, state machines, or behavior trees can be added together with the layout engine to run in parallel. The behavior engine can augment the layout engine to support not only a static linear sequence, but also more sophisticated features such as dynamic flows with branching and error handling. That is, the behavior engine can support interactions, logic, and state management, etc. Where the layout engine focuses on presentation, the behavior engine can compose the interactions and states of the application.
[0026] The behavior engine is configurable by clinical operations. For example, content and therapy are all about making rational decisions using past and current data. With the user's data, you can configure and customize what the treatment journey will be for that user. The behavior engine can also be useful for in-house development. Defining the journey through a behavior engine can improve the quality of the application, since a lot of state management and reasoning is a source of failure or bugs.
[0027] (2.Purpose) If the application is configurable by clinical operations, the application may have the ability to provide more diverse and interactive content, for example, if the behavior engine is configured to track treatment dates and the user has not completed a lesson, the application may be configured by the behavior engine to display an additional screen of encouragement.
[0028] Functionality may be defined in configuration files to specify the layout and logic of the application. Content assets may reside on a Content Management System (CMS). Depending on the CMS, configuration files are defined to provide the content (including look and feel), flow and behavior of the application. An application may also have startup logic for various operations such as startup sequence, flow and simple deterministic operations.
[0029] The application may also be configured to execute game mechanics logic. A behavior engine and configuration files may be used to execute the game mechanics and associated artificial intelligence (AI). In this scheme, therapy may become more interactive. Game mechanics allow the therapy provided by the application to simulate a session with a human therapist. In such a session, the therapist may dynamically customize strategies and content to respond to the patient's condition. Additionally, therapeutic feedback to the patient may be incorporated into the session.
[0030] The training sessions laid out in the structure can be interactive games in which the user participates and the application adaptively interacts with the user. The ability to address the patient's condition can be improved by the application learning how to solve or learn treatment strategies. A behavior engine can test the patient and evaluate what the best next steps in treatment are.
[0031] Using research data on rewiring the human brain, configuration files can be designed to leverage the data to identify which parts of the brain are not working properly for a specific disorder. The behavior engine can be equipped with a toolbox of scientifically proven exercises for the specific disorder and which parts of the brain need to be targeted. The behavior engine can be used to customize treatment for each individual and target the relevant parts of the brain.
[0032] (3. Behavior Engine Specifications) The behavior engine may be customizable using configuration files and a content management system (CMS) rather than being hardwired into the application code. The configuration files allow non-developers to define the logic. The behavior engine may also be serializable. During the course of a treatment, the application can continue to track progress even if the user quits the application. The behavior engine may support temporal values that cannot be serialized. For example, a flow may specify that state should only be tracked for the lifetime of the flow. The value of a text field in a user interface may be used in the next step. State may not be saved or serialized between sessions.
[0033] Behavior engines can be composable with building blocks. An application may lack one giant engine to handle all the different features of the application. For example, in a React or Redux application, all application logic may be in one place (e.g., Redux), making the application error-prone and difficult to manage. Behavior engines can be used to reduce complexity. Composable engines can split a problem into sub-problems. Each lesson can have a separate configuration. Shared state may be supported, which can be achieved by one lesson exposing state that different lessons can use.
[0034] For each composable unit, the behavior engine can support multiple instances of a flow. For example, a lesson on day 20 (e.g., take a deep breath) can be in a non-conflicting state with a lesson on day 21 (e.g., take a deep breath). Data may be shared, but separation may be supported. Behavior states can be parsed for analysis. For example, a backend can capture the state of a behavior, both the history and the current state, and analysis can determine what state the user is in, what state they were in, details of that state, etc. The behavior engine can handle conflict resolution, so if two devices are not in sync, they can sync to support the new state.
[0035] Configurations are independent of any application and can be reused. Shared lessons, login flows and other information can be easily shared between different applications without copying or pasting. In this way flows can be displayed and independent of behavior engines. For example, a behavior may be just a simple wizard that steps through. The lesson defined by the configuration file can track progress. Behaviors can drive any layout engine screen. Thus, 10 flows with different content can depend on the same behavior definition.
[0036] The behavior engine can accept and process external events from the layout engine (e.g., user interactions), as well as push notifications, backend API calls, and timers. Transitional states from one version to another can be supported (e.g., from version 1 to version 3). New behavior flows can continue to run even if they were initiated in another version (e.g., version 1). The behavior engine may rely on triggers or use external code. For example, the behavior engine can make API calls to look up data or trigger local notifications.
[0037] (4. Behavior Engine Architecture) Referring now to FIG. 1, a block diagram of an architecture of a system for managing plugins is depicted. The architecture may be plugin-based and extensible over time. The behavior engine may communicate with the rest of the application by message passing. Message passing may be handled via reactive streams or an event bus. The behavior engine may have direct access to local storage so that engine instances (e.g., instances of finite state machines (FSMs)) can be serialized and deserialized.
[0038] The event bus may be the primary way for the behavior engine to communicate with the rest of the system except for local storage, since each plugin may be responsible for serialization and deserialization code. Local storage may be how the application stores data locally. The layout engine may be responsible for the presentation layer. The behavior engine is aware of all user interactions and may change the presentation in response to state changes.
[0039] Services perform activities for an application. Applications may have logic outside of the presentation layer, such as receiving push notifications, scheduling reminders, handling errors, and calling backend APIs. The behavior engine may have a way to listen to those events or trigger services to perform activities. This notification and triggering happens over an event bus.
[0040] For example, an application may have an FSM that manages a login or sign-up flow. Within the flow, the FSM may specify branching, API calls, token maintenance, error handling, control flow, binding states, etc. In this example, the FSM's configuration file defines a new behavior "start" and is of type "FSM". This passes the configuration to the FSM plugin, which can signal the behavior engine to indicate that the plugin is responsible for creating the behavior that will be instantiated later. The configuration file may also specify that the start state of the state machine is "boot". The configuration file may then identify two parallel states that must be satisfied before transitioning to the final state.
[0041] In two steps, a backend is called (1) to verify that the active signature in the token is valid, and (2) to verify if there is a recall or message to display to the user. This call can be specifically for forced upgrades and important messages. This is a service or external operation that the FSM can call, and any kind of service can be defined. An operation can be an API call that prompts the user with additional information, such as a URL and a timeout, among others. Furthermore, the FSM can cover all states, such as completion (onDone) or an error occurred (onError). A complete definition can ensure that all states are covered. For example, a visual editor can be used to build the states and transitions of the FSM, as depicted in Figure 2.
[0042] Behavior engines may have a plugin architecture. An FSM plugin may be one of many configurable plugins. Returning to the example above, an FSM may be built with configuration and visualization of all states. An FSM may have inputs and several outputs. An input may be a trigger that requests the FSM to transition to a new state. This request may contain a payload or data. An output may be triggered when the FSM changes state. An FSM may monitor external events triggered by a user or another process. An FSM may determine the outcome of an input. An FSM may output the next step (or state) along with a payload.
[0043] The glue between the FSM and another part of the application may be an event bus. In some embodiments, the event bus is a reactive stream, allowing other components in the application to listen and publish on the bus. Reactive streams may support operators such as debounce, combine, map, scheduler, etc. In the end, there are two listeners: the layout engine and the analytics. Both can send and receive messages bidirectionally on the bus. For example, for launching an application using the behavior engine, the FSM may hide the splash screen and also display a login / signup flow or a sign-in state. This may be done by adding an action or call to the "start app" state so that the FSM can signal the layout engine to move to a new screen / flow. Along with the instruction to display the new screen, the FSM may provide a payload. This payload may include the inclusion of the display screen, as well as details such as tab navigator and auto-selection of the third tab. Once the application launch is complete, the application's FSM may display "Start App" when in that state and check three conditions: show message, go to Home, unauthenticated, etc. The application then uses "cond" logic to automatically select the correct next state in the FSM. The FSM may execute the actions layout.showModal or layout.showFlow, which may expose the payload to the bus.
[0044] Referring now to FIG. 3, a block diagram of an event bus architecture in a system for managing plug-ins is depicted. As depicted, the layout engine can listen to events. There, a showModal or showFlow FSM payload may be received. This payload may inform the layout engine what to do in terms of displaying the screen and flow. In some cases, additional metadata in the payload may be used to send additional details to an external source. For example, when supporting deep linking, the FSM may identify the user in the middle of a flow. History may be reconstructed so that the back button functions correctly. The behavior engine and the layout engine may interface with each other to control the flow and branching of screens.
[0045] (a. State) A behavior engine can use states to define interactive logic that aids the user's journey through the application. A state corresponds to the current state of the FSM and may contain variables, metadata and history among others. The behavior engine supports this and is also able to broadcast changes, so any component can be notified of a state change along with its internal details.
[0046] FSMs can also handle internal variables, metadata and history, providing a window into the internal workings. This composable isolated box (encapsulation) allows the UI and other FSMs to be kept out of certain state. Applications do not understand the console or logic, but can fire events using the FSM to handle events. In some embodiments, a readax can be used to set or define the FSM. Readax may not be configurable via a configuration file. How the FSM handles events based on the current state may not be changed by using a readax. Readax may have a global state and may not have an instance of itself.
[0047] FSMs can store both state and metadata around transitions. But applications can also use FSMs to track state outside of the behavior engine. Data can be stored in the FSM and the behavior engine, or it can be stored or shared outside of the FSM. So applications can use hooks, Readax, MobX, etc. The UI can bind to the state of the FSM, or it can use a bus.
[0048] The behavior engine may support serializing / deserializing instances of plugins (FSMs). This support allows you to have multiple instances of the same behavior (FSM). For example, if a flow is checked daily, then each day will be an instance and its state value will be stored in local storage. The state is human readable along with all the raw state data, what state the FSM is currently in, and metadata, etc. The backend can read the data and process it.
[0049] One of the benefits of having a behavior engine that supports instances can include composable building blocks. Each instance is isolated and atomic, has private state and can track its current state. Instances can have functions like conversations, sharing and spinning up ephemeral FSMs. Sub-modules can send messages to each other, making the system more understandable and composable. These building blocks can be connected via a bus.
[0050] Now referring to Figure 4, a block diagram of an event bus interfacing with multiple finite state machines in the system for managing plugins is depicted. When an FSM changes state, it can broadcast that change to the application. Reactive streams can be used to take advantage of various features such as stream, filter, reshape and debounce. This allows the user interface to receive changes to any instance of an FSM and allows FSMs to listen to other FSMs. For example, a UI might display treatment progress, but each treatment might have its own FSM. So the treatment FSM could broadcast "patient has a score of 80 and only 3 / 6 steps completed" and the progress FSM could receive this and update the home screen animation.
[0051] One advantage of reactive streams is that if an FSM is broadcasting a state change, the consumer component of the stream can drop in a transformer along the path. Therefore, an FSM that sends data may not be able to communicate with an FSM that is not designed to process messages. Compared to FSMs, leadux may lack the additional power and benefits that come with reactive streams and state machines. On the other hand, FSMs can be composed with no or less code, making the graph more explicit. For example, in leadux, actions are dispatched and reducers may update a global state. In leadux, actions cannot be treated differently depending on the current state, and all actions can be treated and processed the same. A simple example would be an action specified in an FSM as "BACK BUTTON" and the current state could be a logged in state or another step in the flow. The FSM can identify the logged in state and go back one step in the flow. To support this in leadux, more global state is created to address the problem of explosive states and complex mixed states. This can lead to bugs and unpredictable behavior. Therefore, explicit state, as defined in FSMs, can be safe and reliable.
[0052] For example, a behavior engine processes internal and external data to perform tasks. If an application reaches a sign-in screen and the email address of the last logged-in user is known, the FSM can be used to determine what to display in the UI. The FSM can identify that the user clicked the login button or the forgot password button. The FSM can also handle scenarios involving error conditions on this screen, such as no access to a cellular network or Wi-Fi.
[0053] In another example, a radio can be implemented using FSMs. The FSM can tune to a station, which may broadcast news after the user presses the back button. The user can press a button named "Login". The FSM may display a screen that says "Welcome back!", or the user may fill in email or password fields. Multiple FSMs can be tuned to this radio station. But in this example, the login FSM can wait until it hears the message "User is looking at screen, welcome back!". Then the FSM transitions to an active state. So, when the FSM hears the message "User pressed back button", the FSM can trigger the screen to pop and transition to an inactive state. Listening to events can be a way for an FSM to be aware of the outside world. Secondly, an FSM can have an internal state. This can be private, in the sense that only the FSM can change things. This state can be serialized / deserialized. The internal state can also be bound to a UI, so that the FSM can drive some UI.
[0054] FSMs can have other advantages over leadux. At any point in time, the FSM can identify potential state changes. This meta-information can be used to set up the UI. For example, a button can be enabled or disabled based on the FSM's list of next valid states. In the above example, if the FSM determines that the email and password fields are valid, it may transition to the "valid login" state, so the button will remain grayed out. Instead of using the state value to make such changes, the next state list can be used to correctly render the button state as defined by the FSM.
[0055] FSMs can also support side effects through feedback. An asynchronous request is invoked, and internally the FSM wraps it in three new states so that the FSM can tell the application to perform the task. The FSM can also change its logic based on a failed or rejected state. In leadux, this can be difficult to implement. Additionally, FSMs are state charts and can have a history of transitions and metadata so that the FSM can keep a snapshot in time. The FSM can track its current state and have details about the transitions to the current state. This helps with error handling. For example, an FSM can go into an error state for multiple reasons, and with this information, it is possible to infer why the FSM went into that state. This information can be tracked as state variables and as history.
[0056] The way that an FSM can trigger side effects in an application is when the FSM transitions to a new state, triggers an action, or changes state, which can be a cue for the UI. The FSM can ask what state it is in, what the next possible state is, and what the next view initial value is, among other things. This can be powerful, as the UI can monitor state changes or explicitly request that a task be performed. The FSM can drive actions and states, and can represent actions and states through the UI.
[0057] (b. Binding) FSMs are wired to an event bus and can be different plugins in the behavior engine and the layout engine. The engines also have binding syntax or rules. For example, the UI in the layout engine can specify that it should bind the UI to the login FSM. The layout engine can then tell it to bind the email address field to the ref value in the FSM. This means that if the email value in the FSM is "bob", then the default value for the email address field is "bob". The enabled or disabled state of the button is determined by the current state of the FSM.
[0058] When a button is pressed, the layout engine fires a message on the event bus. The FSM is wired to listen for that press and triggers a state change. This state change triggers an API call which can result in the next state, and so on. The FSM executes a series of events defined by the behavior engine, which at a certain point in time may command the UI to change screens, navigation, values on a screen, or trigger an external service to perform work.
[0059] In this way, the layout engine can send messages on the bus to tell the FSM about state changes, and external code can do the same: for example, if an application detects that the client device has gone into airplane mode or is no longer connected to Wi-Fi, the application can broadcast an event, and the FSM can use event listeners to handle the event, display a flash message, etc.
[0060] (c. Event Bus) Using reactive streams, any part of an application can broadcast or consume events via stream processing. This can be similar to having an evented architecture. One advantage of this is that parts of the application can be decoupled and isolated from each other. If you have 100+ FSMs, different applications can use some of the FSMs because they are fully encapsulated. State, UI and themes are independent of the application and can be shared or communicated with other parts of the application through the bus.
[0061] Referring now to Figure 5, a flow diagram of a process for unlocking a skill in a system for managing plugins is depicted. In the example depicted, the process is for a "try, cache, modify" plugin. This FSM can be used in two different applications. In one application there is a leaderboard of progress, and in the other application there can be a prompt to complete the lessons specified by the FSM before unlocking a new skill. Using a bus both of these use cases can be supported.
[0062] Events are used to represent state, and the FSM can emit change events. These events can be exposed to any part of the application, so any component can subscribe and transform the information into useful events. In the case of progress, the application can mark that the user has completed a task and update the user's state, rank, and other information on the screen. If access to other skills depends on mastering a lesson, the application can have a transformer that tracks the number of completed events and makes a new skill available once the lesson has been completed a set number of times (e.g., 10 as depicted).
[0063] Events can be a form of more expressive states. For example, when a lesson module indicates that a user started a lesson, indicated that they "had negative thoughts", chose the strategy "to write down 10 positive things", completed the lesson, and finally rated the session as "somewhat helpful". In this respect, metadata can be leveraged more than states. In this example, if we consider a state representation of the same data (without using events), the states could correspond to three states: (1) "completed the lesson", (2) "chosen to write down 10 positive things", and (3) "the session was somewhat helpful".
[0064] State in this scenario may not be useful if another part of the application unlocks the skill after completing 10 sessions. When that happens may be undefined and / or a counter may be built into the state. Lessons are encapsulated and may be shared between different applications, so adding different states to solve a one-off problem for one application may not scale. However, by using a bus, an application can listen for a "lesson completed" event and maintain a counter for that. When the counter reaches 10, the application can fire a new event that the application can use.
[0065] Now referring to Figure 6, a block diagram of the sequence of events and states in the system's event bus for managing plugins is depicted. By looking at the history of events with all delta changes, a set of composite states can be constructed that allows the application to react in real time. The states can correspond to snapshots in time, but the FSM may not lose information to see the world as events. Using the history, different snapshots can be constructed. The bus can also open up new types of modules. For example, an application can run a speech analyzer or a machine learning (ML) model for predicting depression. With an event bus, applications can broadcast information using the event bus. The information can be ingested and features can be created to be input to the ML or speech analysis module. In return, the corresponding FSM outputs the results and analysis of the input. The FSM can take that information as input and modify the UI. This is done in an isolated way, where different applications may behave differently, but the same ML can be the same for all applications. This creates better composability and isolation.
[0066] (5. A / B testing is analyzed) An event bus can also do A / B testing. Different layouts or behaviors can be used for A / B testing. An event bus can swap the way messages are sent. For example, an application can use two layouts, "A" and "B", and use an event bus to connect an FSM to the "A" version for 20% of users. From a deployment perspective, streams can be connected differently for the "B" version.
[0067] Analytics is another application where event streams are useful. Events detected through the application can be provided in real-time if the user agrees to share the information. This can create an analytics stream that can be plugged into the future data pool. Additionally, the format of the data can be more detailed than a snapshot of the state. For example, an application can sync the state of an FSM to a backend. A database can store and maintain the progress of the user (e.g., completion of various tasks). The database can query whether the user completed a given task in the first week or the next week. If only snapshots are used, the information and context around the data can be lost. FSMs and reactive streams can normalize this stream so that various information can be tracked.
[0068] (6. Mechanism) A behavior engine can have various modules that control logic and are bound to the UI. Modules can have state, can fire events, and can be decoupled, but also composable. Modules can be used to implement game-like mechanics. Learning new skills in a game allows the user to progress in the game environment. Behavior modification can also leverage game mechanics. For example, adaptive cognitive training, an approach to enhancing aspects of cognition, can involve repetitive training where the difficulty of the task is continually adjusted based on performance. Such training exercises are typically delivered over a set time or capacity (or according to a combination of any number of parameters) across participants, and can leverage rewards as a way to incentivize adherence that is likely to be scarce in the real world due to the demands of training.
[0069] This example also illustrates some of the opportunities that can be gained by taking a modular approach. One is targeted training: data collection from various sources can be used to select the exercises offered to the user. Another is reduced training demands: continuous data collection during training can adjust the amount of training or the dose administered to the participant, which can help with adherence. Another is adjustment of incentives: it can determine the optimal training pattern or environment for the user, and the type and frequency of rewards that best suit training.
[0070] The human brain can have both physical and perceptual challenges that impact the overall health of the individual. Starting with an FSM, a dynamic path can be created through a list of exercises with real-time feedback, incorporating information and events from other modules and knowledge. Models (in the form of FSMs) can be defined to build and model human brain states such as happy, sad, triggered, etc. All the information collected from the lessons is used to understand the brain state.
[0071] For example, the FSM can start by sending notifications prompting the user with some questions four times a day. Each event is designed to determine whether the user is experiencing a craving. The goal of the FSM in this state is to figure out if there is a pattern to the cravings (e.g., they occur around 3:00 pm). The FSM can then change state after determining the time, stop notifications, and enter a state that sends notifications at the determined time. The goal of the FSM in this state is to figure out what the root cause of the cravings is so that the FSM can target a better treatment plan. Once the FSM transitions to the treatment plan state, the FSM can track success from other parts of the application, such as daily check-ins. The FSM can also change the state back to a new state if it determines that no progress is being made.
[0072] The goal of the FSM can be to match an understanding of the state of mind. From there, the FSM can target the best treatment options. Just as a human therapist would ask questions to let the patient know how they are feeling, the FSM can mimic this. The application can run multiple FSMs and respond to the user's unique characteristics. The application can also include content, daily lessons, etc.
[0073] The application can gather information for analysis from running a functional model (FSM) of how a patient's brain will respond in relation to a treatment. The FSM and all raw data can be output for additional analysis. The FSM and UI are configurable and expandable. Also, the FSM is just a starting point and over time new logic engines can be developed, mechanics or AI can get better.
[0074] (B. Layout Engine Platform and Architecture) The architecture allows for separation of care and the delivery of that care. The architecture can be used to create a platform and engine to take the care flow defined in a Content Management System (CMS) and the configuration in the form of markup files (e.g., YAML or XML) to define the care on the mobile device.
[0075] (1. Overview) Now referring to FIG. 7, a block diagram of a system for managing plugin layouts is depicted. The system can include an application, a platform, a backend, and an infrastructure. The application can include React Native, application specific code, and configuration that defines the treatment and appearance. The platform can transform the treatment content into a running application that can capture shared components, configurations, and behavior trees and run on devices where patients can interact. The backend provides external storage and services required for the application. The infrastructure is used to support the development cycle and ensure quality and regulatory compliance. This includes repositories, CI / CD, change logs, and server setups.
[0076] (2. Application) An application can be a container that holds configuration files that define a therapy. Additionally, custom code specific to a particular application can also be part of this bundle. This specific application code may not be part of the platform, but can be included and managed by the platform. This can ensure a clean separation between all parts of the application, including therapy, custom code, and platform, among others. Applications can reside in repositories and be scoped to their own directory structure. Repositories can help with separation from the platform and code reuse. Keeping platform code outside of each application's code base can ensure separation, but also ensure that it is not inhibited from building custom applications whose structure depends on specific native code or having to be distributed to an application store.
[0077] (3. Layout and Activation Architecture) Referring now to FIG. 8, a block diagram of a platform for a system for managing plug-in layout is depicted. As depicted, the platform may include a configuration file (e.g., YAML, etc.), a layout engine, and a behavior engine. The configuration file may be configuration data used by both the layout engine and the behavior engine. The architecture may be divided into two active layers: (1) a layout engine, and (2) a behavior engine. The layout engine may take in a human readable configuration and convert scripts into a UI. The behavior engine controls the presentation of the UI. The human readable configuration may be easily provided by a developer with little coding knowledge to write scripts to configure the UI and its behavior.
[0078] Starting with the layout engine, the engine can get its configuration from human-readable YAML files, rather than from JavaScript® (JSX) code. The motivation behind this configuration is to allow clinical product, design and operations to define screens without relying heavily on development. The CMS can manage this configuration, rather than YAML files. Additionally, the configuration can also be modularized so that any content, treatment activity, flow or behavior can be easily shared between applications.
[0079] The behavior engine includes defining which screens in the flow to show and in what order, handling of components' current states and values, events like errors, reminders, synchronous events and deep links, managing the current user's position in the treatment journey, etc. The motivation is to capture clinical intervention strategies and the application can dynamically select the right strategy for a patient based on his history and condition. This can also be defined in configuration instead of code.
[0080] (a. Layout Engine) The layout engine handles and processes the placement and styling of components, manages content (e.g., text, images, and other objects), and can control navigation, flash messages, keyboard avoidance, modals and overlays, deep links, headers, and tabs, among other things. This corresponds to the presentation layer. The layout engine may be developed in code, but may also leverage configurable components.
[0081] Components can encapsulate and atomically affect the construction of the UI. The layout engine may not nest multiple components and manage state to construct components as code components can do alone. The layout engine may not be intended to build components from components. Components may be for non-developers and allow drag and drop rather than developer composition in code. The layout engine may be designed to consider clinical product, design and operation for interaction with the layout engine. Flow or common groupings can be defined in the CMS and low level components like React can be developed using code. For example, developers can use repositories and share components to build good building blocks that CMS users can use to build content groupings.
[0082] Referring now to Figure 9, a block diagram of a tree for defining user interface rendering in a system for managing plugin layouts is depicted. The layout engine can be configured with YAML. YAML may allow for a one-to-one mapping of tree structures similar to React component trees. YAML can represent any tree that React Native trees can represent. YAML may be more human readable than JSX (XML) or JSON (code). The hierarchy of nodes in the tree corresponds to the indentation of the YAML file. YAML for React components may also have properties for each node. This allows each node to be customized with additional properties. Furthermore, YAML files may be relatively concise and human readable.
[0083] Given the nature of mobile applications and limited screen space, most screens can be characterized in several different ways. A top-down list of components, a grid of tiles, a single screen with minimal content, tabs, etc. For example, components may be stacked on top of each other, or in some cases a grid may be used for stacking items. The buttons are mostly at the bottom along with the header. This can be defined using a YAML file. As another example, in the splash screen example, there may be four components in a stack. Each component has properties. The layout engine can inject default styles and stack items without relying on flexbox (e.g., React layout syntax). Themes may be supported that help the layout engine determine optimal padding, colors, font sizes, etc. The layout engine may also apply rules so that any screen can have keyboard-aware layouts such as auto-scrolling, flash messages, and modals. This is because the layout engine defines a consistent approach for how each screen should be built. There is no need to know how each component is connected to the keyboard-aware layout, as the layout engine can wrap and handle all the logic for you.
[0084] Usability and accessibility specifications can define the inner workings of a layout engine. In native React code, each screen is defined as a new component. For example, an application with 100 screens can have 100 different layouts even if it uses a group of smaller components to form a larger one. The complexity of tracking how a small change in a single component affects hundreds of different layouts can be difficult. The definition provided by a layout engine is similar to having a single screen. The layout engine handles its placement and makes sure each component works with features such as keyboard-aware layout. The layout engine can also make the look and feel of the application more consistent.
[0085] Referring now to FIG. 10, a block diagram of an example user interface used by the system to manage the layout of plugins is depicted. Components in the layout engine can have little or no styling and let the layout engine handle the placement. This can be similar to a web grid or column-based template as depicted. The grid can define properties such as number of columns, gutters and padding. This approach ensures that the UI is optimally consistent and balanced. Mobile screens are not grid systems, but stacks with headers, sometimes wrapped in tab views. In the depicted example, components such as text, tiles, headers and buttons can be placed in containers. In this case, the containers can be screens, scroll views and subcontainers. The layout engine can control the style of the containers and the surrounding containers, such as padding, margins and position of each container.
[0086] In a React application, padding, margins, and container positioning can be defined on each screen or screen component on a page of the application. By using Domain Specific Language (DSL) scripting, the defined layouts are no longer dependent on creating new code for each page and individual component. In this component and module driven approach, most of the application code base resides in component and screen configurations, allowing functionality to be reused over and over again without coding it from scratch. This can be a big win, as it allows you to focus on improving and evolving your treatments as opposed to building your application from scratch every time.
[0087] Similar to grid systems, styling can depend on parent containers, so the layout engine needs to support passing this kind of information to child components. Having everything in the DSL also allows querying the tree. The layout engine also supports features such as spacing, floats, containers, gap spacing, alignment, nesting and scrolling. The layout engine can also handle visibility, some animations, accessibility awareness, orientation and keyboard avoidance.
[0088] For example, in a YAML configuration file, first the root node will be of type navigation. The layout engine reading this will create a navigation stack which will identify the list of screens that are part of the flow. The root node also has a "screen:property" which defines the list of screens in the stack. A new screen can be created with a "id:splash-screen" field which indicates to the layout engine that it should hide the header. It should be able to scroll if the content on the screen is too large. The layout engine can look at all the child nodes of type input and decide whether to build a special layout for a keyboard aware layout. Then the screen can have a "layout:property" with a list of components to render from top to bottom. The rest can be text and the next can be a block. The block can tell the layout engine to create a floating box anchored to the bottom of the screen.
[0089] Referring now to FIG. 11, a flow diagram of the process of parsing configuration in a system for managing layouts with plugins is depicted. First, the layout engine can load a YAML file via the Metro Bundler plugin. If YAML is not the native layout engine format and JSON is, this plugin converts the YAML file to an intermediate format (e.g., JSON). For example, many CMSes output JSON or YAML (or another type of DSL) that is converted to JSON. Second, the JSON file is scanned for references or imports ($ref, $id) to reference different parts of the JSON tree. Parts of the JSON tree can be reused without having to copy any part of the configuration file. This makes it easy to reuse blocks of JSON.
[0090] Third, a parser may be a recursive function that traverses the tree converting each JSON node into a reactrender tree. The parser may use the type field of the JSON to determine which subparser function should handle the conversion. For example, "type=text" may signal the text parser function to process that node and subnodes. Fourth, each subparser may also define a validation policy, validating the schema before passing the function to the parser for further processing. This validation may be, for example, a type diff file in TypeScript. The parsed nodes are used for automatic generation of documentation and application of type rules. Layouts may handle runtime validations such as numeric ranges and conditionals. Validation may be performed using ajv. Native JSON may be used as a validator and may also be used to support custom functions.
[0091] Fifth, each subparser can transform each node into a React component. Each subparser can recursively pass child nodes to be parsed by the main parser or use child configuration. In most cases, the YAML tree mirrors the React renderer tree. Finally, after walking the configuration tree, the parser can obtain a React tree. The system is designed to be flexible in order to make DSLs dynamic, and each node in the tree can be processed by a subparser or a function. This allows adding new semantics to a DSL without rewriting the main parser.
[0092] Now referring to Figure 12, a block diagram of the configuration tree generated by the system that manages the layout of plugins is depicted. In addition to walking the tree, the parser can send additional context at each step. This information allows parent nodes to pass information down and receive information from subnodes. These include namespace information for each node's path. Hard overrides allow parent nodes to override any key or value from the YAML key or value, or to complement the key or value with a default value, and soft overrides allow YAML keys or values to override the parent's value as well as the default value. When walking the tree, hard and soft overrides can be passed. Passing soft defaults allows certain values or properties in YAML to be omitted. Passing hard overrides forces parent nodes to override values in the YAML file. For example, for padding / margins in a grid layout, overrides can pass data up and down the tree so that the grid layout component has access to useful data.
[0093] Any part of the application can register a parser. A parser can specify a parsing function, a schema definition, that will be used to validate DSL configuration values. In the above example, there are text and block subparsers registered with the layout engine. For example, the text subparser contains: First, it contains scheme.yml, which defines the ajv validation rules. In this file, the required field is "valued", and the property fields include style, value, markdownStyles, and variant. By referencing the field "$ref:common / style", global types can be defined as imports without copy or paste. The top field is text, which is used when traversing the YAML file. When type:text is found, this subparser is used. The second is theme.yml, which we will discuss later. The third is Text.js, which contains a React component that is independent of the layout engine and can be a functional component with a separated state. The fourth is Index.js, which registers the subparser with the layout engine. The fifth contains unit tests that test the React component and the YAML generated version.
[0094] (b. Navigation) Now, referring to Figure 13, an example block of navigation screens and trees generated by the system for managing plugin layouts is depicted. The layout engine may be responsible for defining the flow as well as laying out the screens. A navigation subparser and a tab navigation subparser can define the tree as depicted. Within each subparser, there may be a screen for each screen in the stack or tab navigator. YAML can also define configurations such as header styles and deep links. A behavior engine can perform various functions such as pushing, navigating, and restoring state via deep links among others. In this way, most of the logic for navigation, deep links, and other functions can be moved from React Native to DSL. For example, restructuring an application to have five tabs instead of three is a relatively easy change in YAML. The flow of the screens can be modified without changing the native code.
[0095] (c. Flexibility and Separability) An additional benefit of splitting out React components and subparsers is that React components can be exported to projects that don't have a layout engine. Additionally, components not built for the layout engine can be imported using wrappers and subparsers. Components can also be pulled from other parts of the code base. Finally, layout parsers can be split out into handcrafted screens, components or functions as steps in the layout engine flow. The layout engine can return a React tree to use in React code as a component. Other applications may not use the layout engine to include parts of their screens developed to run in the layout engine.
[0096] (d. Other Layout Considerations) Attached to the layout engine is the definition of themes and customization of each component to the environment, which may take into account a variety of factors such as operating system (OS) theme support (e.g. light and dark modes), accessibility support, localization and internationalization support, design language definition, variant support, common layout or grid systems, color palettes, localized assets, number of columns in a layout, and reusability across multiple applications.
[0097] The components of the layout engine can be customized for different environments. This can be not only styles, but also layouts, assets, localization rules, and other customizations. Components can have appearances and behaviors. In a CMS, this behavior can be controlled in themes. There are multiple applications created using these components. Thus, it can be specified that in one application input validation is displayed below the field, while in another the validation is a flash message. Furthermore, a dark theme may involve the use of different assets to match colors, or localization may require different assets. One application may use animated or accessibility zoom buttons, while another application may not have animation and font zoom support. In dark mode, colors and padding may be different.
[0098] Shared components exist in an environment. The environment can be an application (or multiple applications) in different states. And in any state, further customization can be done for the components. Components are flexible and can support different features that can be turned on or off. In addition to visual characteristics, they may define default behavior for the environment. The configuration can be moved from YAML to the layout engine, but then the application may use the configuration multiple times, every time the application uses the button. You can use one theme file that defines the visual characteristics of the button and how to set the default options. The layout engine and YAML do not define this repeatedly, but the theme file can define this for the application.
[0099] The layout engine can enforce the separation. For example, the layout engine can be told to place a button on the screen. From the application, the application can request a button. The current theme makes this easy for styles and also supports zooming for accessibility, so you can change some of the behavior and visual characteristics of the button. The main point is the additional configuration that the theme can pass to the button component, not just color, padding, font size, etc. The flexibility of the theme comes with validation, among other things. The validation YAML can be placed next to the code, and the theme.yaml can also be placed next to the validation file. All the component options can be placed in one place, corresponding to one format YAML.
[0100] (4. Assets) Assets can be part of a theme. When adding a thumbs up icon to a button, an application can identify an icon appropriate for the theme. A registry can be created so that each theme can define assets. If not defined in the theme, the application falls back to the base theme. Since each asset belongs to a theme, assets are per-theme. Assets can come in a variety of formats (e.g. SVG, MP4, Lottie).
[0101]
[00136] Referring now to Figure 14, there is depicted a block diagram of the theme configuration used by the system to manage layouts for plug-ins. As depicted, there are two types of themes and two boundaries in which the themes reside. The first boundary is a component and the second is a specific application. Within each boundary, there are two types of themes, one corresponding to a base theme and the other to a named theme (e.g., light or dark mode).
[0102] A base theme can define aesthetic defaults. A base theme is at the component boundary, and all applications can get these defaults for their individual components. At the application boundary, the base theme applies to that particular application. Other types may be named themes (e.g. dark and light) that are applied at the application boundary, not at the component boundary. Additionally, an application may have one active theme at a time. Component boundaries can create more separation. Different applications can import shared components to update all base themes of the application whenever a component's theme variable is changed.
[0103] For a theme, you can specify whether the theme is a base theme or a named theme. You can define a priority for that theme. Merging all theme data allows you to combine a set of themes into a single theme configuration for a specific application, eliminating the need for each user of the theme data to perform these configurations. Auto-merging can be used to provide a single decision for an application, using which application is running and which theme is active. For example, by default, you can provide a priority value of 10 for an application and 100 for a component.
[0104] Referring now to FIG. 15, a flow diagram of a process of merging themes according to priority in a system for managing layouts for plug-ins is depicted. First, the theme provider can merge all base themes from both boundaries, including component and application boundaries. The theme provider can use a priority between 0 and 100 to determine the merge order. Once the merge is complete, a single combined object is obtained representing the merged base themes where priority 0 wins over priority 100. The theme provider can merge all name themes one by one. If there are two themes, light and dark, two combined merge objects are calculated. This step can use the same logic as step 1 in terms of priority.
[0105] By identifying the base and named themes, the theme provider can select the active theme and merge the selected theme on top of the base theme. This way the theme provider can have defaults from the base theme. The theme provider can search for $ref by traversing the merged base or named themes, update the value to point to the correct part of the object, and replace $ref with the actual value. Theme provider optimizes the theme by compiling React Native stylesheets and caches the results.
[0106] For refs and shared values, often variables like textColor are used. In a theme, $ref allows this as a value. This can refer to another part of the configuration. This $ref can be applied across all merges to allow using a different named or theme defined value for a component. This is useful for example if you have a text component and this is used to define a style like body. If you have an input field and the exact same body style is used, you can use the field $ref.
[0107] Because merging is done first and $ref substitution is the last step, an application theme or base theme can override the body style and both text and input fields can use that value. Finally, because configuration is used as a style, the configuration file can have a YAML structure to import any kind of namespace. For example, you can specify button.primary.layout.padding=100 in the file. This allows you to be more expressive with namespaces in your styles. Regarding variants, namespaces can be used to create variants, which can be override values. And components can have property variants and all theme providers can merge namespace variant values into themes. This allows a button to have different variants. This can also be done with states.
[0108] C. Systems and methods for constructing and processing finite state machines for the application of user-related conditions 16, a block diagram of a system 1600 for providing finite state machines (FSMs) to applications is depicted. In overview, the system 1600 may include at least one application configuration service 1605, one or more clients 1610A-N (hereinafter generally referred to as clients 1610), and at least one database 1615 communicatively coupled to each other via at least one network 1620. The application configuration service 1605 may include at least one file handler 1625, at least one plug-in generator 1630, at least one content manager 1635, and at least one analytics evaluator 1640. The database 1615 may store, maintain, or otherwise include at least one configuration file 1645A-N (hereinafter generally referred to as configuration file 1645). Each client 1610 may include at least one application 1650. Application 1650 may include, among other things, at least one application service 1660, at least one behavior manager 1665, at least one layout handler 1670, at least one event bus 1675, and at least one plug-in 1680A-N (hereinafter generally referred to as plug-in 1680). Application 1650 may also provide at least one user interface 1685 including one or more user interface elements 1690A-N (hereinafter generally referred to as user interface element 1690).
[0109] Each component of system 1600 (e.g., application configuration service 1605 and its components and each client 1610 and its components) may be executed, processed or implemented using hardware or a combination of hardware, such as system 1900 detailed herein in Section D. The components of system 1600 may also be used to execute, process or implement functionality detailed herein in Sections A and B. For example, application configuration service 1605 and application 1650 may perform the detailed operations in conjunction with a behavior engine and a layout engine, as described in the sections above.
[0110] 17A, a block diagram of a process 1700 for generating instructions in a system 1600 for providing finite state machines (FSMs) to an application is depicted. The process 1700 may correspond to the operation of an application configuration service 1605 for generating and providing a plug-in 1680 to a client 1610. Under the process 1700, a file handler 1625 executing on the application configuration service 1605 may search, fetch, or identify at least one configuration file 1645 (e.g., a first configuration file 1645A) from a database 1615. In some embodiments, the file handler 1625 may search, retrieve, or receive the configuration file 1645 from another source, such as a computing device of a developer creating the configuration file 1645. The configuration file 1645 may include instructions (e.g., a script including human readable instructions) for configuring, defining, or otherwise specifying various functionality of the plug-in 1680 to be added to the application 1650. The functionality specified by configuration 1645 may be separate from the built-in logic and functionality of application 1650, such as that of application services 1660. In some embodiments, the instructions included in configuration file 1645 may be in a human-readable format, such as Yet Another Markup Language (YAML), Extensible Markup Language (XML), and JavaScript Object Notation (JSON), among others. In this aspect, less effort may be undertaken by a developer in writing human-readable instructions in configuration file 1645 than in configuring instructions in other formats.
[0111] The instructions in the configuration file 1645 may specify, identify or otherwise define at least one finite state machine (FSM) 1705. The FSM 1705 may be for a set of routines to address a condition of a user of the application 1650. For example, the condition may include, among others, smoking, obesity, psychological disorders (e.g., schizophrenia), mental cognition, and depression on the part of the user. The routines set by the FSM 1705 may include various treatments or management of these different conditions. The routines may be common or may be different for different types of conditions. For example, treatment of smoking or obesity may have common activities specified in the routines, such as hydration. For smoking, obesity, and depression, the routines set by the FSM 1705 may include fitness tasks or breathing exercises, and the like. The set of routines may form steps along the user's journey to achieve a goal behavioral endpoint of a given condition, such as quitting smoking. The activities may be recorded via the application 1650 running on the user's client 1610.
[0112] In some embodiments, the routines for the configuration file 1645 (and by extension, the FSMs 1705) may be selected from a library of routines maintained on the database 1615. The routines may be selected by the developer of the configuration file 1645 or plugin 1680, or by the file handler 1625 using the conditions targeted by the configuration file 1645 or plugin 1680. The library may include instructions for identifying or defining various routines, such as fitness exercises, walking, breathing, hydration, or reading messages. The ability to select different routines may allow for targeting specific conditions and may allow the instructions in the configuration file 1645 to be used with a wide variety of applications 1605. For example, one configuration file 1645 detailing routines for breathing exercises may be used for an application 1605 targeted at smoking cessation and another application 1650 targeted at obesity.
[0113] The FSM 1705 may specify or include a set of states 1710A-N (hereinafter generally referred to as states 1710) and a set of transitions 1715A-N (hereinafter generally referred to as transitions 1715). Each state 1710 may define, specify, or otherwise specify an output to be generated by the FSM 1705 when invoked. In some embodiments, at least one state 1710 may specify the invocation of another FSM 1705 in the set of FSMs 1705. The output may be to a particular routine in a set of routines associated with the FSM 1705, or may specify a user interface element 1690 to be presented via a user interface 1685 of the application 1650. In some embodiments, the output may specify one or more identifiers (e.g., uniform resource locators (URLs)) for content items to be provided to the user interface 1685. For example, an output of the state 1710 may be for displaying a quit smoking tip message when a user completes a walking exercise.
[0114] Each transition 1715 may define, specify, or otherwise specify an event to be detected via the application 1650 to update the FSM 1705 from one state 1710 to another state 1710. In some embodiments, at least one transition 1715 may specify an event to be detected to invoke another FSM 1705 in the set of FSMs 1705. For example, the transition 1715 may be an initial state or other defined state of the other FSM 1705. The event may correspond to an action performed via the application 1650 for an associated routine. For example, the transition 1715 may specify that a user records the completion of a breathing exercise via the user interface 1685 of the application 1650 to move from one state 1710A to the next state 1710B. Each state 1710 may have one or more transitions 1715 associated with the state 1710.
[0115] In some embodiments, the file handler 1625 may search, fetch, or identify a configuration file 1645 (e.g., a second configuration file 1645B) for the presentation of user interface elements 1690 associated with the FSM 1705 for the user interface 1685 of the application 1650. In some embodiments, the configuration file 1645B for the presentation of user elements via the user interface 1685 may be the same as the configuration file 1645A that defines the FSM 1705. In some embodiments, the configuration file 1645B for the presentation of user interface elements 1690 may be separate from the configuration file 1645A that defines the FSM 1705. The configuration file 1645 may specify, define, or otherwise identify user interface elements 1690 for output in each state 1710 of the FSM 1705. The user interface elements 1690 for output specified by the configuration file 1645 may be shared across multiple states 1710 and multiple FSMs 1705. User interface elements 1690 may be defined in terms of visual properties such as color, font size, and placement. User interface elements 1690 may correspond to assets (e.g., images, videos, or other objects) to be retrieved by application 1650 from application configuration service 1605 (or another remote server).
[0116] A plugin generator 1630 executing on the application configuration service 1605 may generate, output, or otherwise generate plugins 1680 using one or more configuration files 1645 (e.g., human readable instructions in configuration file 1645A that define FSMs 1705). The plugins 1680 may include instructions for configuring, defining, or otherwise specifying various functionality executed on the application 1650. The plugin 1680 instructions may be in an intermediate format (sometimes referred to herein as a transpiled or translated format). For example, the plugin 1680 instructions may be converted from human readable instructions to an intermediate format such as JavaScript Object Notation (JSON), TypeScript, Swift, or Python. The instructions for the plugin 1680 may also define an FSM 1705 that includes a set of states 1710 and transitions 1715. Each plugin 1680 may be associated with one or more conditions that are addressed by executing a specified routine.
[0117] Additionally, instructions for the plugins 1680 may define user interface elements 1690 for output at states 1710 in the FSM 1705. Because the plugins 1680 are generated separately from the application 1650, which plugins 1680 the application 1650 includes may be easily swapped out based on the user state to be addressed. In generation, the plugin generator 1630 may create a separate file that stores the specifications of the plugins 1680. The plugin generator 1630 may parse one or more configuration files 1645 to read or identify the instructions in the original format. In some embodiments, the plugin generator 1630 may serially or in parallel parse the configuration file 1645A that defines the FSM 1705 and the configuration file 1645B that defines the user interface elements 1690 for output while generating the plugins 1680.
[0118] Upon identification of a configuration file 1645 (e.g., configuration file 1645A), the plugin generator 1630 may generate or determine equivalent instructions in an executable format for inclusion in the application 1650. The plugin generator 1630 may translate or transpile (e.g., using a transpiler or converter) the configuration file 1645 (e.g., into JavaScript Notation Object (JSON) format, TypeScript, Swift, or Python format) to generate instructions in an intermediate format that are added to the application 1650. In some embodiments, the plugin generator 1630 may compile the configuration file 1645 to generate instructions in a lower level language. When compiled, the instructions for the plugin 1680 may be in a low level language such as bytecode, assembly, object code, or machine code, among others. In some embodiments, the compilation of the low level language may be performed by the application 1650 on the client 1610. Upon generation, the plugin generator 1630 may write the equivalent instructions to a file for the plugin 1680 and may iterate through the end of the configuration file 1645.
[0119] Upon generation, the plugin generator 1630 may transmit, send, or otherwise provide instructions for the plugin 1680 to be added or included in the application 1650. In some embodiments, the plugin generator 1630 may insert or inject the plugin 1680 into the application 1650 prior to installation on the client 1610. For example, the plugin generator 1630 may insert the plugin 1680 into an application 1650 that already includes other components such as application services 1660, behavior manager 1665, layout handler 1670, and event bus 1675, among others. The plugin generator 1630 may provide the application 1650, including the inserted plugin 1680, to the client 1610 via a digital distribution platform (e.g., an application market or store) to be loaded by the application 1650 installed on the client 1610. The client 1610 may request to download or retrieve the application 1650 from the application configuration service 1605 (or a digital distribution platform) for installation. Once received, the client 1610 can unpack and install the application 1650 , including the plug-in 1680 .
[0120] In some embodiments, the plug-in generator 1630 can provide plug-in 1680 instructions for adding or including an application 1650 installed on the client 1610. For example, the client 1610 may have pre-installed the application 1650 received from the application configuration service 1605 (e.g., via a digital distribution platform). In some embodiments, the client 1610 can then send a request for a routine to the application 1650. The request may identify one or more routines to be executed by a user via the application 1650 to address a condition. Based on the routines identified in the request, the plug-in generator 1630 may identify or select one or more plug-ins 1680 for the corresponding routines to provide to the application 1650 on the client 1610. In some embodiments, the plug-in generator 1630 may identify or determine that an update is to be provided to the application 1650 to provide the plug-in 1680 instructions. For example, a system administrator of the application configuration service 1605 may indicate that an instance of the application 1650 is to be updated. Identifying an update allows the plug-in generator 1630 to provide instructions for the plug-in 1680 without providing other components of the application 1650 .
[0121] Upon receipt, client 1610 (or application service 1660 running within application 1650) may update application 1650 to include plugin 1680. Client 1610 may save plugin 1680, which is loaded into application 1650. At run-time, application 1650 may load plugin 1680 to execute the routine specified by routine 1680. In some embodiments, the received instructions for plugin 1680 may be in an intermediate format. Application 1650 may further compile the instructions to generate a low-level format for execution on client 1610. For example, client 1610 or application 1650 may compile configuration file 1645 to generate instructions in a low-level language. When compiled, the instructions for plugin 1680 may be in a low-level language such as bytecode, assembly, object code, or machine code, among others. In some embodiments, in an update, the client 1610 (or application 1650) may substitute or replace the old plug-in 1680 with a routine that addresses the same condition as the newly received plug-in 1680. Upon receipt, the application 1650 may identify a previously provided plug-in 1680 to address the same condition as the newly received plug-in 1680. Upon this identification, the application 1650 may delete or otherwise remove the previously provided plug-in 1680.
[0122] 17B, there is illustrated a block diagram of a process 1730 for processing finite state machines (FSMs) in the system 1600 for providing finite state machines (FSMs) to an application. The process 1730 may correspond to operations in the client 1610 when executing the application 1650. Under the process 1730, application services 1660 executing on the application 1650 may perform initialization operations such as starting the execution of the behavior manager 1665, layout handler 1670, event bus 1675, and user interface 1685, among others. The application services 1660 may perform various logic and operations defined for the application 1650 outside of the set of plug-ins 1680.
[0123] A behavior manager 1665 of an application 1650 executing on a client 1610 can instantiate, initialize, or otherwise establish a set of FSMs 1705 within a plug-in 1680 included in the application 1650. In some embodiments, the behavior manager 1665 can select or identify one or more from the set of FSMs 1705 for routines to address a particular state of the user 1740. For example, during initialization, the behavior manager 1665 can receive user input indicating a state of the user 1740 to be addressed via routines provided through the FSMs 1705. Using the user input, the behavior manager 1665 can select FSMs 1705 to load from the overall set. In at least a subset of the FSMs 1705, each FSM 1705 may correspond to a particular set of routines, such as fitness workouts, breathing exercises, stress relief activities, hydration, and smoking cessation reminders, among others.
[0124] Upon initialization, the behavior manager 1665 may connect the loaded FSMs 1705 to an event bus 1675 to facilitate communication between the FSMs 1705 and various components of the application 1650. The event bus 1675 may correspond to an interface between the plug-ins 1680 and various components of the application 1650, such as the application services 1660, the behavior manager 1665, and the layout handler 1670. This connection allows the behavior manager 1665 to distribute or communicate events corresponding to user interactions with the application 1650 to each FSM 1705 via the event bus 1675. The receiving FSMs 1705 can, in turn, process and handle the events communicated via the event bus 1675.
[0125] Additionally, for each FSM 1705 within an individual plug-in 1680, the behavior manager 1665 may track the current state 1710 of the FSM 1705. The behavior manager 1665 may track the current state 1710 of each FSM 1705 via an event bus 1675. In some embodiments, the behavior manager 1665 may ping or query (e.g., every sample period) each FSM 1705 for its current state 1710 via the event bus 1675. In some embodiments, each FSM 1705 may provide (e.g., every sample period) its current state 1705 to the behavior manager 1665 via the event bus 1675. In some embodiments, the behavior manager 1665 may use or maintain an identifier of the current state 1710 for each FSM 1705 to track. Upon initialization, the current state 1710 of each FSM 1705 may correspond to the starting state 1710 of the FSM 1705 (eg, state 1710A as depicted).
[0126] In conjunction, the behavior manager 1665 can monitor or listen for at least one event 1735 of one or more of the user interface elements 1690 in the user interface 1685 via the event bus 1675. The event 1735 may correspond to at least one action performed by a user 1740 of the application 1650. For example, the user interface 1685 may present a prompt to the user 1740 to perform a breathing exercise, and the user 1740 may indicate completion of the exercise via user interaction with one of the user interface elements 1690 on the user interface 1685. In some embodiments, the behavior manager 1665 may monitor or listen for an event 1735 from another process of the application 1690 or the client 1610. The event 1735 in this case may correspond to the occurrence of an action by a process of the application 1690 or the client 1610 that was not triggered by an interaction from the user 1740. For example, behavior manager 1665 may receive data specifying a date and time from a system timer on client 1610 and recognize the receipt of that data as an event 1735 .
[0127] In response to detecting the event 1735, the behavior manager 1665 may determine or select at least one FSM 1705 in the corresponding plug-in 1680 for invocation. In some embodiments, the behavior manager 1665 may communicate or pass the detected event 1735 to the plug-in 1680 via the event bus 1675. As described above, the event bus 1675 may correspond to an interface between the plug-in 1680 and various components of the application 1650. The event bus 1675 may be used to relay, communicate, or otherwise provide calls and signals between the plug-ins 1680 loaded in the application 1650. By passing, the behavior manager 1665 may match the detected event 1735 with events specified by the transitions 1715 for the current state 1710. As described above, the behavior manager 1665 may track the current state 1710 of each FSM 1705 in the individual plug-ins 1680. In some embodiments, the behavior manager 1665 may detect or receive the results of the check for the detected event 1735 via the event bus 1675.
[0128] If the detected event 1735 does not correspond to the specifications in any transition 1715 of the current state 1710, the behavior manager 1665 may maintain the FSM 1705 in the current state 1710 (e.g., state 1710A as depicted). In some embodiments, the behavior manager 1665 may also refrain from invoking the FSM 1705. Maintaining the FSM 1705 in the current state 1710 may correspond to the user 1740 not completing the routines of the set of routines configured for the FSM 1705 for any transition 1715 associated with the current state 1710. The behavior manager 1665 may continue to check the detected event 1735 against the specifications of the FSMs 1705 in other plug-ins 1680.
[0129] Conversely, when the detected event 1735 corresponds to the specification of one of the transitions 1715 of the current state 1710, the behavior manager 1665 may select the FSM 1705 to invoke. By invoking, the behavior manager 1665 may update the current state 1710 of the FSM 1705 to the next state 1710' according to the transition 1715 (e.g., as shown). The update of the FSM 1705 from the current state 1710 to the next state 1710' may correspond to the user 1740 completing a routine of the set of routines configured for the FSM 1705 as specified for at least one of the transitions 1715 associated with the current state 1710. Additionally, from invoking the FSM 1705 of the plug-in 1680, the behavior manager 1665 may search for or identify the output 1745 specified by the next state 1710' of the FSM 1705. The output 1745 may identify a user interface element 1690 to be presented via a user interface 1685 of the application 1650, as described above. In some embodiments, the output 1745 may identify a modification to be applied to the user interface element 1690 of the user interface 1685. The behavior manager 1665 may communicate or pass the output 1745 to the behavior manager 1665 via an event bus 1675.
[0130] 17C, a block diagram of a process 1760 for modifying a user interface 1685 in a system 1600 for providing a finite state machine to an application is depicted. The process 1760 may correspond to the operation of the application configuration service 1605 and the application 1650 upon invocation of one of the FSMs 1705 in the plug-in 1680. Under the process 1760, a layout handler 1670 of the application 1650 executing on the client 1610 may update, change or otherwise modify the user interface elements 1690 of the user interface 1685 according to the output 1745. By configuring the user interface 1685, the layout handler 1670 may associate or bind the states 1710 in the FSM 1705 of the plug-in 1680 to the user interface elements 1690 of the user interface 1685. In some embodiments, a layout handler 1670 in cooperation with a behavior manager 1665 may maintain an association or binding between the state 1710 of an FSM 1705 and user interface elements 1690 of a user interface 1685. For example, the layout handler 1670 may track the relationship between the state 1710 of the most recently invoked FSM 1705 and the user interface elements 1690 rendered or presented via the user interface 1685.
[0131] In modifying, the layout handler 1670 may determine whether to send a request for content 1765 to the application configuration service 1605 (or another remote service). The output 1745 may depend on at least one content item 1770 (e.g., images, videos, and other objects) provided during execution of the application 1650 from the application configuration service 1605. If the output 1745 does not specify a search for a content item 1770, the layout handler 1670 may refrain from sending the request for content 1765 to the application configuration service 1605. The layout handler 1670 may also continue to modify the user interface elements 1690 of the user interface 1685 according to the output 1745. On the other hand, if the output 1745 specifies a search for content 1765, the layout handler 1670 may decide to send the request for content 1765 to the application configuration service 1605. The layout handler 1670 may generate a request for content 1765 that includes at least one identifier that references a content item 1770 to be retrieved from the application configuration service 1605. The identifier may be specified by the output 1745 from the current state 1710 of the FSM 1705.
[0132] A content manager 1635 executing on the application configuration service 1605 can in turn search, identify, or otherwise receive a request 1765 for content from the client 1610. In some embodiments, the content manager 1635 may reside on a remote service separate from the application configuration service 1605 accessible via the network 1620. The content manager 1635 may analyze the request 1765 to identify a content item 1770 to be provided to the client 1610 for presentation on the user interface 1685. In some embodiments, the content manager 1635 may use an identifier in the request 1765 to access the database 1615 to search, fetch, or identify the content item 1770 referenced by the identifier. The content item 1770 may be visual or audio media information and may include images, videos, sounds, or any other object presented on the user interface 1685. For example, the content item 1770 may include sounds to be played in conjunction with fitness exercises for a routine associated with the invoked FSM 1705. Depending on the specification, content manager 1635 may transmit, return, or otherwise provide content item 1770 to client 1610 .
[0133] The layout handler 1670 may then search for, locate, or receive the content item 1770 from the application configuration service 1605 (or a remote service). Upon receipt, the layout handler 1670 may insert, add, or otherwise include the content item 1770 in the user interface 1685. The layout handler 1670 may include the content item 1770 in one or more user interface elements 1690 for presentation, as specified in the output 1745 from the FSM 1705. At the same time, the layout handler 1670 may modify the user interface elements 1690 of the user interface 1685 in accordance with the output 1745. For example, the layout handler 1670 may instantiate the user interface elements 1690, set the color and other visual characteristics of the individual user interface elements 1690 themselves, set the font and size of the text within the individual user interface elements 1690, and assign the placement of the user interface elements 1690 within the display of the client 1610. In some embodiments, the layout handler 1670 can provide instructions for the presentation of the content item 1770 to the invoked FSM 1705 via an event bus 1675.
[0134] In some embodiments, the layout handler 1670 may generate or determine rendering instructions using the output 1745 specified by the FSM 1705. The output 1745 may identify a set of instructions (e.g., original or lower-level format) that correspond to individual user interface elements 1690 to be included in the user interface 1685. The rendering instructions may be in the form of a display list or a rendering tree. Once identified, the layout handler 1670 may parse the instructions in the output 1745 that correspond to the set of user interface elements 1690. For each instruction, the layout handler 1670 may generate an equivalent entry (e.g., a rendering tree node) for inclusion in the rendering instructions. Upon generation, the layout handler 1670 may present the user interface elements 1690 for the user interface 1685 according to the rendering instructions.
[0135] In conjunction, behavior manager 1665 may send, transmit, or provide at least one record entry 1775 to application configuration service 1605 (or another remote service). Upon detecting one or more events 1735, behavior manager 1665 may write or otherwise generate record entry 1775. Record entry 1775 may identify or include various information about what is happening on plugin 1680 in application 1650. In some embodiments, record 1775 may identify a user action associated with the detected event 1735 via a user interface element 1690 of application 1650. For example, among other things, record entry 1775 may identify the current state 1710 of each FSM 1705 in plug-in 1680, routines completed or remaining for user 1740 in FSMs 1705, events 1735 detected, the type of each event 1735, a timestamp corresponding to the time each event 1735 was detected, an identifier for user 1740, an identifier for client 1610, an identifier for the instance of application 1650, etc. Upon generation, behavior manager 1665 can send record entry 1775 to application configuration service 1605.
[0136] The analysis evaluator 1640 executing on the application configuration service 1605 can then search, locate, or otherwise receive the record entries 1775 from the client 1610. Upon receipt, the analysis evaluator 1640 can add and include the record entries 1775 in a log record 1780 maintained on the database 1615. The log record 1780 can track and maintain the record entries 1775 received from the various clients 1610. In some embodiments, the log record 1780 may be maintained according to a database management system (DBMS), such as a relational, object-oriented, or object-relational DBMS. Using the record entries 1775 maintained in the log record 1780, new plugins 1680 may be configured or the configuration file 1645 may be modified by a developer.
[0137]
[00136] Referring now to Figure 18A, a flow diagram of a method 1800 for configuring a finite state machine (FSM) on an application is depicted. The method 1800 may be implemented using any of the components as described in detail herein with respect to Figures 16-17B or 19. See Figures 16-17B or 19. Under the method 1800, a service may identify a configuration file for the finite state machine (1805). The service may use the configuration file to generate machine-readable instructions (1810). The service provides the machine-readable instructions to add to the application (1815).
[0138] Referring now to FIG. 18B, a flow diagram of a method 1850 for processing a finite state machine (FSM) on an application is depicted. The method 1850 may be implemented using any of the components as described in detail herein with respect to FIGs. 16-17B or 19. The method 1850 may be implemented using components as described in detail herein with respect to FIGs. 16-17B or 19. Under the method 1850, a client may identify instructions for a finite state machine (1855). The client may monitor user interactions (1860). The client may determine whether a detected interaction satisfies a condition of a current state of the finite state machine (1865). If the interaction satisfies a condition of a current state of the finite state machine, the client may invoke the finite state machine (1870). The client may update the layout according to the finite state machine (1875).
[0139] (D. Network and Computing Environment) Various operations described herein may be performed on a computer system. FIG. 19 is a simplified block diagram of a representative server system 1900, a client computer system 1914, and a network 1926 that may be used to implement certain embodiments of the present disclosure. In various embodiments, the server system 1900 or a similar system may implement the services or servers described herein or portions thereof. The client computer system 1914 or a similar system may implement the clients described herein. Systems 2300, 2800, and 3300 described herein may be similar to the server system 1900. The server system 1900 may have a modular design incorporating multiple modules 1902 (e.g., blades in a blade server embodiment), and although two modules 1902 are shown, any number may be provided. Each module 1902 may include a processing unit 1904 and local storage 1906.
[0140] The processing unit 1904 may include a single processor or multiple processors, which may have one or more cores. In some embodiments, the processing unit 1904 may include a general-purpose primary processor and one or more special-purpose co-processors, such as a graphics processor, digital signal processor, etc. In some embodiments, some or all of the processing units 1904 may be implemented using customized circuitry, such as an application specific integrated circuit (ASIC) or a field programmable gate array (FPGA). In some embodiments, such integrated circuits execute instructions stored in the circuitry itself. In other embodiments, the processing unit 1904 may execute instructions stored in local storage 1906. Any type of processor in any combination may be included in the processing unit 1904.
[0141] The local storage 1906 may include volatile storage media (e.g., DRAM, SRAM, SDRAM, etc.) and / or non-volatile storage media (e.g., magnetic or optical disks, flash memory, etc.). The storage media incorporated in the local storage 1906 may be fixed, removable, or upgradeable, as desired. The local storage 1906 may be physically or logically divided into various sub-units, such as a system memory, a read-only memory (ROM), and a permanent storage device. The system memory may be a volatile read-write memory, such as a read-write memory device or a dynamic random access memory. The system memory may store some or all of the instructions and data that the processing unit 1904 needs at run time. The ROM may store static data and instructions that the processing unit 1904 needs. The permanent storage device may be a non-volatile read-write memory device that may store instructions and data even when the module 1902 is powered down. As used herein, the term "storage medium" includes any medium capable of storing data indefinitely (subject to overwriting, electrical disturbance, power loss, etc.), and does not include carrier waves and ephemeral electronic signals propagated over wireless or wired connections.
[0142] In some embodiments, local storage 1906 may store one or more software programs executed by processing unit 1904, such as an operating system and / or programs that implement various server functions, such as the functions of systems 2300, 2800, and 3300, or any other system described herein, or any other server associated with systems 2300, 2800, and 3300, or any other system described herein.
[0143] "Software" generally refers to a sequence of instructions that, when executed by the processing unit 1904, causes the server system 1900 (or portions thereof) to perform various operations, and thus defines one or more specific machine embodiments that execute and perform the operations of the software programs. The instructions may be stored as firmware resident in a read-only memory and / or as program code stored in a non-volatile storage medium that can be read into a volatile working memory for execution by the processing unit 1904. The software may be implemented as a single program or a collection of separate programs or program modules that interact as desired. From the local storage 1906 (or non-local storage, described below), the processing unit 1904 may retrieve program instructions to execute and data to process in order to perform the various operations described above.
[0144] In some server systems 1900, multiple modules 1902 may be interconnected via a bus or other interconnect 1908 to form a local area network that supports communication between the modules 1902 and other components of the server system 1900. The interconnect 1908 may be implemented using a variety of technologies, including server racks, hubs, routers, etc.
[0145] A wide area network (WAN) interface 1910 may provide data communication capabilities between a local area network (interconnect 1908) and a network 1926, such as the Internet. Technologies including wired technologies (e.g., Ethernet, IEEE 802.3 standard) and / or wireless technologies (e.g., Wi-Fi, IEEE 802.11 standard) may be used.
[0146] In some embodiments, the local storage 1906 is intended to provide working memory for the processing unit 1904 and provide fast access to programs and / or data being processed while reducing traffic on the interconnect 1908. Storage for larger amounts of data may be provided over a local area network by one or more mass storage subsystems 1912, which may be connected to the interconnect 1908. The mass storage subsystems 1912 may be based on magnetic, optical, semiconductor or other data storage media. Direct attached storage, storage area networks, network attached storage, etc. may be used. Any data store or other collection of data described herein as generated, consumed or maintained by a service or server may be stored in the mass storage subsystem 1912. In some embodiments, additional data storage resources may be accessed via a WAN interface 1910 (potentially increasing latency).
[0147] The server system 1900 may operate in response to requests received via the WAN interface 1910. For example, one of the modules 1902 may implement a monitoring function and may assign individual tasks to other modules 1902 in response to received requests. Work allocation techniques may be used. Once a request has been processed, the results are returned to the requester via the WAN interface 1910. Such operations may typically be automated. Additionally, in some embodiments, the WAN interface 1910 may connect multiple server systems 1900 together, providing a scalable system capable of managing large volumes of activity. Other techniques for managing server systems and server farms (collections of collaborating server systems) may be used, including dynamic resource allocation and reallocation.
[0148] The server system 1900 can interact with a variety of user-owned or user-operated devices over a wide area network such as the Internet. One example of a user-operated device is shown in Figure 19 as client computing system 1914. The client computing system 1914 can be implemented as a consumer device, such as, for example, a smartphone, other mobile phone, tablet computer, wearable computing device (e.g., smart watch, glasses), desktop computer, laptop computer, etc.
[0149] For example, client computing system 1914 may communicate over WAN interface 1910. Client computing system 1914 may include computer components such as a processing unit 1916, storage 1918, network interface 1920, user input devices 1922, and user output devices 1924. Client computing system 1914 may be computing devices implemented in a variety of form factors, such as desktop computers, laptop computers, tablet computers, smartphones, other mobile computing devices, wearable computing devices, etc.
[0150] The processor 1916 and storage 1918 may be similar to the processing unit 1904 and local storage 1906 described above. An appropriate device may be selected based on the requirements placed on the client computing system 1914. For example, the client computing system 1914 may be implemented as a "thin" client having limited processing capabilities or as a high-powered computing device. The client computing system 1914 may include program code executable by the processing unit 1916 to enable various interactions with the server system 1900.
[0151] The network interface 1920 may provide a connection to a network 1926, such as a wide area network (e.g., the Internet) to which the WAN interface 1910 of the server system 1900 is also connected. In various embodiments, the network interface 1920 may include a wired interface (e.g., Ethernet) and / or a wireless interface implementing various RF data communication standards, such as Wi-Fi, Bluetooth, or cellular data network standards (e.g., 3G, 4G, LTE, etc.).
[0152] User input device 1922 may include any device (or devices) by which a user can provide signals to client computing system 1914, which can interpret the signals as indicating a particular user request or information. In various embodiments, user input device 1922 may include any or all of a keyboard, a touchpad, a touchscreen, a mouse or other pointing device, a scroll wheel, a click wheel, a dial, a button, a switch, a keypad, a microphone, and the like.
[0153] The user output device 1924 may include any device by which the client computing system 1914 can provide information to a user. For example, the user output device 1924 may include a display that displays images generated or delivered by the client computing system 1914. The display may incorporate a variety of image generating technologies, e.g., liquid crystal display (LCD), light emitting diode (LED) including organic light emitting diode (OLED), projection system, cathode ray tube (CRT), etc., along with supporting electronics (e.g., digital-to-analog or analog-to-digital converters, signal processors, etc.). Some embodiments may include devices such as a touch screen that function as both an input and output device. In some embodiments, other user output devices 1924 may be provided in addition to or instead of a display. Examples include indicator lights, speakers, tactile "show" devices, printers, etc.
[0154] Some embodiments include electronic components such as a microprocessor, storage, memory, etc. that store computer program instructions on a computer-readable storage medium. Many of the features described herein can be implemented as a process specified as a set of program instructions encoded on a computer-readable storage medium. These program instructions, when executed by one or more processing units, cause the processing units to perform various operations indicated by the program instructions. Examples of program instructions or computer code include machine code, such as produced by a compiler, and files containing high-level code that are executed by a computer, electronic component, or microprocessor using an interpreter. With appropriate programming, the processing units 1904 and 1916 can provide various functionalities for the server system 1900 and the client computing system 1914, including any or other functionality described herein as being performed by a server or client.
[0155] It will be understood that the server system 1900 and the client computing system 1914 are exemplary and that variations and modifications are possible. Computer systems used in connection with embodiments of the present disclosure may have other capabilities not specifically described herein. Additionally, while the server system 1900 and the client computing system 1914 are described with reference to certain blocks, it should be understood that these blocks are defined for convenience of description and are not intended to imply a particular physical arrangement of components. For example, different blocks may, but need not, be located in the same facility, in the same server rack, or on the same motherboard. Additionally, the blocks need not correspond to physically distinct components. The blocks may be configured to perform various operations, for example, by programming a processor or providing appropriate control circuitry, and the various blocks may or may not be reconfigurable depending on how the initial configuration is obtained. The embodiments of the present disclosure may be realized in a variety of apparatuses, including electronic devices implemented using any combination of circuitry and software.
[0156] Although the present disclosure has been described with respect to specific embodiments, those skilled in the art will recognize that many variations are possible. The embodiments of the present disclosure can be implemented using various computer systems and communication technologies, including but not limited to the specific examples described herein. The embodiments of the present disclosure can be implemented using any combination of dedicated components and / or programmable processors and / or other programmable devices. The various processes described herein can be implemented in any combination on the same processor or different processors. Where a component is described as being configured to perform a particular operation, such configuration can be achieved, for example, by designing an electronic circuit to perform the operation, by programming a programmable electronic circuit (such as a microprocessor) to perform the operation, or by any combination thereof. Furthermore, while the embodiments described above may refer to specific hardware and software components, those skilled in the art will recognize that different combinations of hardware and / or software components can also be used, and that certain operations described as being implemented in hardware can also be implemented in software, or vice versa.
[0157] A computer program incorporating various features of the present disclosure may be encoded and stored on a variety of computer readable storage media. Suitable media include magnetic disks or tapes, optical storage media such as compact disks (CDs) or digital versatile disks (DVDs), flash memory, and other non-transitory media. A computer readable medium encoded with the program code may be packaged with a compatible electronic device, or the program code may be provided separately from the electronic device (e.g., via internet download or as a separately packaged computer readable storage medium).
[0158] Therefore, although the disclosure has been described in terms of specific embodiments, it will be understood that the disclosure is intended to cover all modifications and equivalents that are within the scope of the following claims.
Claims
1. A method for configuring finite state machines (FSMs) for an application, comprising the steps of: identifying, by at least one server, a configuration file for the application, the configuration file including human readable instructions defining a plurality of FSMs for a respective plurality of routines for addressing a user state, each FSM of the plurality of FSMs comprising: (i) a plurality of states, including at least a first state and a second state, each state specifying an output to provide via the application; and (ii) a plurality of transitions, each of which specifies a distinct event that may be detected via the application to transition from the first state to the second state and corresponds to a user action to be performed via the application for the routine; identifying said configuration file, generating, by the at least one server, intermediate instructions defining the plurality of FSMs using the human readable instructions of the configuration file; and providing, by the at least one server, the intermediate instructions generated from the configuration file to the application to generate machine readable instructions defining the plurality of FSMs to be selectively invoked by the application; A method comprising:
2. 2. The method of claim 1, wherein each transition of the plurality of transitions in at least one FSM of the plurality of FSMs specifies the event detected via a user interface element of the application, the event corresponding to the user action performed on the individual routine.
3. 2. The method of claim 1, wherein at least one transition of the plurality of transitions in a first FSM of the plurality of FSMs specifies the event that invokes a second FSM of the plurality of FSMs defined by the human readable instructions of the configuration file.
4. 2. The method of claim 1 , wherein at least one state of the plurality of states in at least one FSM of the plurality of FSMs specifies one or more user interface elements for presenting the output via the application.
5. 2. The method of claim 1, wherein identifying the configuration file further comprises receiving from a computing device a script including the human readable instructions generated using a development application.
6. 2. The method of claim 1, wherein generating the intermediate instructions further comprises using a transpiler to convert the intermediate instructions compiled by the application at load time into the human readable instructions.
7. 2. The method of claim 1, wherein providing the intermediate instructions further comprises transmitting the intermediate instructions to a client device to be loaded by the application installed on the client device.
8. 2. The method of claim 1, further comprising the step of selecting, by the at least one server, intermediate instructions to provide to the application in response to a request for a routine that addresses the state of the user of the application.
9. 2. The method of claim 1, further comprising: upon detection by the at least one server of the event transitioning from the first state to the second state, in response to the application invoking a first FSM of the plurality of FSMs, transmitting a content item for presentation via a user interface element of the application.
10. 2. The method of claim 1, further comprising receiving, by the at least one server, a record entry from the application on a client device identifying the user action associated with the event detected via a user interface element of the application.
11. 1. A system for configuring finite state machines (FSMs) for an application, comprising: At least one server having one or more processors coupled to a memory, the at least one server comprising: identifying a configuration file for the application that includes human readable instructions defining a plurality of FSMs for a respective plurality of routines, each FSM of the plurality of FSMs comprising: (i) a plurality of states, including at least a first state and a second state, each state specifying an output to provide via the application; and (ii) a plurality of transitions, each of which specifies a distinct event corresponding to a user action to be performed via the application to transition from the first state to the second state, to the routine; identifying said configuration file, generating intermediate instructions defining the plurality of FSMs using the human readable instructions of the configuration file; and providing the intermediate instructions generated from the configuration file to the application to generate machine readable instructions defining the plurality of FSMs to be selectively invoked by the application; A system configured to:
12. 12. The system of claim 11, wherein each transition of the plurality of transitions in at least one of the plurality of FSMs specifies the event detected via a user interface element of the application, the event corresponding to the user action performed on the individual routine.
13. 12. The system of claim 11, wherein at least one transition of the plurality of transitions in a first FSM of the plurality of FSMs specifies the event for invoking a second FSM of the plurality of FSMs defined by the human readable instructions in the configuration file.
14. 12. The system of claim 11, wherein at least one state of the plurality of states in at least one FSM of the plurality of FSMs specifies one or more user interface elements for presenting the output via the application.
15. 12. The system of claim 11, wherein the at least one server is further configured to receive from a computing device a script including the human readable instructions generated using a development application.
16. 12. The system of claim 11, wherein the at least one server is further configured to use a transpiler to convert the human readable instructions into the intermediate instructions that are compiled by the application at load time.
17. 12. The system of claim 11, wherein the at least one server is further configured to perform the step of transmitting the intermediate instructions to a client device to be loaded by the application installed on the client device.
18. 12. The system of claim 11, wherein the at least one server is further configured to perform the step of selecting the intermediate instructions to provide to the application in response to a request by a routine to address the state of the user of the application.
19. 12. The system of claim 11, wherein the at least one server is further configured to, upon detection of the event transitioning from the first state to the second state, in response to the application invoking a first FSM of the plurality of FSMs, transmit a content item for presentation via a user interface element of the application.
20. 12. The system of claim 11, wherein the at least one server is further configured to: receive, from the application on a client device, a record entry identifying the user action associated with the event detected via a user interface element of the application.
21. A method for handling and processing finite state machines (FSMs) on an application, comprising: loading, by the application when executed on a client device, machine readable instructions defining a plurality of FSMs corresponding to a plurality of routines for handling a user state; identifying, by the application, the plurality of FSMs defined by the machine-readable instructions, each FSM of the plurality of FSMs comprising: (i) a first state of each of the plurality of states, each state specifying an output to provide via the application; and (ii) a plurality of transitions from a respective current state, each transition specifying a respective event detected via the application that transitions a corresponding FSM from the first state to a second state and corresponding to a user action to be performed via the application for a respective routine; identifying the plurality of FSMs, detecting, by the application, the user action performed via the application corresponding to the respective event specified by at least one of a plurality of transitions specified in an FSM of the plurality of FSMs; and updating, by the application, the FSM from the respective first state to the second state in response to the detection of the user action to provide an output resulting from the second state; A method comprising:
22. 22. The method of claim 21, further comprising generating the machine-readable instructions by compiling, by the application, intermediate instructions defining the plurality of FSMs received from a server.
23. 22. The method of claim 21, further comprising identifying, by the application, the machine-readable instructions for the plurality of corresponding routines to load based on the state of the user to be addressed.
24. 22. The method of claim 21, further comprising, in response to receiving, by the application, a configuration update including the machine-readable instructions for addressing the state of the user, replacing second machine-readable instructions with the machine-readable instructions.
25. 22. The method of claim 21, further comprising transmitting, by the application, a record entry to a server identifying the user action associated with the event detected via a user interface element of the application.
26. 22. The method of claim 21 , wherein the detecting step further comprises using an event bus to monitor invocations of the FSM responsive to the user actions corresponding to the respective events specified by at least one of the plurality of transitions of the respective current state.
27. 22. The method of claim 21 , wherein the updating step further comprises retrieving a content item from a server for presentation via a user interface element of the application in accordance with the output specified by the second state of the FSM.
28. 22. The method of claim 21 , wherein the updating step further comprises presenting one or more user interface elements on the application according to the output specified by the second state of the FSM.
29. 22. The method of claim 21 , wherein each transition of the plurality of transitions in at least one FSM of the plurality of FSMs specifies the event detected via a user interface element of the application, the event corresponding to the user action to be performed on the individual routine.
30. 22. The method of claim 21, wherein at least one transition of the plurality of transitions in a first FSM of the plurality of FSMs specifies the event that invokes a second FSM of the plurality of FSMs defined by the machine-readable instructions in a configuration file.
31. 1. A system for manipulating and processing finite state machines (FSMs) on an application, comprising: an application executable on a client device having one or more processors coupled to a memory, the application comprising: loading machine readable instructions that, when executed, define a number of FSMs corresponding to a number of routines for handling a user state; identifying a plurality of FSMs defined by the machine-readable instructions, each FSM of the plurality of FSMs comprising: (i) a first state of each of the plurality of states, each state specifying an output to provide via the application; and (ii) a plurality of transitions from a respective current state, each of which specifies a respective event corresponding to a user action to be detected via the application for transitioning the corresponding FSM from the first state to a second state and for a respective routine; identifying the plurality of FSMs, detecting the user action performed via the application corresponding to the respective event specified by at least one of the plurality of transitions identified in an FSM of the plurality of FSMs; and updating the FSM from the respective first state to the second state in response to detecting the user action to provide the output resulting from the second state; A system configured to:
32. 32. The system of claim 31 , wherein the application is further configured to generate the machine-readable instructions by compiling intermediate instructions defining the plurality of FSMs received from a server.
33. 32. The system of claim 31, wherein the application is further configured to identify the machine readable instructions for a corresponding number of the routines to load based on the state of the user being addressed.
34. 32. The system of claim 31 , wherein the application is further configured to, in response to receiving a configuration update including the machine-readable instructions for addressing the state of the user, replace second machine-readable instructions with the machine-readable instructions.
35. 32. The system of claim 31 , wherein the application is further configured to: transmit to a server a record entry identifying the user action associated with the event detected via a user interface element of the application.
36. 32. The system of claim 31 , wherein the application is further configured to monitor, using an event bus, invocation of the FSM responsive to the user actions corresponding to the respective events specified by at least one of the plurality of transitions of the respective current state.
37. 32. The system of claim 31 , wherein the application is further configured to retrieve a content item from a server for presentation via a user interface element of the application in accordance with the output specified by the second state of the FSM.
38. 32. The system of claim 31 , wherein the application is further configured to present one or more user interface elements on the application according to the output specified by the second state of the FSM.
39. 32. The system of claim 31 , wherein each transition of the plurality of transitions in at least one FSM of the plurality of FSMs specifies the event detected via a user interface element of the application, the event corresponding to the user action performed on the individual routine.
40. 32. The system of claim 31 , wherein at least one transition of the plurality of transitions in a first FSM of the plurality of FSMs specifies the event that invokes a second FSM of the plurality of FSMs defined by the machine-readable instructions in a configuration file.
