Widget state machine oriented to arinc 661 protocol
The widget context under the ARINC661 protocol is uniformly managed through the widget state machine, which solves the recursive call stack overflow problem, improves the operating efficiency and reliability of the cockpit display system, and enhances the scalability of the system.
Patent Information
- Application Number
- CN202411956058.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-28
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2044-12-28
AI Technical Summary
Under the existing ARINC661 protocol, the cockpit display system faces the risk of recursive call stack overflow when processing complex images, resulting in low operating efficiency, poor reliability and insufficient scalability.
The Widget state machine oriented to the ARINC661 protocol is adopted to achieve unified management of Widget context through domain identification algorithm, context management algorithm and context inheritance algorithm. The depth-first pre-order traversal and context stack structure are used, combined with extensible modules for functional encapsulation.
The operating efficiency of the cockpit display system is improved, the risk of recursive call stack overflow is reduced, the reliability and scalability of the system are enhanced, and maintenance costs are reduced.
Smart Images

Figure CN119829169B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of comprehensive civil aircraft avionics system design, and relates to the design and development of cockpit display system based on ARINC661 protocol, in particular to a Widget state machine facing ARINC661 protocol, which automatically manages context. BACKGROUND
[0002] As one of the main human-machine interaction interfaces, cockpit display system not only displays important information such as current flight parameters, engine conditions, crew warnings, etc. of the aircraft in real time, but also receives the interactive operation instructions of the pilot on the display interface, which puts forward certain requirements on the running efficiency and reliability of the cockpit display system. With the continuous development of avionics system and the introduction of various new sensors, the picture information displayed by the cockpit display system is becoming more and more complex. In order to meet the gradually expanding functional requirements, ARINC661 protocol may need to be appropriately extended, which requires the cockpit display system to have good scalability.
[0003] ARINC661 protocol defines the composition of the display picture, which can be abstracted as a tree structure as shown in Figure 1 A single display unit is called DU (Display Unit), and the DU can be divided into several non-overlapping Windows. Each Window has several Layers stacked in a certain order, and each Layer is composed of several Widgets with hierarchical relationship. In the hierarchical relationship of the Widget, the direct superior is called "parent Widget", the direct inferior is called "child Widget", and the same level is called "brother Widget". A Widget only has one parent Widget, but can have multiple child Widgets and brother Widgets. The properties of a Widget can usually determine the corresponding properties of its child Widgets, for example, when a certain Widget is in an invisible state, its child Widgets are also in an invisible state. ARINC661 protocol defines a special Widget called Connector, as shown in Figure 2 A Connector links a Layer, and its function is to make the Widgets in the linked Layer become the child Widgets of the Connector's Widget.
[0004] In a cockpit display system, the A661Server software is responsible for drawing a display picture, a Widget is the smallest functional unit of the display picture, and different kinds of Widgets have different appearances and functions. The coordinates, visibility, interactivity, display priority, interaction priority, and clipping box, etc. attributes will affect the appearance and function of the Widget, these attributes form the drawing state of the Widget, called "context", and all the child Widgets of a Widget share the same context. In the traditional implementation method, for a Widget, the context of each child Widget of the Widget needs to be set separately, that is, the same context is set multiple times, and the running efficiency is low; for a Widget, the drawing function of its child Widget needs to be called recursively, and the Connector also needs to call the drawing function of the linked Layer recursively, when the display picture is relatively complex, it is easy to produce multi-layer recursive nesting, and there is a risk of stack overflow of recursive call, which reduces the reliability of the entire display system; different kinds of Widgets may have similar functions, and these complex functions are repeatedly implemented, which has the disadvantages of low code reuse rate and poor scalability. Therefore, it is necessary to optimize the management strategy of the Widget context. SUMMARY
[0005] The application aims to provide a Widget state machine for ARINC661 protocol, which can automatically manage the Widget context uniformly, thereby improving the running efficiency of the cockpit display system and enhancing the reliability and scalability of the cockpit display system.
[0006] The application aims to achieve the above-mentioned application purposes through the following technical solutions.
[0007] A Widget state machine for ARINC661 protocol, comprising a domain identification algorithm and a context management algorithm.
[0008] The domain identification algorithm is used to perform a traversal process of a widget tree, and identify whether a domain change occurs in the traversal process, and record the identification result as a next moving direction, including entering a subdomain, moving in the domain, and returning to a parent domain.
[0009] The context management algorithm cooperates with the domain identification algorithm, and manages the context according to the identification result of the domain identification algorithm, that is, the next moving direction, including:
[0010] (1) entering the subdomain, saving the original current domain context on the top of the stack, calculating a new current domain context from the atomic domain context, and then calculating and updating the context of the subdomain according to the attribute of the subdomain being accessed in the new current domain;
[0011] (2) Intra-domain movement, the current domain context remains unchanged, and the context of the sub-domain is calculated and updated according to the attribute of the sub-domain being accessed in the current domain;
[0012] (3) Return to the upper domain, and the context at the top of the stack is popped to restore the stack to the context of the upper domain.
[0013] Preferably, the domain recognition algorithm adopts a depth-first pre-order traversal.
[0014] Further, the Widget state machine further comprises a context inheritance algorithm, and the context inheritance algorithm uses a context storage table to realize saving and restoring of the context. When execution arrives at an inherited domain, the context inheritance algorithm changes some context attributes of the inherited domain and saves the context attributes in the storage table, and records a corresponding context id. When execution arrives at an inherited domain, the context of the inherited domain is restored from the storage table according to the context id, and the context is used as the context of the inherited domain.
[0015] Further, the ARINC661 protocol-oriented Widget state machine further comprises an extensible module, and a specific Widget function is encapsulated as an independent module. When entering a certain domain, the independent module is started, so that the corresponding function is realized in the current domain.
[0016] The present application has the following advantages:
[0017] The present application automatically manages the Widget context through the Widget state machine. Compared with the traditional implementation method, the concept of "domain" is introduced, and the unified management of the Widget context is realized. For a Widget, only the internal logic needs to be concerned, and the context of all sub-Widgets does not need to be set, so that the running efficiency of the display system is effectively improved. For a Widget, the drawing function of the sub-Widget does not need to be recursively called, the recursive mechanism is removed, the risk of stack overflow is reduced, and the reliability of the cockpit display system is enhanced. Specific Widget functions are realized by corresponding modules, and the functions are applied to the Widget through the domain, so that the code reuse rate is improved, the maintenance cost is reduced, and the expandability of the display system is enhanced. BRIEF DESCRIPTION OF DRAWINGS
[0018] Figure 1 is a schematic diagram of a display screen.
[0019] Figure 2 is a Connector example.
[0020] Figure 3 is a domain example.
[0021] Figure 4 is an inherited domain example.
[0022] Figure 5 drawing process of one cycle of one DU. DETAILED DESCRIPTION
[0023] The application will be further described in detail below with reference to the accompanying drawings and examples.
[0024] The Widget state machine shown in the embodiment is oriented to the ARINC661 protocol, and automatically manages the Widget context, and the core is the concept of "domain". All child Widgets of one Widget share the same context, and form the context scope of the Widget, which is referred to as "domain". In particular, the domain formed by all Windows, the domain formed by all Layers, and the domain formed by all Widgets are referred to as DU domain, Window domain, and Layer domain respectively. The Connector implements the inheritance of the context, and the domain of the linked Layer will inherit the context of the domain of the Connector, and the former is referred to as the inherited domain, and the latter is referred to as the inherited domain. The context of the domain is determined by the attributes of the Widget (or other containers such as Window, etc.) to which the domain belongs.
[0025] Referring to Figure 3 The domain shown in the figure assumes that the child Widgets of Widget#1 are being traversed at this time, the "current domain" is the domain of Widget#1, and all Widgets in the solid line box belong to the current domain, and their contexts are determined by the attributes of Widget#1. When traversing to Widget#2, the domain of Widget#2 is referred to as the "child domain" of the current domain, and the Widgets in the dashed line box belong to the child domain, and their contexts are further determined by the attributes of Widget#2 on the basis of the context of the current domain. Referring to Figure 4 The inherited domain shown in the figure, where domain#1 is the inherited domain, and domain#2 is the inherited domain, and when drawing Layer B, domain#2 will inherit the context of domain#1.
[0026] The Widget state machine shown in the embodiment is oriented to the ARINC661 protocol, and contains a domain identification algorithm, a context management algorithm, a context inheritance algorithm, and an extensible module, and cooperates with the traversal process of the Widget to automatically manage the context.
[0027] (I) Domain identification algorithm
[0028] The domain identification algorithm is used to perform the traversal process of the widget tree, and identify whether the domain changes occur in the traversal process, and record the identification result as the next moving direction, including: entering the child domain (DOWN), moving in the domain (RIGHT), and returning to the upper domain (UP).
[0029] The domain recognition algorithm uses the depth of a domain to represent the level of the current domain: the DU domain has a depth of 0, the Window domain has a depth of 1, the Layer domain has a depth of 2, and the Widget domain has a depth of an integer greater than or equal to 3. The domain recognition algorithm initially stays in the DU domain.
[0030] The domain recognition algorithm uses a depth-first pre-order traversal, and the change of a domain during the traversal process is in one of the following three cases:
[0031] (1) entering a subdomain, the direction is DOWN, and the domain depth is increased by 1;
[0032] (2) moving within a domain, the direction is RIGHT, and the domain depth remains unchanged;
[0033] (3) returning to an upper domain, the direction is UP, and the domain depth is decreased by 1.
[0034] (II) Context management algorithm
[0035] 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 saving, restoring and calculating the context.
[0036] The context management algorithm uses the data structure of a "stack" to save and restore the context, so as to ensure that the Widget state machine can maintain the change track of the domain, and then accurately return to an upper domain.
[0037] The context of the current domain is recorded as CurrentState, and the context of the domain of the Widget being accessed in the current domain (i.e., the subdomain of the current domain) is recorded as SubState.
[0038] According to the recognition result of the domain recognition algorithm, the context management algorithm will perform three operations:
[0039] (1) the direction is DOWN, the DOWN operation is performed, the original current domain context CurrentState is saved at the top of the stack, a new current domain context CurrentState is calculated from the original SubState, and then SubState is calculated and updated according to the attributes of the Widget being accessed in the new current domain. At this time, the contexts of all domains from the upper domain to the top domain are retained in the stack.
[0040] (2) the direction is RIGHT, the RIGHT operation is performed, the current domain context CurrentState remains unchanged, and SubState is calculated and updated according to the attributes of the Widget being accessed in the current domain;
[0041] (3) the direction is UP, the UP operation is performed, and the context at the top of the stack is restored to the CurrentState of the upper domain.
[0042] (Three) Context Inheritance Algorithm
[0043] Widget state machine allows a domain A to inherit the context of another domain B without being restricted by the Widget hierarchy. Domain A is called the inheriting domain, and domain B is called the inherited domain. Widget state machine updates the context, saves the context, and binds the context id with the corresponding inheriting domain when entering the inherited domain, restores the context when rendering the inheriting domain, and realizes the inheritance of the context.
[0044] Specifically, the context inheritance algorithm includes context update, saving and restoration, and uses a context storage table to realize the saving and restoration of the context.
[0045] (1) Context update: when A661server executes to the inherited domain, some context attributes of the inherited domain are changed. For example, new display space and interaction space are opened to ensure the correctness of the display priority and interaction priority of the inherited domain;
[0046] (2) Context saving: save the context of the changed inherited domain in the storage table, and record the corresponding context id;
[0047] (3) Context restoration: when A661server executes to the inherited domain, according to the context id, restore the context of the inherited domain from the storage table as the context of the inherited domain.
[0048] (Four) Extensible Module
[0049] Widget state machine can be properly extended by encapsulating specific Widget functions as independent modules (such as Widget position refreshing, Widget scrolling, etc.), allowing the module to be started when entering a certain domain, thereby realizing the corresponding function in the current domain.
[0050] The following describes in detail the process of A661Server software based on Widget state machine to draw a cycle picture for a DU through the flowchart shown in FIG. 1: Figure 5
[0051] 1. A661Server software initializes the Widget state machine, sets the domain depth to 0, i.e. in the DU domain, and initializes the current context CurrentState.
[0052] 2. The domain recognition algorithm traverses all Windows, because it is currently in the DU domain, for each Window, the context management algorithm is called to execute the RIGHT operation to update SubState. Then traverse all Layers in the Window to complete the rendering of the Window domain.
[0053] 3. For each Layer, if the Layer is not a chained Layer, call the context management algorithm, perform the DOWN operation, enter the Window domain access Layer, or perform the RIGHT operation, access the next Layer; otherwise, for the chained Layer, call the context inheritance algorithm, restore the context of the inherited domain as the context of the chained Layer. Then start the drawing of the current Layer, using the pre-order traversal algorithm to traverse all Widgets in the Layer domain, in the process, according to the domain identification algorithm, give the direction of the next step of the traversal algorithm, call the context management algorithm to perform the corresponding operation, so as to draw the corresponding Widget in the correct context environment. In particular, if a certain widget sets the flag of its own domain extension function to true, when the domain identification algorithm traverses the domain, the context management algorithm detects that the flag is true, then it will search whether there is a corresponding extension function module, if there is, it will call the module to complete the function. If not, the function is skipped, and whether to record an error is determined according to the requirement. If the currently drawn Widget is a Connector, in its drawing process, the context of the inherited domain should be updated and saved.
[0054] 4. If the drawing of all Layers in the current Window is completed, call the context management algorithm, perform the UP operation, and return to the DU domain.
[0055] It can be understood that, for those skilled in the art, equivalent replacements or changes can be made according to the technical solutions and the inventive concept of the present application, and all these changes or replacements shall belong to the protection scope of the appended claims of the present application.
Claims
1. A Widget state machine oriented to the ARINC 661 protocol, characterized in that The domain recognition algorithm, the context management algorithm, the context inheritance algorithm and the extensible module are included. 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 stack to the context of the parent domain; The context inheritance algorithm uses a context storage table to save and restore the context, when executing to a domain to be inherited, the context inheritance algorithm changes some context attributes of the domain to be inherited and saves them in the storage table, and records the corresponding context id; when executing to an inheritance domain, the context of the domain to be inherited is restored from the storage table according to the context id, and is used as the context of the inheritance domain; The extensible module encapsulates specific widget functions as an independent module, and starts the independent module when entering a certain domain, so as to realize the corresponding functions in the current 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.
Citation Information
Patent Citations
A661Widget drawing method based on adaptive depth cache
CN116612208A
Collaborative context information management system
US20030208459A1