A task-state-aware adaptive GUI component tree dynamic reconstruction method and system
Patent Information
- Application Number
- CN202611055703.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-16
- Publication Date
- 2026-10-16
AI Technical Summary
[0007]针对现有技术的不足,本发明旨在解决现有前端架构中界面静态化与代理任务动态化之间的矛盾,提供一种基于任务态感知的自适应GUI组件树动态重构方法及系统,降低用户认知负荷,并将代理能力无缝融入用户界面
通过引入规则增强机制,利用第一系数和第二系数对端侧模型输出的意图概率进行修正,克服了单一轻量级模型在复杂交互场景下意图识别准确率低、易受干扰的问题,提升了任务态感知的鲁棒性,确保了后续组件重构的可靠性。
Smart Images

Figure CN122924633A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of graphical user interface generation and front-end interaction technology, specifically to a method and system for dynamic reconstruction of an adaptive GUI component tree based on task state awareness. Background Technology
[0002] With the development of artificial intelligence technology, web applications are shifting from traditional "static page display" to "intelligent agent interaction". The existing front-end interaction architecture is mainly built on static or quasi-static component trees, and the page layout is fixed in the development stage. User operations must strictly follow the preset interaction path.
[0003] When introducing intelligent agents with complex task processing capabilities, existing technologies suffer from at least the following drawbacks: Interface redundancy and high cognitive load: In order to accommodate various potential functions, the page often piles up a large number of controls. Users need to search for the required functions in the complicated UI, which significantly increases the cognitive load.
[0004] Response latency and disconnected interaction: In traditional architectures, the agent's intent prediction and interface feedback are separated. Even if the agent has predicted the user's intent, the interface still needs to wait for the user to manually trigger the operation, which cannot achieve a smooth "what you point to is what you get" interaction.
[0005] Lack of deep context awareness: Existing dynamic UI technologies are mostly limited to simple visibility control and cannot refactor the structure, hierarchy and attributes of the GUI component tree across components and at the structural level based on the deep task state.
[0006] Therefore, there is an urgent need for a method and system that can break the fixed layout and generate and adjust the interactive interface in real time according to the status of the agent task, so as to provide a low-latency, highly cohesive intelligent interactive experience. Summary of the Invention
[0007] To address the shortcomings of existing technologies, this invention aims to resolve the contradiction between static interfaces and dynamic proxy tasks in existing front-end architectures. It provides a method and system for dynamically reconstructing adaptive GUI component trees based on task-state awareness, reducing the cognitive load on users and seamlessly integrating proxy capabilities into the user interface.
[0008] To achieve the above objectives, the present invention provides the following technical solution: This invention provides a task-aware adaptive GUI component tree dynamic reconstruction method, which includes the following steps: Configure the front-end framework and initialize the task-state awareness engine and component tree manager: When the front-end framework starts, register task-state awareness-related plugins, load the predefined component mapping rule library, and initialize the task-state inference engine and component tree manager.
[0009] Collect user behavior data, use a lightweight client-side model for intent prediction, and generate a current task state vector: capture user interaction behavior data such as page dwell time, mouse movement trajectory, focused element, input content features, and operation context through the behavior collection module; input the behavior data into the lightweight client-side model for real-time inference, and output a task state vector representing the current user task intent and state.
[0010] Based on the task state vector, a predefined component mapping rule library is queried to generate a dynamic JSON description of the target component tree. The component mapping rule library adopts a multi-dimensional mapping table between task state and component form. The rule library is queried based on the task state vector to determine the component structure that matches the current task state and generate a target component tree JSON description that includes component type, attributes, hierarchical relationship, layout method and behavior. The dynamic JSON description supports the dynamic insertion, replacement or wrapping of existing UI components in the same page context according to changes in task state.
[0011] The component tree manager performs difference comparison and minimized updates on the current DOM structure, reorganizing the dynamic JSON description into a terminal GUI component structure: After receiving the JSON description of the target component tree, the component tree manager uses a virtual DOM comparison algorithm to compare it with the DOM or virtual DOM structure of the current page, identifies nodes that need to be added, deleted, replaced, or have their attributes updated, and performs DOM operations only on the changed nodes, thereby reorganizing the dynamic JSON description into a terminal-visible GUI component structure.
[0012] After rendering is complete, the lifecycle and event binding of the components are dynamically adjusted according to the task state: the lifecycle hook functions of the relevant components are dynamically adjusted according to the current task state to ensure that the components are correctly initialized, updated and destroyed in a specific task state, and the event handling functions related to the current task are dynamically bound or unbound so that the components can respond to the interactions in the specific task state.
[0013] As a further aspect of the present invention, the generation process of the dynamic JSON description includes: dynamically determining the insertion, deletion, replacement, or attribute change of components based on the task state vector, wherein the changes include style adjustment, component hierarchy reorganization, and cross-component structural reconstruction.
[0014] As a further aspect of the present invention, when performing rule matching in the component mapping rule base based on the task state vector, the target rule is selected by calculating the matching score between each candidate rule and the current task state vector.
[0015] As a further aspect of the present invention, the matching score is calculated as follows: It is determined whether the applicable task intent identifier of the relevant rule in the component mapping rule base is completely consistent with the task intent identifier in the current task state vector. If they are consistent, the score is 1; otherwise, it is 0. The degree to which the set of context constraints preset by the rule satisfies the context information in the current task state vector is measured. The matching result of the intent identifier and the degree to which the context constraints are satisfied are weighted and summed, and the result is the matching score of the rule with the current task state vector. Simultaneously, the candidate rule with the highest matching score is selected as the target rule. In the weighted summation, the degree to which the context constraints are satisfied is multiplied by a preset context matching weight coefficient.
[0016] This invention also provides a task-aware adaptive GUI component tree dynamic reconstruction system, the system comprising: The configuration module is used to load a predefined component mapping rule library and initialize the task-state inference engine and component tree manager when the front-end framework starts. The behavior collection module is used to capture user interaction behavior and context information in real time, including listening to native DOM events to collect page dwell time, mouse movement trajectory, focused element, input content and operation sequence; The task-state inference engine has a built-in lightweight edge model, which is used to receive the behavior data output by the behavior acquisition module, perform real-time inference, and output the current task-state vector. The lightweight edge model is a time-series neural network model that has been trained, quantized, compressed, and deployed on the terminal device. The component mapping module stores the mapping relationship between task states and component configurations. It contains the predefined component mapping rule library and generates dynamic JSON descriptions based on the task state vectors. The component tree manager is used to parse the dynamic JSON description and dynamically reconstruct and render the existing GUI component tree with minimal updates through virtual DOM difference comparison.
[0017] As a further aspect of the present invention, the task state vector is determined by combining the intent probability distribution output by the lightweight edge model with a rule enhancement mechanism for correction.
[0018] As a further aspect of the present invention, the rule enhancement mechanism is as follows: Obtain the initial probabilities of each candidate intent output by the lightweight edge model; When the length of the input text is greater than a preset length threshold and the pause duration is greater than a preset pause threshold, the initial probability of the candidate intent related to the generation class operation is multiplied by a first coefficient, where the first coefficient is 1+λ1 and λ1 is a preset enhancement coefficient. Among them, the candidate intents related to generation operations are defined by a pre-defined list of intent identifiers, which includes 'GENERATING', 'SUMMARIZING', etc. If the current focus component identifier does not belong to the expected reasonable focus set corresponding to any candidate intent, then the probability of the candidate intent is multiplied by the second coefficient, which is 1-λ2, where λ2 is a preset probability suppression coefficient, and 0 < λ2 < 1. After completing the multiplication process, the candidate intent corresponding to the maximum probability is selected as the current task state, and the task state vector is generated using the probability value as the confidence level.
[0019] As a further aspect of the present invention, before selecting the maximum probability and after rule enhancement, the corrected probabilities of each candidate intent are normalized so that the sum of the corrected probabilities of all candidate intents equals 1, and the maximum probability is selected from the normalized probabilities. As a further aspect of the present invention, the mapping relationship stored in the component mapping module includes multiple mapping rules, and each mapping rule includes at least a task state identifier and context constraints. The component mapping module is used to match target rules from the mapping rules according to the task state vector to determine the component structure topology change mode under different task states, including component insertion position, hierarchical relationship and interaction behavior, and supports the interface to perform structural evolution according to the task state; The component mapping module selects a target rule by calculating the matching score between each candidate rule and the task state vector when matching the target rule.
[0020] As a further aspect of the present invention, the dynamic reconstruction of the GUI component tree supports the dynamic generation of auxiliary interactive components near the current UI component. The auxiliary interactive component includes operation behaviors bound to the current task state. The insertion position of the auxiliary interactive component is dynamically determined based on the position and size information of its associated target component, so that the auxiliary interactive component and the target component maintain a preset relative positional relationship.
[0021] As a further aspect of the present invention, the dynamic JSON description includes component visibility information, anchor relationships between components, layout strategies, and action bindings; The anchor point relationship is determined by specifying anchor point components and relative position coefficients for the target component, so that the component tree manager can calculate the insertion coordinates of the target component based on the position and size of the anchor point components and the relative position coefficients. The insertion coordinates of the target component are determined based on the position and size information of its anchor component and a preset relative position coefficient, using the following formula: , ; In the formula, ( , ) represents the insertion coordinates of the target component; , These represent the coordinates of the reference point of the anchor point component in the viewport; and These represent the width and height of the anchor point component, respectively. This is a preset horizontal relative position coefficient; This is a preset vertical relative position coefficient; This is the preset vertical offset.
[0022] As a further aspect of the present invention, the component tree manager performs local DOM updates only on nodes with structural and attribute changes during difference comparison, while the remaining nodes remain unchanged. The differentiated update includes: parsing the dynamic JSON description and the current page's virtual DOM tree, performing node-level difference comparison, generating a patch package that only contains newly added, deleted, and attribute-changed nodes, and operating the real DOM according to the patch package to achieve partial rendering updates.
[0023] This invention provides a method and system for dynamic reconstruction of an adaptive GUI component tree based on task-state awareness. Compared with existing technologies, it has the following advantages: By introducing a rule enhancement mechanism, the intent probability output by the edge model is corrected using the first and second coefficients. This overcomes the problem of low intent recognition accuracy and susceptibility to interference in complex interaction scenarios by a single lightweight model, improves the robustness of task-state perception, and ensures the reliability of subsequent component reconstruction.
[0024] By using a comprehensive scoring model that combines anchor point relative position coefficients and layout strategies, the system comprehensively evaluates available space, context matching, and layout stability when dynamically inserting auxiliary components. This effectively solves the technical problem that dynamically inserted components can easily obscure existing interface elements or cause large-scale page reflow (shaking), ensuring UI stability and visual continuity.
[0025] By integrating task-state awareness into the front-end rendering process, dynamic reconstruction of the component tree structure is achieved based on the user's real-time task intent. This breaks through the limitations of fixed layouts, allowing the interface to evolve naturally with the task, reducing the user's cognitive load and operation latency, and solving the technical problem that a single static interface cannot adapt to multi-task scenarios. Attached Figure Description
[0026] Figure 1 This is a flowchart illustrating the method of the present invention.
[0027] Figure 2 This is a schematic diagram of the system architecture of the present invention. Detailed Implementation
[0028] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0029] Please see Figure 1 and Figure 2 As shown, the embodiments of the present invention provide the following technical solutions: As an embodiment of the present invention: This invention relates to a task-aware adaptive GUI component tree dynamic reconstruction method, comprising the following steps: S101: Initialization Configuration When the front-end framework starts, register the task-state awareness plugin and load the component mapping rule library; This rule base defines the component structure descriptions corresponding to different task states, which is essentially a mapping of "task state - component tree structure"; Simultaneously initialize the task-state inference engine, load the lightweight client-side model into memory; initialize the component tree manager, and set the virtual DOM comparison parameters; The task state and its component structure are as follows: IDLE state, or idle task state: a low-interference state when no clear intent is detected, retaining only the main container, input components and simplified navigation components, with a flat layout and no binding of complex logic.
[0030] The INPUTTING state, or input task state, is when user input is detected. Auxiliary components such as auto-complete full-page and prompt components are dynamically inserted near the input component through anchor points. The layout is either floating or embedded, and the input event is bound to update in real time.
[0031] In the GENERATING state, also known as the generation task state, when the system detects that the user is inputting long text and pausing in the input component, the behavior acquisition module continuously records input features, operation features, and context features. After inference by a lightweight edge model and supplemented by rule enhancement (such as increasing the probability of generation tasks when the input length exceeds the threshold and the pause duration exceeds the set value, and suppressing the generation probability when the focus leaves), the current task is identified as a content generation task. The component mapping module generates a target description containing MagicInputPanel and result display components according to the rules. The component tree manager inserts these components near the input area to form a combined structure of "input area + operation area + result area".
[0032] ERROR state, or abnormal task state: When an abnormality is detected, an error message and retry component are inserted into the current context, preserving the original structure, and can be automatically hidden or eliminated when the user re-enters the information.
[0033] When switching states, the component structure is dynamically adjusted according to predefined rules. For example, when IDLE→INPUTTING, auxiliary components are inserted; when INPUTTING→GENERATING, the structure is expanded; when GENERATING→ERROR, error messages are inserted; and when ERROR→INPUTTING, error components are removed and the input structure is restored.
[0034] The rule base defines the component insertion position, hierarchical relationship and interaction behavior, supports the structural evolution of the interface with the task state, and can be extended to composite task state or continuous task state.
[0035] S102: User Behavior Collection and Intent Prediction The behavior acquisition module listens to native DOM events such as mousemove, keydown, input, and focus, continuously acquires interaction data, and converts it into structured behavior features, including input features (text length, input rate, pause duration), operation features (mouse displacement), and context features (identifier of the currently focused component).
[0036] Encode features into feature vectors =[ , , , , ], and arranged by time into a sequence of actions S = { , ... }; in, For input text length, For input rate, For pause duration, For mouse displacement, The current focused component identifier; p = 1, 2, ..., P, where P is the number of occurrences of the behavior event; p is the index of the behavior event in the order of occurrence; mouse displacement is the amount of mouse displacement in a specified unit of time; pause duration refers to the time elapsed from the user's last input operation to the current time when there is no new input, which is obtained by the behavior acquisition module by recording the timestamp of the last keydown event and calculating the difference between it and the current time.
[0037] The action sequence is input into a lightweight temporal model (such as LSTM, GRU, etc.), and the output is the probability distribution of each task intent, denoted as... q = 1, 2, ..., Q, where Q is the number of candidate intentions; Simultaneously, a rule enhancement mechanism is introduced to correct the output; the rule enhancement mechanism is as follows: When the input text length Greater than the preset length threshold And the duration of the pause Greater than the preset pause threshold At that time, the probability of intent related to the generation operation is amplitude-adjusted, and the corrected probability is:
[0038] In the formula, This is an indicator function that takes the value 1 if the condition is true and 0 otherwise. The preset enhancement coefficient is greater than 0; The initial probability value output by the lightweight edge model for the candidate intent q; To enhance the rules mechanism After correction, the corrected probability value corresponding to the candidate intent q is obtained.
[0039] If the current focus component identifier If the set of reasonable focal points does not match the expected intent of the q-th candidate, probability suppression is performed.
[0040] In the formula, The preset probability suppression coefficient, 0 < <1; This is the expected reasonable focus set corresponding to the q-th candidate intent; Here, mismatch refers to the current focused component. Not part of a reasonable focus set Any element in the list indicates that the user's current focus does not match the interface environment required for the intent, and therefore the probability of the intent is appropriately suppressed; the expected reasonable focus set is predefined as an attribute of each mapping rule in the component mapping rule library, which consists of a set of DOM element IDs or CSS selector paths; Compare all Select the intent with the highest probability as the current task state T. K And record the maximum probability value after final correction as the confidence level of the intention; Before selecting the maximum probability, the modified probabilities of each candidate intent are normalized so that the sum of the modified probabilities of all candidate intents equals 1. The maximum probability is selected from the normalized probabilities. Finally, the current task state is determined based on the corrected probability distribution, and a structured task state vector containing task intent, confidence level, and contextual information is generated.
[0041] Taking a lightweight edge model using a three-layer LSTM network as an example; The input is a feature vector of user interaction behavior sequence within the most recent time window. Each feature vector includes a numerical representation of information such as operation type, duration, and target component type. The first LSTM layer has 128 hidden units, and the second layer has 64, both using the tanh activation function. Dropout with a dropout ratio of 0.2 is applied between layers. The output layer is a fully connected layer followed by a softmax activation function, and the output dimension is equal to the predefined number of task intent categories. Finally, the intent corresponding to the maximum probability in the softmax output is taken as the recognition result. The lightweight edge model is trained using a dataset of historical interaction behaviors labeled with user task intents. Each training sample consists of an operation sequence within a fixed-length time window and its corresponding intent label. Cross-entropy is used as the loss function, and the Adam optimizer is employed with an initial learning rate of 0.001 and a batch size of 32. Iterations to the validation set do not improve accuracy further. After training, the model is quantized and compressed before being deployed to the terminal device, and only forward propagation is performed during inference.
[0042] S103: Generate dynamic JSON description After receiving the task state vector, the component mapping module matches and retrieves candidate rules in the component mapping rule base; The component mapping rule base uses a key-value pair structure for storage. Each rule includes at least: a task state identifier, triggering conditions, corresponding UI component description information, and a list of candidate layout strategies. The UI component description information is organized in a nested tree structure, defining the component's hierarchical relationship, type attributes, and constraints. In this embodiment, the component mapping rule base can be predefined by UI / UX designers based on business scenarios, or it can be trained using supervised learning to obtain initial rules from a labeled <task state, UI screenshot, component tree> dataset, which are then manually verified before deployment.
[0043] Matching criteria include task intent, confidence level, contextual information, and behavioral characteristics.
[0044] The candidate rules are scored and the best rule is selected as follows: Retrieve matching mapping rules from the rule base; Let M be the number of rules in the rule base, and let the rules be numbered by index j, where j = 1, 2, ..., M; Each rule includes an identifier for the applicable task intent. and context constraint set ; pass: The matching score of the j-th rule with the current task state vector ;in, This is used to characterize the degree of similarity to the intent identifier, where 1 represents similarity and 0 represents non-similarity. Used to measure the degree to which contextual constraints are satisfied, γ is the preset context matching weight; Select Matching Score The highest rule serves as the target rule.
[0045] The parsing rules generate structure instructions to obtain the operation type (insertion, replacement, wrap), anchor component, insertion position, and candidate layout strategy set. The candidate layout strategy set is preset by the mapping rules according to the task state, indicating the layout method that the component can adopt in the current task context, such as one or more of relative layout, floating layout, and overlay layout; the component tree manager selects the optimal layout from this set based on real-time constraints in subsequent stages. The parsing process includes: standardizing the rule description into an intermediate representation and extracting fields such as operation, anchor, position, and layout; mapping the semantics of the fields into specific operations and parameters; completing or correcting parameters based on the context (e.g., the default position is after); validating the existence of anchor components and the legality of operations, and falling back to the default rules if they fail; and generating a standardized component generation parameter object.
[0046] The description of the target component node is constructed based on the operation instructions, including the component type, attribute configuration (such as anchor reference anchorTo, relative position), and behavior set.
[0047] Recursively generate sub-component descriptions to form a complete hierarchical structure, and specify the composition relationship between new components and anchors in the description.
[0048] The component structure is serialized into a JSON description, which includes component type, hierarchy, anchor dependencies, and interaction behavior information, to drive subsequent refactoring.
[0049] S104: Dynamic Restructuring of Component Tree After receiving the target structure description, the component tree manager performs a differential update, as follows: Standardize the current component tree and target description, unify node identifiers, and resolve anchor point dependencies; locate anchor point instances in the existing component tree and determine their insertion positions based on the anchor point component identifiers in the description; perform a difference comparison between the current component tree and the target structure, identify structural and attribute changes, and perform partial updates only on newly added or modified nodes (e.g., create a MagicInputPanel instance and its child components and insert them into the specified anchor point position, while the anchor point components remain unchanged); complete layout calculations and bind interactive behaviors based on component attributes; and apply the update results to the rendering layer.
[0050] If an exception occurs during the difference comparison process where the anchor component is missing, the component tree manager will revert to the default layout strategy (such as inserting the target component at the end of the root container) and log the exception to ensure that the interface does not crash.
[0051] The component insertion and rendering process involves anchor point positioning, layout strategy selection, and behavior trigger calculation: The insertion coordinates of the target component are determined based on the position and size information of its anchor component and a preset relative position coefficient; pass: , Calculate the insertion coordinates of the target component. , ); in:( , The coordinates of the anchor point component in the viewport are represented by the coordinates of the top left corner. and These represent the width and height of the anchor point component, respectively. This is the horizontal relative position coefficient, used to determine the position ratio of the target component in the horizontal direction of the anchor component. The value range can be [0,1], where 0 represents left alignment and 1 represents right alignment. This is the vertical relative position coefficient, used to determine the position ratio of the target component in the vertical direction of the anchor component. The value range can be [0,1], where 0 indicates top alignment and 1 indicates bottom alignment. This is the vertical offset, used to provide visual spacing between components, and is preset according to actual layout requirements.
[0052] In one alternative embodiment, α=0, β=1, and Δy=8 pixels are set so that the reference point of the target component is located 8 pixels to the lower left of the anchor component, thus avoiding visual overlap between components.
[0053] The component tree manager retrieves a set of candidate layout strategies carried in the dynamic JSON description, using these as options. From this set, the optimal approach is selected based on the available space of the current interface, context matching, and layout stability score, as follows: When there is a relative layout L a Floating layer layout L b and overlapping layout L c Three layout strategies; For each layout method L r Where r = a, b, c, and r is the index of the relative layout, floating layout, and overlay layout, respectively. Calculate the overall score : in: The available space score for the r-th layout strategy represents the degree to which the target component obstructs the existing content area of the page after placement under this layout strategy. A higher score indicates better space utilization and less obstruction. This available space score is obtained by calculating the overlap ratio between the target component's occupied area and the existing UI element area; the formula is as follows: In the formula, For layout strategy L r After placement, the rectangular area occupied by the target component in the interface; The area is the sum of the rectangular area occupied by the target component in the interface and the overlapping area of all existing UI element areas. The overlapping area is calculated by the intersection of the rectangles. If there are multiple existing elements, the area of the intersection of the union area and the target component is taken. The context matching score for the r-th layout strategy represents the degree of fit between the layout strategy and the current task state and operation flow; the context matching score is determined based on predefined empirical rules or historical interaction data. Let r be the stability score for the r-th layout strategy, representing the degree to which this layout strategy causes the displacement or rearrangement of interface elements. A higher stability score indicates less disturbance to the original layout; the formula is as follows: In the formula, This represents the total number of all visible components in the current interface. To implement the layout strategy L r Subsequently, the number of components whose position or size changes due to reasons such as changes in anchor point position, space compression, or layout container adjustment.
[0054] , , The preset weighting coefficients, and + + =1; Comparison of relative layouts L a Floating layer layout L band overlapping layout L c The three layout strategies were evaluated comprehensively, and the comprehensive score was selected. The layout with the highest value As the optimal layout strategy; Behavior triggering computation is modeled conditioned on intent probability, trigger threshold, input features, and pause time.
[0055] pass: Determine the final trigger state ; The activation condition is met if and only if the intent probability is higher than a threshold and the input features and pause duration also satisfy the activation criteria. Only when the value is non-zero (usually 1) will the action be triggered; in: This represents the current probability value of the corresponding task intent output by the lightweight edge model; This indicates the preset intent trigger threshold, when The triggering condition is initially met when the threshold is exceeded; This is an indicator function that takes the value 1 if the condition is true, and 0 otherwise. It represents user input characteristics, such as input text length, input rate, etc. Indicates the current pause duration for the user; It is a binary function, for example, when the input text length is... Exceeding the preset length threshold and pause duration If the preset time threshold is exceeded, return 1; otherwise, return 0.
[0056] In this embodiment, θ=0.7, the input text length threshold is ≥20 characters, and the pause duration threshold is ≥1.2 seconds; Based on the above calculation results, the component tree manager completes component insertion, layout determination and behavior binding, and applies the update to the rendering layer, realizing the structural dynamic reconstruction of the component tree.
[0057] S105: Interactive Feedback and Lifecycle Adjustment After the refactoring is complete, the component tree manager performs event binding and lifecycle control on the newly added components based on the current task state; Event handling functions (such as generating a summary, rewriting, etc.) are bound to the actions field, and the action identifiers are mapped to function references and registered through a unified event registration mechanism. Lifecycle strategies include: displaying the component when task conditions are met; hiding or destroying the component when continued input or focus loss is detected; and updating the component's internal state when the input content changes. These controls are implemented by listening to input and focus / blur events and combining them with task-state judgments. The component is initialized when mounted (onMount), updated when the state changes (onUpdate), and unmounted when the task state is no longer met (onDestroy), thus realizing the dynamic evolution of the life cycle with the task state.
[0058] When the task state switches to the GENERATING state, the newly added "Generate Summary" and other buttons in the interface will be automatically associated with the corresponding text generation processing logic during the component mounting phase, depending on the current GENERATING state. For example, clicking the button will call the summary or full-text generation service and update the preview area. Before a component is removed, these associated processing logics are automatically released when the task state leaves the GENERATING state, thus avoiding residual responses.
[0059] As a second embodiment of the present invention: In its specific implementation, compared to Embodiment 1, the only difference between the technical solution of this embodiment and Embodiment 1 is that this embodiment demonstrates a system-level implementation, and the system includes: The front-end host layer provides basic page rendering and the front-end framework runtime environment; it includes a configuration module, which loads a predefined component mapping rule library and initializes the task-state inference engine and component tree manager when the front-end framework starts. The behavior awareness layer includes a behavior acquisition module, which collects user interaction data in a fine-grained manner through event listeners and hook functions, and then passes it to the inference and decision-making layer after preliminary cleaning and formatting. The reasoning and decision-making layer includes a task-state reasoning engine, which runs edge AI models, receives data from the behavior perception layer, performs real-time reasoning, and outputs task-state vectors. The rendering scheduling layer includes a component mapping module and a component tree manager. The component mapping module generates a dynamic JSON description by looking up a table based on the task state vector. The component tree manager parses the rendering tree and completes a minimal update by comparing virtual DOM differences.
[0060] Through the above embodiments, the present invention makes the implicit task capabilities of the proxy explicit in the UI, solving the problems of response delay and interface redundancy in complex interactions.
[0061] For example, in a code editor, when a user enters a specific function name and pauses, the system detects the "seeking function parameter hints" task state and dynamically generates a parameter hint panel below the cursor; in a data analysis platform, when a user selects a dataset and drags it, the system detects the "data visualization" task state and dynamically generates a chart type selection component.
[0062] Those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by hardware related to program instructions. The program can be stored in a computer-readable storage medium. When the program is executed, it includes the steps of the above methods. The storage medium includes: ROM, RAM, magnetic disk, optical disk, USB flash drive, etc.
[0063] It should be stated that all user data collected in this application was collected with the user's consent and authorization, and the use of user data is legal and compliant, and the use and processing of user data comply with the relevant laws, regulations and standards of the relevant regions.
[0064] Furthermore, any content not described in detail in this specification is existing technology known to those skilled in the art.
[0065] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0066] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
[0067] The various embodiments of this application have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A method for dynamically reconstructing an adaptive GUI component tree based on task-state awareness, characterized in that, Includes the following steps: Configure and initialize the task-state awareness engine and component tree manager, including loading a predefined component mapping rule library; Collect user front-end interaction behavior and context information; front-end interaction behavior includes capturing user page dwell time, mouse trajectory, focused elements, and input content characteristics; The task state perception engine uses a lightweight client-side model to infer interactive behavior and determine the task state vector of the current page. The task state vector is determined by combining the intent probability distribution output by the lightweight client-side model with a rule enhancement mechanism. The task state vector includes at least the task intent identifier, confidence level, and contextual feature information. Based on the component mapping rule library, a dynamic JSON description of the target GUI component tree is generated according to the task state vector; The component tree manager parses the dynamic JSON description and performs differentiated updates to the DOM structure of the current page to complete the dynamic reconstruction of the GUI component tree.
2. The method for dynamic reconstruction of an adaptive GUI component tree based on task state awareness according to claim 1, characterized in that: The rule enhancement mechanism is as follows: obtain the initial probability of each candidate intent output by the lightweight end-side model; when the length of the input text is greater than the preset length threshold and the pause duration is greater than the preset pause threshold, multiply the initial probability of the candidate intent related to the generation operation by a preset first coefficient; if the current focus component identifier does not belong to the expected reasonable focus set corresponding to any candidate intent, multiply the probability of the candidate intent by a preset second coefficient. The final probability is determined by multiplying the product of the coefficient and the product of the coefficients. The first coefficient is 1+λ1, where λ1 is a preset enhancement coefficient; the second coefficient is 1-λ2, where λ2 is a preset probability suppression coefficient; the corrected probabilities of each candidate intent are normalized, and the candidate intent corresponding to the maximum normalized probability is selected as the current task state, and the probability value is used as the confidence level to generate the task state vector. Before selecting the maximum probability, the modified probabilities of each candidate intent are normalized so that the sum of the modified probabilities of all candidate intents equals 1. The maximum probability is selected from the normalized probabilities.
3. The method for dynamic reconstruction of an adaptive GUI component tree based on task state awareness according to claim 1, characterized in that: The generation process of the dynamic JSON description includes: dynamically determining the insertion, deletion, replacement or attribute change of components based on the task state vector, wherein the changes include style adjustment, component hierarchy reorganization and cross-component structural reconstruction; When performing rule matching in the component mapping rule base based on the task state vector, the target rule is selected by calculating the matching score between each candidate rule and the current task state vector; The matching score is calculated as follows: The system determines whether the applicable task intent identifier of the relevant rule in the component mapping rule base is completely consistent with the task intent identifier in the current task state vector. If they are consistent, the system counts as 1; otherwise, it counts as 0. The system also measures the degree to which the set of context constraints preset by the rule is satisfied with the context information in the current task state vector. The system then performs a weighted sum of the consistency result of the intent identifier and the degree to which the context constraints are satisfied. The result is the matching score of the rule and the current task state vector. Finally, the system selects the candidate rule with the highest matching score as the target rule. In the weighted summation, the degree to which the context constraints are satisfied is multiplied by a preset context matching weight coefficient.
4. The method for dynamic reconstruction of an adaptive GUI component tree based on task state awareness according to claim 1, characterized in that: The dynamic reconstruction of the GUI component tree supports the dynamic generation of auxiliary interactive components near the current UI component. These auxiliary interactive components contain operation behaviors bound to the current task state. The insertion position of the auxiliary interactive component is dynamically determined based on the position and size information of its associated target component, so that the auxiliary interactive component and the target component maintain a preset relative positional relationship.
5. The method for dynamic reconstruction of an adaptive GUI component tree based on task state awareness according to claim 1, characterized in that: The steps for differential updates through the component tree manager include: parsing the dynamic JSON description and the current page's virtual DOM tree, performing node-level difference comparisons, generating a patch package that only contains newly added, deleted, and attribute-changed nodes, and operating the real DOM based on the patch package.
6. A task-aware adaptive GUI component tree dynamic reconstruction system, the system being used to execute the task-aware adaptive GUI component tree dynamic reconstruction method according to any one of claims 1-5, characterized in that, The system includes: The configuration module is used to load a predefined component mapping rule library and initialize the task-state inference engine and component tree manager when the front-end framework starts. The behavior acquisition module is used to capture user interaction behavior and context information in real time; Task-state inference engine, used to run lightweight edge models and output task-state vectors; The component mapping module is used to store the mapping relationship between task states and component configurations. It contains the predefined component mapping rule library and generates dynamic JSON descriptions based on the task state vector. The component tree manager is used to parse the dynamic JSON description and dynamically reconstruct and render the current GUI component tree with minimal updates through virtual DOM difference comparison.
7. A task-aware adaptive GUI component tree dynamic reconstruction system according to claim 6, characterized in that: The component mapping module stores multiple mapping rules, each of which includes at least a task state identifier and context constraints. The component mapping module is used to match target rules from the mapping rules according to the task state vector to determine the component structure topology change mode under different task states, including component insertion position, hierarchical relationship and interaction behavior, and supports the interface to perform structural evolution according to the task state; The component mapping module selects a target rule by calculating the matching score between each candidate rule and the task state vector when matching the target rule.
8. The adaptive GUI component tree dynamic reconstruction system based on task state awareness according to claim 6, characterized in that: The dynamic JSON description includes anchor relationships between components, layout strategies, and action binding information; The anchor point relationship is determined by specifying anchor point components and relative position coefficients for the target component. This allows the component tree manager to calculate the insertion coordinates of the target component based on the position and size of the anchor point components and the relative position coefficients. The insertion coordinates are calculated by adding a horizontal offset and a vertical offset to the reference point coordinates of the anchor point components. The reference point coordinates are the coordinates of the top left corner of the anchor point components in the viewport. The horizontal offset is the product of a preset horizontal relative position coefficient and the width of the anchor point components. The vertical offset is the sum of the product of a preset vertical relative position coefficient and the height of the anchor point components and a preset vertical offset.
9. A task-aware adaptive GUI component tree dynamic reconstruction system according to claim 6, characterized in that: When performing difference comparison, the component tree manager only performs local updates on nodes with structural and attribute changes, while keeping the remaining nodes unchanged.
10. A task-aware adaptive GUI component tree dynamic reconstruction system according to claim 6, characterized in that: The task-state inference engine also incorporates a rule enhancement mechanism to correct the model output in order to generate the final task-state vector.