Page element dynamic positioning method based on adaptive waiting strategy
By employing an adaptive waiting strategy and an undirected graph data structure, the problem of page element location failure in traditional methods under network jitter environments is solved, enabling efficient and robust automated task execution in weak network environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG FULIN TECH CO LTD
- Filing Date
- 2026-06-02
- Publication Date
- 2026-06-30
AI Technical Summary
In computer data processing and graphical user interface automation control, traditional fixed waiting time mechanisms and high-frequency polling methods cause page element positioning failures under network latency jitter, resulting in wasted system resources and positioning anomalies, which is particularly evident in edge operation environments.
An adaptive waiting strategy is adopted. By extracting transmission protocol delay jitter and network throughput data, the upper limit of waiting time is predicted using a time-series predictive network model. Combined with undirected graph data structure and maximum subgraph isomorphic matching algorithm, a safe interaction boundary is constructed, and interaction operations are executed in advance. The dependency between the visually visible state and the layout stable state is removed, and degradation anchoring is achieved.
It effectively avoids misjudgment and timeouts caused by network jitter and insufficient computing power, ensuring the efficient and stable execution of automated tasks. It can accurately locate target objects in fragmented visual layout conditions, reducing resource consumption and positioning failures.
Smart Images

Figure CN122309223A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, specifically to a method for dynamic positioning of page elements based on an adaptive waiting strategy. Background Technology
[0002] In the fields of computer data processing and graphical user interface automation control, control engines typically need to dynamically address and manipulate target nodes in the page node tree. Currently, automation control scripts generally employ a static blocking mechanism with a fixed waiting time before executing interactive instructions, or determine whether the target data is ready by frequently polling the visual exposure features of nodes.
[0003] However, when automated data processing terminals are deployed in edge environments with weak physical communication infrastructure, the underlying network communication links face latency jitter and data throughput bottlenecks. Under such weak network conditions, traditional fixed-latency waiting mechanisms are prone to timeout interruptions, resulting in a significant waste of system computing resources. More critically, frequent loss of underlying communication data packets often leads to timeouts in loading cascading style sheets (CSS) files responsible for page layout. According to the processing logic of the computer's internal graphics rendering pipeline, once layout style data is missing, the visual layout engine will be unable to calculate and assign precise width, height, and two-dimensional physical coordinates to node objects, leading to severe structural collapse and node overlap in the page's visual layout.
[0004] Existing dynamic positioning data processing methods rely on the geometric feature weights and visual visibility attributes of nodes. When the typesetting engine fails, the control program not only cannot calculate the spatial boundary of the target node, but also triggers a memory pointer addressing exception because it cannot extract valid physical rendering coordinates, ultimately causing a complete deadlock and stagnation of the automated data acquisition and business command issuance chain.
[0005] To address this, a dynamic positioning method for page elements based on an adaptive waiting strategy is proposed. Summary of the Invention
[0006] The purpose of this invention is to provide a method for dynamic positioning of page elements based on an adaptive waiting strategy, construct a safe interaction boundary, and perform interactive operations on target nodes that have not escaped the safe interaction boundary in advance when the web page resources are not fully loaded.
[0007] To achieve the above objectives, the present invention provides the following technical solution: The method for dynamically locating page elements based on an adaptive waiting strategy includes: Extract latency jitter data from the transmission protocol and combine it with the historical loading characteristics of the target page to input into the time-series prediction network model, and output the upper limit of the waiting time for the current localization task; Within the waiting time limit, a non-linear backoff detection frequency, from dense to sparse, is used to continuously monitor the internal mounting status, visual visibility status, and layout stability status of the target node in the page node tree. When the target node's internal mounting state is ready, but the visual visibility and layout stability assessments fail due to a timeout in loading the Cascading Style Sheets file, the geometric size feature weights of the target node are stripped, and the node data in the internal mounting state is extracted. An undirected graph data structure is constructed based on the internal semantic attributes and hierarchical association topology of the page node tree, and the target node is downgraded and anchored. When the target node is downgraded and anchored, and the local node block it belongs to has been mounted to the page node tree, the nearest ancestor node container that has completed the layout rendering is traced back as a reference, and a safe interaction boundary is constructed around the local node block where the target node is located; before the overall web page resources are fully loaded, the interaction operation is performed on the target node that has not escaped the safe interaction boundary in advance.
[0008] Preferably, the steps for obtaining the maximum waiting time for the current location task include: Extract latency jitter data from the Transmission Control Protocol (TCP), including round-trip time (RTT) status data and network throughput status data; based on the RTT status data and network throughput status data, obtain the network quality characteristics of the current communication link; obtain the historical loading characteristics of the target page, specifically historical rendering time data. The network quality features and historical rendering time data are serialized and concatenated to generate a multi-dimensional temporal feature matrix. The multidimensional temporal feature matrix is input into a pre-trained temporal prediction network model to perform trend extrapolation and output a dynamic fault tolerance coefficient that characterizes the degree of degradation of the weak network environment. Based on the product operation of the dynamic fault tolerance coefficient and the baseline response time, the upper limit of the waiting time for the current positioning task is output.
[0009] Preferably, the steps for monitoring the internal mounting status, visual visibility status, and layout stability status of the target node include: In the initial stage of the detection mission, an initial detection cycle is set, a set of node tree objects is obtained, and target node matching is performed based on the set of node tree objects. When the matching result is empty, detection failure event record data is generated. The cumulative occurrence count of the detection failure event record data is extracted, and the cumulative occurrence count is substituted into the exponential decay function for calculation. The extended detection time interval data for the next round is output, forming a nonlinear backoff detection frequency from dense to sparse. During each probe, extract the document tree node attributes, computed style sheet attributes, and rendering repaint event marker data of the currently traversed node; output true / false boolean values for the internal mounting state based on the document tree node attributes, output true / false boolean values for the visually visible state based on the computed style sheet attributes, and output true / false boolean values for the layout stable state based on the rendering repaint event marker data.
[0010] Preferably, the steps for extracting node data from the internal mount state include: Get the network resource request event queue and extract the network request time data of cascading stylesheet files in the queue; When the network request timeout exceeds the preset style loading warning threshold, a timeout failure instruction for visual rendering engine crash is generated; based on the timeout failure instruction, the absolute pixel horizontal and vertical coordinate weights, relative width feature weights and relative height feature weights of the target node are forcibly set to zero, and the geometric size feature weights are stripped. After the stripping operation is completed, the node data in the internal mounting state is extracted from the internal storage space. The node data includes the hypertext markup language tag character data carried by the target node itself, the business text string data nested inside the node, and the business identification attribute data.
[0011] Preferably, the steps for downgrading and anchoring the target node include: Based on the extracted node data, an undirected graph vertex set data with attribute weights is generated; the ancestor node traversal path data of the target node is obtained by tracing upwards, and the sibling arrangement order data of its child nodes is parsed downwards. The ancestor node traversal path data and sibling arrangement order data are transformed into an undirected graph edge set data representing the hierarchical topology. By concatenating the vertex set data and edge set data of the undirected graph, an undirected graph data structure representing the incomplete rendering structure of the page is obtained. The standard topology template graph structure data of the pre-configured target node is extracted, and the undirected graph data structure and the standard topology template graph structure data are input into the maximum subgraph isomorphism matching algorithm to calculate the graph structure similarity and output the highest similarity score data. When the highest similarity score data exceeds the preset topology fault tolerance threshold, the virtual memory handle corresponding to the successfully matched vertex set is used as the output result to complete the downgrade anchoring of the target node without visual assistance.
[0012] Preferably, the steps for constructing a secure interaction boundary include: based on the virtual memory handle of the target node obtained by downgrade anchoring, tracing upwards layer by layer along the hierarchical structure of the page node tree, detecting the rendering completion flag data of each parent container node along the path; when the first parent structure containing the rendering completion flag data is identified, it is determined as the nearest ancestor node container that has completed layout rendering; calling the underlying window interface to extract the physical horizontal coordinate data, physical vertical coordinate data, and container display width and height data of the nearest ancestor node container on the two-dimensional screen, merging and converting them into a reference coordinate system; extracting the expected maximum displacement tolerance value of the current local node block, performing spatial expansion calculations based on the reference coordinate system and the maximum displacement tolerance value, calculating a dynamically changing set of coordinate points of a closed polygon in the screen coordinate matrix, and outputting the set of coordinate points of the closed polygon as a secure interaction boundary that restricts the drift of local nodes.
[0013] Preferably, the steps for performing interactive operations in advance include: extracting the overall macro-level loading event state data of the webpage and comparing it to confirm that it is currently in a state of incomplete loading due to blocking and suspension of image resources and / or cross-domain scripts; capturing the instantaneous physical rendering coordinate data generated by the nearest ancestor node container during the layout redraw process; performing spatial position intersection comparison calculation between the instantaneous physical rendering coordinate data and the set of coordinate points of the closed polygon of the safe interaction boundary; when it is determined that the instantaneous physical rendering coordinate data falls inside the set of coordinate points of the closed polygon, outputting a non-escape judgment instruction; based on the non-escape judgment instruction, bypassing the blocking interception mechanism of the global page loading completion event, extracting the generated automated click electrical signal instruction and character filling data packet, and injecting them into the virtual memory handle corresponding to the target node, thereby triggering the interactive response of the business system in advance before the page visual layout is formed.
[0014] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. This invention constructs a dual-path cross-attention prediction mechanism. It extracts external transmission quality data such as round-trip delay and network throughput, and synchronously extracts and serializes these data along with internal computational power blocking data such as the backlog length of the main thread macro task in the page runtime environment. Hidden state feature vectors are obtained using the Long Short-Term Memory network pathways, and then fused and scored via the cross-attention mechanism layer to deduce a dynamic fault tolerance coefficient representing the degree of environmental degradation. This effectively avoids misjudgment and timeouts caused by the interplay of computational power scarcity and network jitter, ensuring the high efficiency and robustness of automated task execution.
[0015] 2. This invention proposes a topology degradation anchoring mechanism. When a failure in visually perceptible state assessment is detected, the absolute pixel coordinates and geometric feature weights such as width and height of the target node are stripped away. Pure semantic data, including Hypertext Markup Language (HTML) tag characters, nested business text, and business identifier attributes, are extracted from the internal storage space. Based on this data and the hierarchical topology, an undirected graph data structure representing the incomplete rendering structure is constructed. A maximum subgraph isomorphism matching algorithm is used to calculate the graph structure similarity with a standard topology template. This allows the control engine to break free from its strong dependence on the completeness of graphics rendering, enabling it to accurately locate the virtual memory handle of the target object even in fragmented visual layout conditions.
[0016] 3. This invention proposes an interaction scheme based on ancestor node reference and hierarchical segmentation. After the target node is downgraded and anchored, the system backtracks to the nearest ancestor node container that has completed layout rendering, using this as a reference to perform spatial expansion calculations to construct the basic boundary. Simultaneously, floating nodes are scanned along the depth dimension perpendicular to the screen, filtering out interference nodes with higher stacking order, and occlusion areas are removed through Boolean difference subtraction operations to generate the final safe interaction boundary. As long as the instantaneous physical rendering coordinates do not escape this safe boundary, the automated click electrical signal command is directly injected into the virtual memory handle, eliminating the interception and interference of the data masking layer on the command. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating the page element dynamic positioning method based on an adaptive waiting strategy according to the present invention. Figure 2 This is a schematic diagram of the downgrade anchoring process of the present invention; Figure 3 This is a schematic diagram illustrating the construction of the undirected graph data structure of the present invention. Detailed Implementation
[0018] 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.
[0019] Example 1: This invention proposes a method for dynamic positioning of page elements based on an adaptive waiting strategy, the process of which is as follows: Figure 1 As shown, it includes: Extract latency jitter data from the transmission protocol and combine it with the historical loading characteristics of the target page to input into the time-series prediction network model, and output the upper limit of the waiting time for the current localization task; Within the waiting time limit, a non-linear backoff detection frequency, from dense to sparse, is used to continuously monitor the internal mounting status, visual visibility status, and layout stability status of the target node in the page node tree. When the target node's internal mounting state is ready, but the visual visibility and layout stability assessments fail due to a timeout in loading the Cascading Style Sheets file, the geometric size feature weights of the target node are stripped, and the node data in the internal mounting state is extracted. An undirected graph data structure is constructed based on the internal semantic attributes and hierarchical association topology of the page node tree, and the target node is downgraded and anchored. When the target node is downgraded and anchored, and the local node block it belongs to has been mounted to the page node tree, the nearest ancestor node container that has completed the layout rendering is traced back as a reference, and a safe interaction boundary is constructed around the local node block where the target node is located; before the overall web page resources are fully loaded, the interaction operation is performed on the target node that has not escaped the safe interaction boundary in advance.
[0020] Preferably, the steps for obtaining the maximum waiting time for the current location task include: Extract latency jitter data from the Transmission Control Protocol (TCP), including round-trip time (RTT) status data and network throughput status data; based on the RTT status data and network throughput status data, obtain the network quality characteristics of the current communication link; obtain the historical loading characteristics of the target page, specifically historical rendering time data. The network quality features and historical rendering time data are serialized and concatenated to generate a multi-dimensional temporal feature matrix. The multidimensional temporal feature matrix is input into a pre-trained temporal prediction network model to perform trend extrapolation and output a dynamic fault tolerance coefficient that characterizes the degree of degradation of the weak network environment. Based on the product operation of the dynamic fault tolerance coefficient and the baseline response time, the upper limit of the waiting time for the current positioning task is output.
[0021] First, the automated control engine continuously monitors the underlying communication status of the Transmission Control Protocol (TCP) estimated by the application-layer socket interface. TCP is a connection-oriented transport layer communication protocol that generates two key metrics during data transmission: round-trip time (RTT) status data and network throughput status data. RTT status data refers to the total time it takes for a data packet to travel from the sender, through the network link, to the receiver, and return an acknowledgment signal; this metric directly reflects the propagation delay of the current communication link. Network throughput status data refers to the amount of effective data successfully transmitted per unit time; this metric reflects the actual carrying capacity of the communication channel. The control engine extracts these two data items at fixed sampling intervals through the statistical module of the underlying socket interface and aggregates the values from the most recent sampling periods to obtain network quality characteristics that describe the overall quality status of the current communication link.
[0022] The aggregation operation includes: calculating the arithmetic mean of the raw round-trip delay values within the window to obtain the mean round-trip delay, representing the average propagation delay level within the current window; calculating the standard deviation of the raw round-trip delay values within the window to obtain the delay jitter, representing the severity of the round-trip delay fluctuation within the current window; dividing all sampling points within the window into a first half and a second half in chronological order, calculating the mean round-trip delay of each half and the difference to obtain the delay change trend, where a positive value indicates that the delay tends to worsen within the window, and a negative value indicates that it tends to improve; calculating the arithmetic mean of the raw network throughput values within the window to obtain the mean network throughput, representing the average data transmission capacity within the current window; calculating the standard deviation of the raw network throughput values within the window to obtain the throughput fluctuation, representing the stability of the throughput rate within the current window; and calculating the network throughput change trend using the same method as the difference between the means of the first and second halves as the delay change trend, where a positive value indicates that the throughput capacity tends to improve within the window, and a negative value indicates that it tends to decrease. These statistics are then concatenated in a fixed order to obtain the network quality characteristics.
[0023] Secondly, the control engine accesses the target page's historical access logs in the local persistent storage medium, extracting complete rendering time records for the target page over several past accesses, forming a historical rendering time data sequence. The historical rendering time data refers to the time interval from when a page request is issued to when the page node tree completes all resource mounting and triggers the loading completion event. This data reflects the basic loading pattern of the target page under normal network conditions.
[0024] After collecting the above two types of data, the network quality features and historical rendering time data sequences are serialized, aligned, and concatenated according to the time dimension to construct a multi-dimensional temporal feature matrix. Each row of the multi-dimensional temporal feature matrix represents a snapshot of the comprehensive state at a historical moment, and each column represents an independent feature dimension. The matrix simultaneously contains information on both the dynamic changing trend of network communication status and the historical patterns of page rendering behavior.
[0025] The aforementioned multidimensional temporal feature matrix is input into a pre-trained temporal prediction network model. This model employs a long short-term memory (LSTM) network architecture, which effectively captures long-term dependencies in time series data. The model's input layer receives the multidimensional temporal feature matrix, which, after passing through the hidden state propagation and gating mechanism of several layers of recurrent neural network units, extracts trend features from the sequence. Finally, a scalar value is output through a fully connected output layer, representing the dynamic fault tolerance coefficient that characterizes the degree of degradation of the current weak network environment. The dynamic fault tolerance coefficient is constrained to a range of 1 to 5 times; a larger value indicates a higher degree of network degradation and the need to reserve more margin for waiting. This numerical range constraint is achieved by adding a scaled and offset sigmoid activation function after the LSTM fully connected output layer.
[0026] The model training process employs supervised learning, using the actual rendering timeout multiples in historical scenarios as label data and the mean squared error as the loss function. The model parameters are iteratively updated using a backpropagation algorithm until the prediction error on the validation set converges to an acceptable range. The collection and labeling process for the actual rendering timeout multiples label data specifically involves: the control engine running in a test network topology beforehand, simulating different levels of network degradation by artificially injecting packet loss and latency jitter streams; recording the maximum critical timeout value that allows the target page to successfully trigger a loading completion event under each condition; dividing the maximum critical timeout value by the standard baseline response time in an absolutely smooth network environment, and calculating the quotient as the actual rendering timeout multiple label for that network condition sample, which is then paired with a synchronously collected multi-dimensional temporal feature matrix to form a sample pair, and stored together in the training dataset.
[0027] Finally, the dynamic fault tolerance coefficient is multiplied by the pre-set baseline response time to obtain the upper limit of the waiting time for the current localization task. The baseline response time is a standardized reference value determined based on the statistical average of the historical rendering time data of the target page, representing the time required to complete page loading under normal network conditions. The upper limit of the waiting time is the maximum total waiting time allowed by the control engine when performing node localization detection; exceeding this limit indicates that the current localization task has timed out and failed.
[0028] This invention introduces a Long Short-Term Memory (LSTM) network to extrapolate trends in multi-dimensional temporal features, enabling the upper limit of waiting time to be dynamically adjusted according to fluctuations in the real-time network status. It automatically extends the tolerance window when network latency increases significantly and proactively tightens the waiting boundary when the network status is normal, achieving refined management of resource consumption. Furthermore, by incorporating historical rendering time data into the predictive feature system, the model not only perceives the instantaneous quality of the current communication link but also performs personalized predictions based on the loading behavior patterns of specific pages, further improving the accuracy and reliability of the waiting time upper limit estimation and providing a scientifically reasonable time boundary constraint for subsequent positioning and detection processes.
[0029] Preferably, the steps for monitoring the internal mounting status, visual visibility status, and layout stability status of the target node include: In the initial stage of the detection mission, an initial detection cycle is set, a set of node tree objects is obtained, and target node matching is performed based on the set of node tree objects. When the matching result is empty, detection failure event record data is generated. The cumulative occurrence count of the detection failure event record data is extracted, and the cumulative occurrence count is substituted into the exponential decay function for calculation. The extended detection time interval data for the next round is output, forming a nonlinear backoff detection frequency from dense to sparse. During each probe, extract the document tree node attributes, computed style sheet attributes, and rendering repaint event marker data of the currently traversed node; output true / false boolean values for the internal mounting state based on the document tree node attributes, output true / false boolean values for the visually visible state based on the computed style sheet attributes, and output true / false boolean values for the layout stable state based on the rendering repaint event marker data.
[0030] During the initial detection phase, based on pre-configured target node descriptions, and using the initial detection period as the interval for the first round of detection, a node tree traversal instruction is sent to the page runtime environment to obtain the complete set of node tree objects for the current page. The node tree object set refers to the collection of all node objects organized in memory as a tree-like data structure. Each node object corresponds to a structural unit in the page, containing all attribute fields and internal references of that node. Based on the unique identifier attribute or hierarchical path description of the target node, the system performs a depth-first traversal matching operation in the node tree object set to attempt to locate the target node object.
[0031] When the matching result of the current traversal is empty, meaning the target node cannot be found in the node tree, a detection failure event record is generated and written to a local counter. This counter records the cumulative number of detection failures since the current positioning task started. The cumulative number of failures is extracted and substituted into an exponential decay function to calculate the time interval for the next round of detection. The core logic of the exponential decay function is that the interval between the next round of detection is equal to the product of the initial detection period and the power of the cumulative number of failures, forming a non-linear backoff detection frequency that decreases from dense to sparse. This design is based on the following: in the early stages of detection, the target node is close to the ready state, so frequent detection with shorter intervals is appropriate to reduce response latency; as the number of failures increases, it indicates that the current page loading progress is slow, and continuous high-frequency detection will cause unnecessary consumption of computing resources. By gradually increasing the interval, a dynamic balance can be achieved between waiting accuracy and resource consumption. After the backoff interval is calculated, the system enters a sleep state, waiting for the specified interval before starting the next round of detection, repeating this process until the upper limit of the waiting time is exhausted.
[0032] For example, the formula for the exponential decay function is: ; in, This is the time interval for the next round of detection; This is the initial detection period, i.e., the reference time parameter; The preset base of the backoff constant is usually set to 2; Total number of failed detections.
[0033] Once the current traversal is successful and the target node object is located in the node tree object set, three parallel state detection operations are performed on the node object to obtain three independent Boolean state values.
[0034] The first check is to obtain the internal mount status. It reads the target node's document tree node attributes, specifically the node's actual mount connection status flag within the document tree. This flag indicates whether the target node has been formally inserted into the active node hierarchy of the document tree. If the node exists as a valid child node in the active node hierarchy, a true boolean value is output; otherwise, a false boolean value is output. The significance of the internal mount status lies in confirming that the target node has completed the write operation from the dynamic rendering script to the document tree structure, serving as a fundamental condition for determining node data accessibility.
[0035] The second detection step is to obtain the visual visibility status. The runtime environment's computed style query interface is invoked to extract the actual computed style sheet properties that are in effect for the target node, specifically checking the calculated values of the node's display type and visibility properties. Computed style sheet properties differ from inline styles; they are the actual rendered style values calculated by the browser after comprehensively considering style rules from all sources. If the calculated display type property indicates that the node does not participate in any rendering box model generation, or the visibility property indicates that the node is hidden, the visual visibility status is output as a false boolean value; otherwise, a true boolean value is output.
[0036] The third check is to determine the layout stability. This involves monitoring rendering repaint events generated by the page runtime environment to determine if the local rendering area of the target node is still in a state of continuous change. A rendering repaint event refers to the layout recalculation process triggered by changes in the geometric or display properties of a node. If this event continues to occur within the most recent check window, it indicates that the target node's layout is not yet stable, and a false Boolean value is output; if no new repaint events occur within the check window, a true Boolean value is output. The Boolean values obtained from the three checks are comprehensively evaluated, and the subsequent process logic determines whether to continue waiting, trigger a degradation process, or enter the normal interaction preparation stage.
[0037] This invention resolves the inherent trade-off between resource consumption and response latency in traditional fixed-frequency polling by employing a synergistic design of a nonlinear exponential backoff probing mechanism and a three-dimensional parallel node state detection mechanism. The exponential backoff strategy automatically reduces the probing frequency as the cumulative number of failures increases, significantly reducing the computational resource consumption of invalid polling operations during long page loading scenarios. The three-dimensional parallel state detection integrates three independent but logically related evaluation dimensions—internal data structure mounting state, visual presentation capability state, and layout stability state—into a unified detection framework, avoiding the misjudgment risks associated with traditional methods that rely solely on single visual coordinate features for state assessment.
[0038] Preferably, the steps for extracting node data from the internal mount state include: Get the network resource request event queue and extract the network request time data of cascading stylesheet files in the queue; When the network request timeout exceeds the preset style loading warning threshold, a timeout failure instruction for visual rendering engine crash is generated; based on the timeout failure instruction, the absolute pixel horizontal and vertical coordinate weights, relative width feature weights and relative height feature weights of the target node are forcibly set to zero, and the geometric size feature weights are stripped. After the stripping operation is completed, the node data in the internal mounting state is extracted from the internal storage space. The node data includes the hypertext markup language tag character data carried by the target node itself, the business text string data nested inside the node, and the business identification attribute data.
[0039] Continuously monitor the network resource request event queue generated by the page runtime environment. The network resource request event queue is a record of the event sequence of requests and responses made by the browser runtime environment to all external resources during page loading. Each record contains information such as the resource's Uniform Resource Locator (URI), resource type identifier, request initiation timestamp, and response reception timestamp. Entries with the resource type identifier "Cascading Style Sheets" (CSS) are selected from this queue, and the time elapsed from request initiation to response reception for each entry is calculated to form the CSS network request time data.
[0040] Cascading style sheets (CSS) files are the core data source for page layout engines to calculate node geometry and spatial coordinates. When the loading time of this file exceeds the preset style loading warning threshold, it indicates that the layout engine will be unable to complete the calculation of node geometric attributes due to a lack of necessary style data. In this case, continuing to rely on geometric coordinate features for node positioning will inevitably lead to positioning failure. The preset style loading warning threshold is configured based on the average loading time of style sheets for the target page under historical normal network conditions, and is usually set to 1 to 3 times this average to retain an appropriate margin of error.
[0041] When the comparison results confirm that the loading time of the Cascading Style Sheets (CSS) file exceeds the style loading warning threshold, a timeout failure instruction is generated to crash the visual rendering engine. The core semantics of this instruction are: in the subsequent processes of this localization task, all geometric feature data relying on the output of the visual layout engine are considered invalid, and the dependency path on geometric coordinates should be completely bypassed. Based on the timeout failure instruction, a forced zeroing operation is performed on the geometric dimension feature weights of the target node in the current node localization state, forcibly setting the absolute pixel horizontal coordinate weight, absolute pixel vertical coordinate weight, relative width feature weight, and relative height feature weight to zero. These four weight values participate in the calculation and verification of the node's spatial position in the normal localization process. After setting them to zero, subsequent node matching algorithms will no longer attempt to extract valid data from these dimensions, thereby avoiding null pointer exceptions and program crashes caused by missing geometric data.
[0042] After stripping away the geometric dimension feature weights, the process shifts to the target node's internal storage space to extract purely semantic node data unrelated to visual rendering. Specifically, three types of data are extracted: First, Hypertext Markup Language (HTML) tag character data, i.e., the tag name string corresponding to the target node in the document source code, reflecting the node's basic semantic category; second, nested business text string data within the node, i.e., the actual business character sequence stored in the target node's text content nodes, which often possesses business uniqueness or high recognizability; and third, business identification attribute data, i.e., attribute values actively assigned to the target node by developers for unique identification when writing the page. These attributes are independent of visual layout logic and remain intact and valid even when the layout engine fails. These three types of node data collectively constitute the target node's internal semantic data set, serving as the foundational input for the subsequent degradation anchoring process.
[0043] This invention, by accurately monitoring the loading time of Cascading Style Sheets (CSS) files and comparing it in real time with warning thresholds, proactively triggers a degradation switch before geometric features become officially invalid, rather than passively waiting for a crash, thus enabling the entire positioning chain to have proactive disaster recovery capabilities. The operation of forcibly setting the geometric dimension weights to zero cuts off the subsequent algorithm's access path to invalid coordinate data, ensuring data security. It then extracts internal semantic data such as Hypertext Markup Language (HTML) tags, business text, and business identifier attributes, providing reliable semantic feature input for the subsequent degradation anchoring algorithm based on graph structure similarity matching. This allows for accurate positioning even when the page visual layout collapses, thanks to the inherent semantic information of the nodes.
[0044] Preferably, the steps for downgrading and anchoring the target node are as follows: Figure 2 As shown, it specifically includes: Based on the extracted node data, an undirected graph vertex set data with attribute weights is generated; the ancestor node traversal path data of the target node is obtained by tracing upwards, and the sibling arrangement order data of its child nodes is parsed downwards. The ancestor node traversal path data and sibling arrangement order data are transformed into an undirected graph edge set data representing the hierarchical topology. By concatenating the vertex set data and edge set data of the undirected graph, an undirected graph data structure representing the incomplete rendering structure of the page is constructed; the construction of the undirected graph data structure is as follows: Figure 3 As shown; Extract the pre-configured target node standard topology template graph structure data, input the undirected graph data structure and the standard topology template graph structure data into the maximum subgraph isomorphic matching algorithm to calculate the graph structure similarity, and output the highest similarity score data; when the highest similarity score data exceeds the preset topology fault tolerance threshold, use the virtual memory handle corresponding to the successfully matched vertex set as the output result, and complete the downgrade anchoring of the target node without visual assistance.
[0045] Based on the extracted semantic data set within the target node, weights are sequentially assigned to Hypertext Markup Language (HML) tag character data, business text string data, and business identifier attribute data, generating an undirected graph vertex set with attribute weights. The assignment logic for attribute weights is determined based on the contribution of each type of data to the node's unique descriptive ability: business identifier attribute data, possessing unique identifier semantics actively assigned by developers, receives the highest weight for its corresponding vertex; business text string data, directly related to specific business content, typically has strong distinguishing ability and receives the second highest weight; HML tag character data, reflecting only the node's general semantic category, has relatively low distinguishability and receives a basic weight. Each data item corresponds to a vertex in the undirected graph, and the vertex's attribute vector contains three fields: data type identifier, data content hash value, and weight value.
[0046] After generating the vertex set, a bidirectional traversal of the hierarchical structure of the target node is performed to construct the edge set data. In the upward tracing direction, starting from the target node, the parent-child hierarchy of the document tree is traced layer by layer upwards, recording the label names and level depths of all ancestor nodes traversed, forming ancestor node traversal path data. In the downward parsing direction, for each child node of the target node, its position index in the list of all child nodes of its parent node is counted, forming sibling arrangement order data. The above path data and arrangement order data together describe the hierarchical topology of the target node in the document tree, transforming it into an undirected graph edge set data. The two endpoints of each edge correspond to the related node vertices, and the edge attributes record the hierarchical direction and association strength information.
[0047] By concatenating and merging the vertex set data and edge set data of the undirected graph, a complete undirected graph data structure is constructed. This undirected graph is a graphical abstraction of the incomplete rendering structure of the current page when the cascading style sheets fail to load. It preserves the semantic attributes and hierarchical topological relationships of the page nodes, while shielding the geometric coordinate information that depends on the visual layout engine.
[0048] The standard topology template graph structure data of the target node is extracted from the pre-configured template database. The standard topology template graph is a reference graph structure that is collected, serialized, and stored by an automated configuration tool during normal page rendering. Its vertex and edge attribute definitions are consistent with the undirected graph built at runtime, serving as the comparison benchmark for the degradation anchoring algorithm.
[0049] The undirected graph data structure built at runtime and the standard topological template graph structure data are simultaneously input into the maximum subgraph isomorphic matching algorithm to calculate the graph structure similarity. The goal of the maximum subgraph isomorphic matching algorithm is to find node mapping relationships between two graph structures that maximize the product of the sum of attribute similarities of corresponding node pairs after mapping and the matching degree of the corresponding edge structure. The algorithm scores the vertex similarity based on attribute weights from the candidate mapping pair set, verifies the preservation of edge structure under mapping, traverses the space of possible mapping schemes through a backtracking search strategy, and finally outputs the node mapping scheme that maximizes the comprehensive similarity score and the corresponding highest similarity score data.
[0050] To meet the low-latency requirements of browser automation scenarios, this embodiment introduces a heuristic pruning strategy based on vertex attribute weights during the backtracking search process: When calculating graph structure similarity, it prioritizes starting from the vertex with the highest attribute weight (corresponding to business identifier attribute data) in the standard topology template graph, and filters candidate vertices with consistent data type identifiers in the real-time undirected graph data structure; the candidate vertices are sorted in descending order of their single-vertex comprehensive similarity scores, and branches with scores higher than a preset pruning threshold are expanded first. The pruning threshold is set as a fixed proportion (e.g., 80%) of the score of the currently found optimal mapping scheme. Through this heuristic pruning strategy, the actual search space of the backtracking search is significantly reduced.
[0051] Specifically, for the pairs of vertices to be matched in the real-time undirected graph data structure and the standard topology template graph structure, the data type identifiers of the two are first compared. If the type identifiers are inconsistent, the similarity score is directly determined to be zero. If the type identifiers are consistent, the string edit distance algorithm is called to calculate the inverse of the edit distance of the hypertext markup language tag character data, business text string data, and business identifier attribute data of the two, respectively, to obtain three basic similarity ratios. The three basic similarity ratios are multiplied by preset weight values and summed. The weights are determined based on the hierarchical logic of the ability of various semantic feature data to distinguish the unique identity of nodes, and are empirically assigned by combining the cross-validation results of historical page samples to ensure that the sum of the three weights is 1. The output value is the comprehensive similarity score of a single vertex.
[0052] The highest similarity score is compared with a preset topology tolerance threshold. The topology tolerance threshold is set based on the lowest similarity lower bound that allows for reliable identification of a node's identity while allowing some of the target node's child nodes to be ready due to dynamic page loading. When the highest similarity score exceeds the topology tolerance threshold, the graph isomorphic matching is confirmed as successful, and the virtual memory handle of the target node corresponding to the successfully matched vertex set is directly used as the output result.
[0053] A virtual memory handle is a memory address reference allocated by the runtime environment for each document node object. Through this handle, all internal properties and methods of the node object can be directly accessed without relying on any geometric coordinates for spatial positioning, thus completing degraded anchoring without visual assistance.
[0054] This invention introduces undirected graph modeling and the maximum subgraph isomorphic matching algorithm from graph theory into the field of automated page localization, achieving the ability to accurately anchor nodes based solely on semantic topological information even when the page's visual structure fails. By abstracting the semantic attributes of nodes into weighted vertices and the hierarchical relationships into edge structures, the undirected graph data structure can completely preserve the intrinsic identity characteristics and structural context information of nodes while shielding them from all visual geometric noise. Furthermore, the topological fault-tolerance threshold mechanism provides a quantifiable and adjustable confidence control method for matching decisions, which can be flexibly adjusted according to different business requirements for localization accuracy and recall.
[0055] Furthermore, the steps of inputting the undirected graph data structure and the standard topology template graph structure data into the maximum subgraph isomorphic matching algorithm for graph structure similarity calculation include: extracting the sibling arrangement order data of the node pairs to be matched in the two graph structures; if it is determined that the sibling arrangement order data is inconsistent, instead of directly rejecting it, the local graph topology editing distance calculation is initiated; calculating the minimum number of operation steps required to transform the undirected graph data structure into the standard topology template graph structure through vertex insertion and vertex deletion operations; converting the minimum number of operation steps into a topology penalty score, deducting the topology penalty score from the basic score of node semantic attribute similarity, and obtaining the final highest similarity score data.
[0056] Modern business web pages commonly employ front-end engineering frameworks for dynamic compilation and packaging. When the automated engine executes degradation anchoring, a problem arises: even if the business content remains unchanged, the page's node tree structure can randomly mutate due to the framework's dynamic rendering. For example, several semantically meaningless, transparent wrapper nodes might be randomly inserted above the target node for layout purposes. This causes the undirected graph data structure constructed in this example to differ from the pre-recorded standard topology template graph in terms of hierarchical depth and sibling order, rendering traditional rigid graph isomorphic matching algorithms instantly ineffective.
[0057] In this embodiment, the maximum subgraph isomorphic matching algorithm has been flexibly modified. When comparing the real-time undirected graph with the standard template graph, if the algorithm finds that there are unknown nodes between the parent and child levels of the target node, or that the order of sibling nodes has shifted, it no longer directly discards the matching scheme, but instead activates the local graph topology editing distance calculation engine. This engine treats extra nodes without semantic wrapping as insertion anomalies and missing nodes as deletion anomalies. The system uses a dynamic programming algorithm to calculate the minimum number of structural operation steps required to repair the current incomplete and mutated real-time graph structure into the standard template graph structure step by step. Each additional operation step represents a certain degree of structural mutation. After normalizing the minimum number of operation steps, it is converted into a topology penalty score. Subsequently, the topology penalty score is deducted from the original text semantics and business identifier matching score of the node. As long as the core business text and identifier of the target node are unique enough, its base score, after deducting a small amount of penalty points, can still exceed the topology fault tolerance threshold, thus being successfully anchored.
[0058] This invention enhances the robustness of the topology degradation anchoring algorithm against modern dynamic web page frameworks. By introducing graph topology edit distance calculation as a flexible buffer mechanism, the automated control engine gains the ability to tolerate non-destructive random mutations in the page node tree structure. This allows the system to penetrate the redundant structural fog and lock the virtual memory handle of the target object even under the severe double blow of layout style failure and dynamic wrapping of node levels, reducing the maintenance and update frequency of automated scripts.
[0059] Preferably, the steps for constructing a secure interaction boundary include: Based on the virtual memory handle of the target node obtained by the downgrade anchoring, trace upwards layer by layer along the hierarchical structure of the page node tree to detect the rendering completion flag data of each parent container node in the path. When the first parent structure containing the rendering completion flag is identified, it is determined to be the nearest ancestor node container that has completed layout rendering; the underlying window interface is called to extract the physical horizontal coordinate data, physical vertical coordinate data, and container display width and height data of the nearest ancestor node container on the two-dimensional screen, and merge them into a reference coordinate system; Extract the expected maximum displacement tolerance value of the current local node block, perform spatial expansion calculation based on the reference coordinate system and the maximum displacement tolerance value, calculate a dynamically changing set of coordinate points of a closed polygon in the screen coordinate matrix, and output the set of coordinate points of the closed polygon as a safe interactive boundary that limits the drift of local nodes.
[0060] Starting with the virtual memory handle of the target node obtained through the downgrade anchoring operation, an upward traversal is initiated along the hierarchical structure of the page node tree. The traversal is implemented as follows: starting from the memory object corresponding to the target node, the parent container node reference of the current node is repeatedly accessed. Upon reaching a new parent container node, the rendering completion flag data maintained internally by that node object is read. The rendering completion flag is a boolean state field written to the node object by the page runtime environment after completing the parsing of all child content, style calculation, and initial layout drawing. Its true value indicates that the internal rendering pipeline of the container node has completed at least one complete layout drawing cycle, and its output physical coordinate data has reference validity.
[0061] When a parent container node containing the truth value of the rendering completion flag is first identified during the upward tracing process, that node is confirmed as the nearest ancestor node container that has completed layout rendering. The reason for choosing the nearest ancestor node container instead of a higher-level container is that the nearest ancestor node is spatially closest to the target node, has the most direct hierarchical relationship, and its physical coordinates can provide the most accurate reference benchmark for the local area where the target node is located. At the same time, it minimizes the risk of introducing redundant expansion space due to the excessive size of higher-level containers.
[0062] After identifying the nearest ancestor node container, the underlying window interface is invoked to query its physical coordinates. This underlying window interface bypasses the layout engine's global coordinate calculation pipeline and directly requests the current position data of the specified node object in the device's physical screen pixel coordinate system from the operating system's graphics subsystem. The query result contains four values: the physical x-coordinate is the horizontal pixel position of the left boundary of the container rectangle in the screen coordinate system; the physical y-coordinate is the vertical pixel position of the top boundary of the container rectangle in the screen coordinate system; the container display width is the horizontal pixel span of the container rectangle; and the container display height is the vertical pixel span of the container rectangle. These values are then converted into a reference coordinate system, which uses the top-left pixel coordinates of the nearest ancestor node container as its origin and its width and height as its boundaries, describing the local spatial reference frame of the target node.
[0063] The expected maximum displacement tolerance value of the current local node block is extracted from a pre-configured node behavior feature library. The expected maximum displacement tolerance value describes the estimated maximum positional offset that the local node block containing the target node may experience during continuous page loading due to subsequent resource injection, dynamic content rendering, or layout reordering, expressed in screen pixels. This value is derived from historical layout change data of the target page and reflects the layout stability characteristics of the local area.
[0064] Specifically, in a sandbox testing environment, the control engine extracts the set of physical coordinate trajectories of the center points of the local node blocks during historical normal loading; calculates the Euclidean distance of each coordinate point in the set of physical coordinate trajectories relative to the initial stable rendering position, and filters out the maximum displacement extreme value from the set of Euclidean distances; multiplies the maximum displacement extreme value by a preset elastic safety factor of 1.2 to 1.5 times, and the calculated product value is encapsulated as the expected maximum displacement tolerance value, thereby providing a precise quantitative boundary basis for the expansion of the safe interaction boundary. The elastic safety factor range is determined based on the statistical confidence interval of historical rendering offset data and cross-testing with engineering experience, aiming to cover unknown extreme rendering disturbances while preventing excessive expansion of the safety boundary from causing accidental triggering of adjacent business nodes.
[0065] Based on a reference coordinate system and the maximum displacement tolerance value, a spatial expansion operation is performed. Specifically, using the rectangular region of the nearest ancestor node container described by the reference coordinate system as the base shape, the rectangle is expanded in four directions—upward, downward, leftward, and right—by the pixel distance corresponding to the expected maximum displacement tolerance value, forming a closed rectangular region that has been uniformly expanded outward from the original rectangle. The pixel coordinates of the four vertex corners of this closed region are extracted sequentially to generate a set of coordinate points for a closed polygon; this set constitutes the safe interaction boundary. The physical meaning of the safe interaction boundary is: if the target node is displaced during continuous dynamic page loading, as long as its displacement does not exceed the maximum displacement tolerance value, the physical rendering coordinates of the target node will inevitably fall within the area enclosed by this safe interaction boundary, and it can be considered to be in a reliable interaction state.
[0066] This invention constructs a dynamic, safe interaction boundary based on the nearest ancestor node container, providing a quantifiable spatial safety criterion for performing interactive operations before the page is fully loaded. This effectively solves the efficiency bottleneck problem caused by traditional methods that require waiting for global loading to complete before interaction can be performed. The strategy of tracing the most recently rendered ancestor node container balances positioning accuracy and usability: it ensures that the reference coordinates have real physical meaning while limiting the reference range to the local area most relevant to the target node, avoiding interference from global layout changes on local judgments.
[0067] Preferably, the steps for performing interactive operations in advance include: extracting the overall macro-level loading event state data of the webpage, comparing and confirming that it is currently in a state of incomplete loading due to image resources and / or cross-domain scripts being blocked and suspended; capturing the instantaneous physical rendering coordinate data generated by the nearest ancestor node container during the layout redrawing process; performing spatial position intersection comparison calculation between the instantaneous physical rendering coordinate data and the set of coordinate points of the closed polygon of the safe interaction boundary; and outputting a non-escape judgment instruction when it is determined that the instantaneous physical rendering coordinate data falls inside the set of coordinate points of the closed polygon. Based on the non-escape judgment instruction, bypassing the blocking and interception mechanism of the global page loading completion event, the generated automated click signal instruction and character filling data packet are extracted and injected into the virtual memory handle corresponding to the target node, thus triggering the interactive response of the business system in advance before the page visual layout is completed.
[0068] Extract macro-level loading event state data for the entire webpage. This data is a set of state markers generated by the page runtime environment at different stages of the resource loading lifecycle, including multiple independent dimensions such as document structure parsing completion, style resource loading completion, image resource loading completion, and cross-domain script resource loading completion. By comparing these state markers, it is determined whether the current page is in a partially ready state where the document structure has been parsed but image resources or cross-domain script resources have not yet been fully loaded. This state determination is based on the following criteria: image resource loading does not affect the semantic structure of the page node tree or the business logic interaction capabilities; cross-domain script resources in typical business systems are usually third-party statistics or advertising services, and their incomplete loading does not affect the interactive functions of core business nodes. Therefore, in the state where the above resources have not been fully loaded but the target business nodes are ready, there is a prerequisite for safely executing interactive operations in advance.
[0069] After confirming the page is in a partially ready state, the underlying mutation observer component is started and attached to the nearest ancestor node container object. The mutation observer component is an asynchronous node state monitoring mechanism provided by the page runtime environment. It can continuously monitor changes in the document tree structure, attributes, or rendering state of the target node and its subtrees without blocking the main thread. Whenever the layout attributes of the nearest ancestor node container change and trigger a redraw, the mutation observer component immediately notifies the system via a callback mechanism and simultaneously calls the underlying viewport coordinate query interface to retrieve the instantaneous physical rendering coordinate data of the container at the current redraw moment. The instantaneous physical rendering coordinate data contains the real-time position value of the container's rectangular area in the screen pixel coordinate system, reflecting the container's latest spatial position in the current layout state.
[0070] The system performs spatial intersection comparison calculations between the captured instantaneous physically rendered coordinate data and the set of coordinate points of the closed polygon within the constructed safe interaction boundary. The algorithm for spatial intersection comparison determines whether a point is inside the polygon using a ray casting method: a ray is emitted from the instantaneous coordinate point in any fixed direction, and the number of intersections between this ray and each side of the closed polygon is counted. If the number of intersections is odd, the coordinate point is determined to be inside the polygon; if the number of intersections is even, it is determined to be outside. When the instantaneous physically rendered coordinate data falls within the internal region enclosed by the set of coordinate points of the closed polygon, the system outputs a "no escape" judgment command, indicating that the target node is currently within the safe interaction boundary, its displacement amplitude has not exceeded the expected maximum displacement tolerance range, and it possesses the spatial safety conditions for executing the interaction operation in advance.
[0071] Upon receiving the non-escape judgment instruction, an early interaction injection operation is performed. Pre-generated automated click signal instructions and character fill data packets are extracted from the instruction configuration data packet of this automation task. The automated click signal instruction is a programmatic simulation signal of the user's mouse click operation, containing a click event type identifier and trigger flag data; the character fill data packet is a programmatic simulation data sequence of the user's keyboard input operation, containing the input content string and input event sequence identifier. These instructions and data packets are injected directly into the virtual memory handle corresponding to the target node, bypassing the blocking interception mechanism of the global page load completion event. The blocking interception mechanism of the global page load completion event is a global wait logic built into traditional automation control frameworks to ensure interaction security, requiring all interactive operations to be executed only after the page triggers the global load completion event. By injecting interactive signals directly into the target node object through the virtual memory handle, this global wait logic is bypassed, triggering the interactive response of the business system before the page visual layout is finalized, completing the early interactive operation on the target node.
[0072] This invention, through the collaborative operation of a mutation observer component and a secure interaction boundary space comparison mechanism, enables the secure pre-execution of interactive operations on specific business nodes before the global page has finished loading. This provides a technical guarantee for shortening the business execution latency of automated control systems in weak network environments. The asynchronous event-driven mechanism of the mutation observer component avoids the blocking of the main thread by the traditional synchronous polling method, enabling the instantaneous coordinate capture operation to achieve real-time perception of node position changes with minimal computational overhead, significantly improving the overall execution efficiency of the automated system under harsh network conditions.
[0073] Example 2: This invention proposes a method for dynamic positioning of page elements based on an adaptive waiting strategy, comprising: Extract latency jitter data from the transmission protocol and combine it with the historical loading characteristics of the target page to input into the time-series prediction network model, and output the upper limit of the waiting time for the current localization task; Within the waiting time limit, a non-linear backoff detection frequency, from dense to sparse, is used to continuously monitor the internal mounting status, visual visibility status, and layout stability status of the target node in the page node tree. When the target node's internal mounting state is ready, but the visual visibility and layout stability assessments fail due to a timeout in loading the Cascading Style Sheets file, the geometric size feature weights of the target node are stripped, and the node data in the internal mounting state is extracted. An undirected graph data structure is constructed based on the internal semantic attributes and hierarchical association topology of the page node tree, and the target node is downgraded and anchored. When the target node is downgraded and anchored, and the local node block it belongs to has been mounted to the page node tree, the nearest ancestor node container that has completed the layout rendering is traced back as a reference, and a safe interaction boundary is constructed around the local node block where the target node is located; before the overall web page resources are fully loaded, the interaction operation is performed on the target node that has not escaped the safe interaction boundary in advance.
[0074] Furthermore, the time-series prediction network model also employs a dual-path cross-attention structure; it extracts application layer round-trip delay state data to construct a network link sequence input to the first long short-term memory network path; it extracts the backlog length data of the main thread macro task queue in the page runtime environment to construct a computing power blocking sequence input to the second long short-term memory network path; it obtains the first hidden state feature vector and the second hidden state feature vector respectively; it uses the first hidden state feature vector as a query feature and the second hidden state feature vector as a key-value feature and a numerical feature, inputs them to the cross-attention mechanism layer for fusion scoring calculation, and outputs a fusion environment state feature vector; based on the fusion environment state feature vector, it deduces and outputs the dynamic fault tolerance coefficient through a fully connected layer.
[0075] It should be noted that the single LSTM path described in Example 1, which uses network quality features and historical rendering time data as input, is the basic implementation of the temporal prediction network model of this invention when only network-side monitoring data can be obtained. The following describes an extended implementation of the temporal prediction network model—a dual-path cross-attention structure—when the deployment environment simultaneously supports obtaining device-side computing power status data.
[0076] Automated control tasks not only face severe fluctuations in the external network but also the challenge of insufficient computing power in the central processing units of older equipment. Traditional single-series time-series models only input network quality characteristics and cannot detect internal device lag. When receiving large amounts of complex business data, although network transmission is complete, the device's browser main thread may enter a prolonged state of apparent freeze due to parsing heavy tasks. To address this issue, a dual-stream network architecture was reconstructed for the time-series prediction network model. During system operation, the first detector collects the network round-trip delay sequence of the communication link in real time, reflecting the external transmission quality; the second detector delves into the operating system to capture in real time the number of macro tasks waiting to be executed and the time taken for micro tasks in the browser's main thread, reflecting internal computing power congestion.
[0077] These two sets of sequences are simultaneously fed into two parallel long short-term memory (LSTM) network pathways. The first pathway outputs a first hidden state vector representing the network degradation trend, while the second pathway outputs a second hidden state vector representing the computing power depletion trend. Subsequently, a cross-attention mechanism layer is introduced; specifically, attention weight scores are calculated between network features and computing power features, assigning high weights to time points where network congestion is accompanied by severe computing power lag. After attention-weighted summation, the two different dimensional features are fused into a high-dimensional environmental state feature vector. Finally, a fully connected layer maps this fused feature into a dynamic fault tolerance coefficient. This design allows the system to accurately extend the waiting limit even when the network is smooth but the device appears to be frozen, avoiding false timeouts.
[0078] This invention overcomes the technical blind spot of traditional network prediction models that only focus on external communication indicators, by deeply coupling the internal computing power scheduling state of the operating system with the external network link state. Through a cross-attention mechanism, it can intelligently identify and handle complex working conditions where network fluctuations and device lags occur concurrently, making the derivation of the dynamic fault tolerance coefficient approach the real physical limits of the edge computing environment, and reducing the timeout error rate when executing automated tasks on low-configuration hardware terminals.
[0079] Preferably, the steps for constructing a secure interaction boundary include: Based on the virtual memory handle of the target node obtained by the downgrade anchoring, trace upwards layer by layer along the hierarchical structure of the page node tree to detect the rendering completion flag data of each parent container node in the path. When the first parent structure containing the rendering completion flag is identified, it is determined to be the nearest ancestor node container that has completed layout rendering; the underlying window interface is called to extract the physical horizontal coordinate data, physical vertical coordinate data, and container display width and height data of the nearest ancestor node container on the two-dimensional screen, and merge them into a reference coordinate system; Extract the expected maximum displacement tolerance value of the current local node block, perform spatial expansion calculation based on the reference coordinate system and the maximum displacement tolerance value, calculate a dynamically changing set of coordinate points of a closed polygon in the screen coordinate matrix, and output the set of coordinate points of the closed polygon as a safe interactive boundary that limits the drift of local nodes.
[0080] Furthermore, after calculating a dynamically changing set of coordinate points of a closed polygon in the screen coordinate matrix, the method further includes: calling the runtime environment interface to scan all floating nodes covering the nearest ancestor node container along the depth dimension perpendicular to the screen; extracting the depth stacking order attribute value and screen projection coordinate set of the floating nodes; filtering out interference nodes whose depth stacking order attribute value is greater than the value of the nearest ancestor node container; performing a Boolean difference subtraction operation on the screen projection coordinate set of the interference nodes and the set of coordinate points of the closed polygon, and using the remaining two-dimensional spatial geometry set after the operation as the final safe interaction boundary to limit the drift of local nodes.
[0081] In weak network environments, to prevent accidental user actions, business systems often display a full-screen semi-transparent overlay or data loading prompt during the initial page resource loading phase. At this time, although the nearest ancestor node container has already rendered and expanded outwards to create a safe interaction boundary, this boundary may already be covered by the upper overlay in three-dimensional space. If a click is initiated blindly at coordinates within the safe boundary, the click operation will be intercepted and absorbed by the upper overlay, causing the automated command to fail completely. To solve this spatial occlusion problem, a three-dimensional hierarchical spatial cutting logic is introduced on top of the two-dimensional plane safe boundary. After calculating the basic set of closed polygon coordinates, the control engine immediately sends a ray scanning command to the operating system's underlying layer, scanning all page floating nodes that physically overlap with the closed polygon along a direction perpendicular to the screen display's normal.
[0082] The depth stacking order attribute of each of these floating nodes is read one by one. This attribute determines the layer coverage relationship of the nodes in the vertical direction of the display. Interference nodes with higher stacking levels than their nearest ancestor container are identified through rigorous numerical comparison. Next, the projected coordinate regions of these interference nodes on the screen are extracted, and Boolean difference operations from computational geometry are used to remove the portions obscured by the interference nodes from the original safe closed polygon region. The resulting irregular residual region, after this geometric cutting, serves as the safe interaction boundary.
[0083] This invention combines the depth stacking order attribute of page elements with two-dimensional spatial coordinate calculation, achieving a leap from planar protection to three-dimensional protection. Through Boolean difference subtraction operations, it eliminates the interference of various floating prompts and data overlays commonly encountered during weak network loading, thus ensuring the absolute security and effectiveness of speculative interactive operations and preventing business process disruptions caused by accidental touches on irrelevant layers.
[0084] 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.
Claims
1. A method for dynamic positioning of page elements based on an adaptive waiting strategy, characterized in that, include: Extract latency jitter data from the transmission protocol and combine it with the historical loading characteristics of the target page to input into the time-series prediction network model, and output the upper limit of the waiting time for the current localization task; Within the waiting time limit, a non-linear backoff detection frequency, from dense to sparse, is used to continuously monitor the internal mounting status, visual visibility status, and layout stability status of the target node in the page node tree. When the target node's internal mounting state is ready, but the visual visibility and layout stability assessments fail due to a timeout in loading the Cascading Style Sheets file, the geometric size feature weights of the target node are stripped, and the node data in the internal mounting state is extracted. An undirected graph data structure is constructed based on the internal semantic attributes and hierarchical association topology of the page node tree, and the target node is downgraded and anchored. When the target node is downgraded and anchored, and the local node block it belongs to has been mounted to the page node tree, the nearest ancestor node container that has completed the layout rendering is traced back as a reference, and a safe interaction boundary is constructed around the local node block where the target node is located; before the overall web page resources are fully loaded, the interaction operation is performed on the target node that has not escaped the safe interaction boundary in advance.
2. The method for dynamic positioning of page elements based on an adaptive waiting strategy according to claim 1, characterized in that: The steps to obtain the maximum waiting time for the current location task include: Extract latency jitter data from the Transmission Control Protocol (TCP), including round-trip time (RTT) status data and network throughput status data; based on the RTT status data and network throughput status data, obtain the network quality characteristics of the current communication link; obtain the historical loading characteristics of the target page, specifically historical rendering time data. The network quality features and historical rendering time data are serialized and concatenated to generate a multi-dimensional temporal feature matrix. The multidimensional temporal feature matrix is input into a pre-trained temporal prediction network model to perform trend extrapolation and output a dynamic fault tolerance coefficient that characterizes the degree of degradation of the weak network environment. Based on the product operation of the dynamic fault tolerance coefficient and the baseline response time, the upper limit of the waiting time for the current positioning task is output.
3. The method for dynamic positioning of page elements based on an adaptive waiting strategy according to claim 1, characterized in that: The steps for monitoring the internal mounting status, visual visibility status, and layout stability status of the target node include: In the initial stage of the detection mission, an initial detection cycle is set, a set of node tree objects is obtained, and target node matching is performed based on the set of node tree objects. When the matching result is empty, detection failure event record data is generated. The cumulative occurrence count of the detection failure event record data is extracted, and the cumulative occurrence count is substituted into the exponential decay function for calculation. The extended detection time interval data for the next round is output, forming a nonlinear backoff detection frequency from dense to sparse. During each probe, extract the document tree node attributes, computed style sheet attributes, and rendering repaint event marker data of the currently traversed node; output true / false boolean values for the internal mounting state based on the document tree node attributes, output true / false boolean values for the visually visible state based on the computed style sheet attributes, and output true / false boolean values for the layout stable state based on the rendering repaint event marker data.
4. The method for dynamic positioning of page elements based on an adaptive waiting strategy according to claim 1, characterized in that: The steps for extracting node data from the internal mount state include: Get the network resource request event queue and extract the network request time data of the cascading stylesheet files in the queue; When the network request timeout exceeds the preset style loading warning threshold, a timeout failure instruction for visual rendering engine crash is generated; based on the timeout failure instruction, the absolute pixel horizontal and vertical coordinate weights, relative width feature weights and relative height feature weights of the target node are forcibly set to zero, and the geometric size feature weights are stripped. After the stripping operation is completed, the node data in the internal mounting state is extracted from the internal storage space. The node data includes the hypertext markup language tag character data carried by the target node itself, the business text string data nested inside the node, and the business identification attribute data.
5. The method for dynamic positioning of page elements based on an adaptive waiting strategy according to claim 4, characterized in that: The steps for downgrading and anchoring the target node include: Based on the extracted node data, an undirected graph vertex set data with attribute weights is generated; the ancestor node traversal path data of the target node is obtained by tracing upwards, and the sibling arrangement order data of its child nodes is parsed downwards. The ancestor node traversal path data and sibling arrangement order data are transformed into an undirected graph edge set data representing the hierarchical topology. By concatenating the vertex set data and edge set data of the undirected graph, an undirected graph data structure representing the incomplete rendering structure of the page is obtained. The standard topology template graph structure data of the pre-configured target node is extracted, and the undirected graph data structure and the standard topology template graph structure data are input into the maximum subgraph isomorphism matching algorithm to calculate the graph structure similarity and output the highest similarity score data. When the highest similarity score data exceeds the preset topology fault tolerance threshold, the virtual memory handle corresponding to the successfully matched vertex set is used as the output result to complete the downgrade anchoring of the target node without visual assistance.
6. The method for dynamic positioning of page elements based on an adaptive waiting strategy according to claim 1, characterized in that: The steps to build a secure interaction boundary include: Based on the virtual memory handle of the target node obtained by the downgrade anchoring, trace upwards layer by layer along the hierarchical structure of the page node tree to detect the rendering completion flag data of each parent container node in the path. When the first parent structure containing the rendering completion flag is identified, it is determined to be the nearest ancestor node container that has completed layout rendering; the underlying window interface is called to extract the physical horizontal coordinate data, physical vertical coordinate data, and container display width and height data of the nearest ancestor node container on the two-dimensional screen, and merge them into a reference coordinate system; Extract the expected maximum displacement tolerance value of the current local node block, perform spatial expansion calculation based on the reference coordinate system and the maximum displacement tolerance value, calculate a dynamically changing set of coordinate points of a closed polygon in the screen coordinate matrix, and output the set of coordinate points of the closed polygon as a safe interactive boundary that limits the drift of local nodes.
7. The method for dynamic positioning of page elements based on an adaptive waiting strategy according to claim 1, characterized in that: The steps for performing interactive operations in advance include: Extract macro-level loading event status data of the entire webpage, and compare to confirm that it is currently in a state of incomplete loading due to image resources and / or cross-domain scripts being blocked and suspended; capture the instantaneous physical rendering coordinate data generated by the nearest ancestor node container during the layout redrawing process; perform spatial position intersection comparison calculation between the instantaneous physical rendering coordinate data and the set of coordinate points of the closed polygon of the safe interaction boundary; when it is determined that the instantaneous physical rendering coordinate data falls inside the set of coordinate points of the closed polygon, output a non-escape determination command; Based on the non-escape judgment instruction, bypassing the blocking and interception mechanism of the global page loading completion event, the generated automated click signal instruction and character filling data packet are extracted and injected into the virtual memory handle corresponding to the target node, thus triggering the interactive response of the business system in advance before the page visual layout is completed.