Widget state machine for arinc661 protocol
By using a Widget state machine to uniformly manage the Widget context, the problem of low efficiency in Widget context management under the ARINC661 protocol is solved, achieving efficient recursive calls and scalability, thereby improving the reliability and scalability of the cockpit display system.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- CHINESE AERONAUTICAL RADIO ELECTRONICS RES INST
- Filing Date
- 2025-12-25
- Publication Date
- 2026-07-02
Smart Images

Figure CN2025145407_02072026_PF_FP_ABST
Abstract
Description
A Widget State Machine for the ARINC661 Protocol Technical Field
[0001] This invention belongs to the field of integrated civil aircraft avionics system design, and relates to the design and development of cockpit display system based on ARINC661 protocol, and particularly relates to a Widget state machine for ARINC661 protocol, which automatically manages context. Background Technology
[0002] As one of the main human-machine interfaces, the cockpit display system not only displays important information such as the aircraft's current flight parameters, engine status, and crew warnings in real time, but also receives interactive operation commands from the pilots on the display interface. This places certain demands on the operating efficiency and reliability of the cockpit display system. With the continuous development of avionics systems and the introduction of various new sensors, the information displayed by the cockpit display system is becoming increasingly complex. In order to meet the ever-expanding functional requirements, the ARINC661 protocol may need to be appropriately extended, which requires the cockpit display system to have good scalability.
[0003] The ARINC661 protocol defines the structure of a display screen, which can be abstracted as a tree structure as shown in Figure 1: An independent display unit is called a DU (Display Unit). A DU can be divided into several non-overlapping Windows. Each Windows contains several Layers stacked in a certain order. Each Layer consists of several Widgets with hierarchical relationships. In the hierarchy of Widgets, the direct superior is called the "parent Widget," the direct subordinate is called the "child Widget," and those at the same level are called "sibling Widgets." A Widget has only one parent Widget, but can have multiple child Widgets and sibling Widgets. The attributes of a Widget usually determine the corresponding attributes of its child Widgets. For example, when a Widget is invisible, its child Widgets are also invisible. The ARINC661 protocol defines a special Widget called a Connector, as shown in Figure 2. A Connector links to a Layer, and its function is to make the Widgets within the linked Layer child Widgets of the Widget to which the Connector belongs.
[0004] In the cockpit display system, the A661Server software is responsible for drawing the display screen. A Widget is the smallest functional unit of the display screen, and different types of Widgets have different appearances and functions. Attributes such as coordinates, visibility, interactivity, display priority, interaction priority, and clipping box affect the appearance and function of a Widget. These attributes constitute the drawing state of a Widget, called its "context." All child Widgets of a Widget share the same context. In traditional implementations, for a Widget, the context of each of its child Widgets needs to be set individually, resulting in low efficiency due to setting the same context multiple times. Furthermore, for a Widget, the drawing functions of its child Widgets need to be called recursively, and the Connector also needs to recursively call the drawing functions of the linked Layers. When the display screen is complex, multiple levels of recursive nesting can easily occur, posing a risk of recursive call stack overflow and reducing the reliability of the entire display system. Different types of Widgets may have similar functions, and these complex functions are repeatedly implemented, resulting in low code reusability and poor scalability. Therefore, it is essential to optimize the management strategy for Widget contexts. Summary of the Invention
[0005] The purpose of this invention is to provide a Widget state machine oriented towards the ARINC661 protocol, which enables unified automatic management of Widget contexts, thereby improving the operating efficiency of the cockpit display system and enhancing its reliability and scalability.
[0006] The objective of this invention is achieved through the following technical solution:
[0007] A Widget state machine for the ARINC661 protocol, including a domain identification algorithm and a context management algorithm;
[0008] The domain identification algorithm is used to perform the traversal process of the widget tree, and to identify whether a domain change has occurred during the traversal. The identification result is recorded as the next movement direction, including: entering a subdomain, moving within a domain, and returning to the parent domain.
[0009] The context management algorithm works in conjunction with the domain recognition algorithm. Based on the recognition result of the domain recognition algorithm, i.e., the next movement direction, the context is managed, including:
[0010] (1) Enter the subdomain, put the original current domain context on the top of the stack for storage, calculate the new current domain context from the atomic domain context, and then calculate and update the subdomain context based on the attributes of the subdomain being accessed in the new current domain.
[0011] (2) When moving within a domain, the current domain context remains unchanged, and the subdomain context is calculated and updated based on the attributes of the subdomain being visited in the current domain.
[0012] (3) Return to the parent domain and pop the context from the top of the stack to restore the context of the parent domain.
[0013] Preferably, the domain identification algorithm employs a depth-first preorder traversal.
[0014] Furthermore, the Widget state machine also includes a context inheritance algorithm. The context inheritance algorithm uses a context storage table to save and restore the context. When the inherited domain is executed, the context inheritance algorithm changes some context attributes of the inherited domain and saves them in the storage table, as well as records the corresponding context ID. When the inherited domain is executed, the context of the inherited domain is restored from the storage table based on the context ID as the context of the inherited domain.
[0015] Furthermore, the Widget state machine for the ARINC661 protocol also includes an extensible module that encapsulates specific Widget functions into independent modules. When entering a domain, the independent module is activated, thereby implementing the corresponding function within the current domain.
[0016] The beneficial effects of this invention are as follows:
[0017] This invention automatically manages the widget context through a widget state machine. Compared with traditional implementation methods, it achieves unified management of the widget context by introducing the concept of a "domain." For a widget, only its internal logic needs to be considered, without having to set contexts for all its child widgets, effectively improving the operating efficiency of the display system. For a widget, it is not necessary to recursively call the drawing functions of its child widgets, eliminating the recursion mechanism, reducing the risk of stack overflow, and enhancing the reliability of the cockpit display system. Specific widget functions are implemented by corresponding modules, and the domain is applied to the widget, improving code reusability, reducing maintenance costs, and enhancing the scalability of the display system. Attached Figure Description
[0018] Figure 1 is a schematic diagram of the display screen.
[0019] Figure 2 shows a Connector example.
[0020] Figure 3 shows an example of a domain.
[0021] Figure 4 shows an example of an inherited field.
[0022] Figure 5 shows the drawing process of a DU cycle screen. Detailed Implementation
[0023] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments.
[0024] This embodiment illustrates a Widget state machine oriented towards the ARINC661 protocol, which automatically manages the Widget context. Its core concept is the "domain." All child Widgets of a Widget share the same context, constituting the context scope of that Widget, or simply "domain." Specifically, the domain composed of all Windows, the domain composed of all Layers, and the domain composed of all Widgets are respectively called the DU domain, the Window domain, and the Layer domain. The Connector implements context inheritance; the domain of the linked Layer inherits the context of the domain containing the Connector. The former is called the inheriting domain, and the latter is called the inherited domain. The context of a domain is determined by the properties of the Widget (or other container, such as a Window) to which that domain belongs.
[0025] Referring to the domains shown in Figure 3, assuming we are currently traversing the child widgets of Widget#1, the "current domain" is the domain of Widget#1. All widgets within the solid box belong to the current domain, and their context is determined by the properties of Widget#1. When traversing to Widget#2, the domain of Widget#2 is called the "subdomain" of the current domain. The widgets within the dashed box belong to this subdomain, and their context is further determined by the properties of Widget#2, based on the current domain. Referring to the inherited domains shown in Figure 4, domain #1 is the inherited domain, and domain #2 is the inheriting domain. When drawing Layer B, domain #2 will inherit the context of domain #1.
[0026] This embodiment illustrates a Widget state machine for the ARINC661 protocol, which includes a domain identification algorithm, a context management algorithm, a context inheritance algorithm, and an extensible module. It works in conjunction with the Widget traversal process to achieve automatic context management.
[0027] (I) Domain Recognition Algorithm
[0028] The domain identification algorithm is used to perform the traversal of the widget tree and identify whether a domain change has occurred during the traversal. The identification result is recorded as the next movement direction, including: entering a subdomain (DOWN), moving within a domain (RIGHT), and returning to the parent domain (UP).
[0029] The domain identification algorithm uses the depth of the domain to represent the current domain level: the DU domain depth is 0, the Window domain depth is 1, the Layer domain depth is 2, and the Widget domain depth is an integer greater than or equal to 3. The domain identification algorithm initially operates within the DU domain.
[0030] The domain identification algorithm uses a depth-first preorder traversal. During the traversal, the changes in the domain can be categorized into three cases:
[0031] (1) Enter the subdomain, with the direction being DOWN, and the domain depth is increased by 1;
[0032] (2) Move within the domain in the direction of RIGHT, while the domain depth remains unchanged;
[0033] (3) Return to the parent domain in the UP direction, and decrease the domain depth by 1.
[0034] (II) Context Management Algorithm
[0035] The context management algorithm works in conjunction with the domain recognition algorithm. Based on the recognition result of the domain recognition algorithm, i.e. the next movement direction, the context is managed, including the saving, restoration and calculation of the context.
[0036] The context management algorithm uses a "stack" data structure to save and restore the context, ensuring that the Widget state machine can maintain the change trajectory of the domain and thus accurately return to the upper-level domain.
[0037] The current domain context is denoted as CurrentState, and the domain context of the widget being accessed in the current domain (i.e., the subdomain of the current domain) is denoted as SubState.
[0038] Based on the recognition results of the corresponding domain recognition algorithm, the context management algorithm will perform three operations:
[0039] (1) When the direction is DOWN, the DOWN operation is performed, the original current domain context CurrentState is pushed onto the top of the stack for storage, the new current domain context CurrentState is calculated from the original SubState, and then SubState is calculated and updated based on the properties of the Widget being accessed in the new current domain. At this time, the stack retains the context of all domains from the upper domain to the top domain.
[0040] (2) When the direction is RIGHT, the RIGHT operation is performed. The current domain context CurrentState remains unchanged. The SubState is calculated and updated based on the properties of the Widget being accessed in the current domain.
[0041] (3) With the direction being UP, perform the UP operation to pop the context at the top of the stack and restore it to the CurrentState of the upper-level domain.
[0042] (III) Context Inheritance Algorithm
[0043] A widget state machine allows a widget A to inherit the context of another widget B, without being restricted by the widget hierarchy. Widget A is called the inheriting widget, and widget B is called the inherited widget. When entering the inherited widget, the widget state machine updates and saves the context, binds the context ID to the corresponding inheriting widget, and restores the context when drawing the inheriting widget, thus achieving context inheritance.
[0044] Specifically, the context inheritance algorithm includes updating, saving, and restoring the context, and uses a context storage table to implement the saving and restoring of the context.
[0045] (1) Context Update: When A661server executes to the inherited domain, it changes certain context attributes of the inherited domain. For example, it allocates new display space and interaction space to ensure the correctness of the display priority and interaction priority of the inherited domain;
[0046] (2) Context saving: Save the modified context of the inherited domain in the storage table and record the corresponding context ID;
[0047] (3) Context recovery: When A661server executes to the inherited domain, it recovers the context of the inherited domain from the storage table based on the context id, and uses it as the context of the inherited domain.
[0048] (iv) Expandable Modules
[0049] Widget state machines can be extended appropriately by encapsulating specific widget functions into independent modules (such as widget position refresh, widget scrolling, etc.), allowing modules to be started when entering a domain, thereby implementing the corresponding functions within the current domain.
[0050] The following flowchart, shown in Figure 5, details the process by which the A661Server software performs a cycle-based screen rendering for a DU based on the Widget state machine:
[0051] 1. The A661Server software initializes the Widget state machine, sets the domain depth to 0, i.e., it is in the DU domain, and initializes the current context CurrentState.
[0052] 2. The domain identification algorithm traverses all Windows. Since we are currently in the DU domain, for each Windows, the context management algorithm is called to perform the RIGHT operation to update the SubState. Then, all Layers within the Window are traversed to complete the drawing of the Window domain.
[0053] 3. For each Layer, if it is not a linked Layer, the context management algorithm is invoked to perform a DOWN operation, enter the Window domain to access the Layer, or perform a RIGHT operation to access the next Layer. Otherwise, for linked Layers, the context inheritance algorithm is invoked to restore the context of the inherited domain as the context of the linked Layer. Then, the drawing of the current Layer begins, using a pre-order traversal algorithm to traverse all Widgets within the Layer domain. During this process, based on the direction of the next step of the traversal algorithm given by the domain identification algorithm, the context management algorithm is invoked to perform the corresponding operation, thereby drawing the corresponding Widget in the correct context. In particular, if a widget sets its domain extension function flag to true, when the domain identification algorithm traverses to that domain, the context management algorithm detects that the flag is true and will search for the existence of a corresponding extension function module. If it exists, the module is invoked to complete the function. If it does not exist, the function is skipped, and an error is logged as needed. If the currently drawn Widget is a Connector, the context of the inherited domain should be updated and saved during its drawing process.
[0054] 4. If all layers within the current window have finished drawing, then the context management algorithm is invoked, the UP operation is executed, and DU is returned. 域 。
[0055] It is understood that those skilled in the art can make equivalent substitutions or modifications to the technical solution and inventive concept of the present invention, and all such substitutions or modifications should fall within the protection scope of the appended claims.
Claims
1. A Widget state machine oriented to the ARINC 661 protocol, characterized in that The application comprises a domain recognition algorithm, a context management algorithm; The domain recognition algorithm is used to perform a traversal process of the widget tree and recognize whether a domain change occurs in the traversal process, and record the recognition result as a next moving direction, including entering a sub-domain, moving in a domain, and returning to a parent domain; The context management algorithm cooperates with the domain recognition algorithm, and manages the context according to the recognition result of the domain recognition algorithm, i.e. the next moving direction, including: (1) entering the sub-domain, saving the original current domain context at the top of a stack, calculating a new current domain context from the original atomic domain context, and calculating and updating the context of the sub-domain according to the attribute of the sub-domain being accessed in the new current domain; (2) moving in the domain, keeping the current domain context unchanged, calculating and updating the context of the sub-domain according to the attribute of the sub-domain being accessed in the current domain; (3) returning to the parent domain, de-stacking the context at the top of the stack to restore the context in the stack to the context of the parent domain.
2. A Widget state machine oriented to the ARINC 661 protocol according to claim 1, characterized in that The domain recognition algorithm adopts a depth-first pre-order traversal.
3. The ARINC 661 protocol oriented Widget state machine of claim 1, wherein The application further comprises a context inheritance algorithm, which uses a context storage table to save and restore the context, changes some context attributes of the inherited domain when executing the inherited domain, saves the changed context attributes in the storage table, and records the corresponding context id; when executing the inherited domain, the context of the inherited domain is restored from the storage table according to the context id as the context of the inherited domain.
4. The ARINC 661 protocol oriented Widget state machine of claim 1, wherein The application further comprises an extensible module, which encapsulates a specific widget function as an independent module, starts the independent module when entering a certain domain, and thus realizes the corresponding function in the current domain.