User interface preprocessing method and device based on behavior prediction, storage medium and computer equipment

By monitoring user interaction behavior to generate feature vectors and using pre-trained models for dynamic preprocessing, the problem of user interface response latency is solved, achieving intelligent and efficient interface response speed and resource utilization, thus improving the user experience.

CN122048408APending Publication Date: 2026-05-15CHENGDU MEGAYOU TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHENGDU MEGAYOU TECH CO LTD
Filing Date
2026-01-07
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing technologies lack proactive prediction and dynamic adaptation of users' real-time interaction intentions in user interface optimization, making it difficult to achieve an effective balance between interface response latency and resource consumption and performance gains.

Method used

By listening to user interaction event streams, interaction behavior feature vectors are generated, and pre-trained machine learning models are used to predict interaction behaviors, determine the next interaction component and its confidence level, and dynamically select preprocessing operation types, including pre-rendering, pre-fetching, and priority adjustment.

Benefits of technology

It improves the responsiveness and smoothness of the user interface, while ensuring the intelligent and efficient utilization of system computing and network resources, and reducing development and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122048408A_ABST
    Figure CN122048408A_ABST
Patent Text Reader

Abstract

The invention discloses a user interface preprocessing method and device based on behavior prediction, a storage medium and computer equipment. The method comprises the following steps: monitoring an interaction behavior event flow in a current user interface in a client; generating an interaction behavior feature vector based on the interaction behavior event flow; performing interaction behavior prediction according to the interaction behavior feature vector through a pre-trained machine learning model, and determining a next-step interaction component and a confidence coefficient of the next-step interaction component; and determining a preprocessing operation type of the next-step interaction component according to the confidence coefficient, and executing a preprocessing operation of the next-step interaction component based on the preprocessing operation type. According to the method, the defects of single prediction dimension and extensive resource allocation of the traditional preprocessing technology are overcome, the conversion from static rule driving to dynamic intelligent prediction is realized, and the intelligent and efficient utilization of system calculation and network resources can be ensured while the interface response speed and smoothness can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of user interface optimization technology, and in particular to a user interface preprocessing method, apparatus, storage medium, and computer device based on behavior prediction. Background Technology

[0002] With the continuous development of human-computer interaction technology, users have placed higher demands on the responsiveness and smoothness of software systems. Especially in interactive client applications, interface response latency directly affects user experience and operational efficiency. Traditional interface optimization methods mainly focus on techniques such as resource preloading, caching strategies, and asynchronous rendering. While these methods can improve the speed of interface switching and data loading to some extent, their decisions are often based on static rules or simple historical records, lacking proactive prediction and dynamic adaptation to the user's real-time interaction intentions.

[0003] In existing technologies, preprocessing schemes based on user behavior analysis typically rely on fixed patterns or simple statistics, such as preloading potentially accessed interfaces or data based on frequently visited paths. These methods have significant drawbacks: First, their prediction dimensions are limited, making it difficult to capture the dynamic changes in user interaction intentions and behavioral sequences within the current session. Second, the lack of quantitative evaluation of the reliability of prediction results leads the system to often apply the same preprocessing strategy to all prediction targets, failing to achieve an effective balance between resource consumption and performance gains. Finally, because they fail to transform real-time interactive event streams into feature representations that can be processed by machine learning models, traditional methods struggle to achieve high-precision, personalized interactive behavior prediction.

[0004] Therefore, how to capture user interaction behavior in real time, accurately predict it, and then dynamically select differentiated preprocessing strategies based on the prediction confidence level has become a key challenge to improve interface response performance and achieve intelligent resource scheduling. Summary of the Invention

[0005] In view of this, the embodiments of this application provide a user interface preprocessing method, apparatus, storage medium and computer device based on behavior prediction, which overcomes the shortcomings of traditional preprocessing technology in terms of single prediction dimension and extensive resource allocation, realizes the transformation from static rule-driven to dynamic intelligent prediction, and can ensure the intelligent and efficient utilization of system computing and network resources while improving the interface response speed and smoothness.

[0006] According to one aspect of this application, a user interface preprocessing method based on behavior prediction is provided, the method comprising: Listen for the stream of interactive events within the current user interface of the client; Based on the interactive event stream, an interactive behavior feature vector is generated; The interaction behavior is predicted based on the interaction behavior feature vector using a pre-trained machine learning model, and the next interaction component and the confidence level of the next interaction component are determined. The type of preprocessing operation for the next interaction component is determined based on the confidence level, and the preprocessing operation for the next interaction component is performed based on the type of preprocessing operation.

[0007] Optionally, the event stream of interactive behaviors within the current user interface of the monitoring client includes: Listen to the timing of actions within the current user interface in the client to obtain the timing sequence of interactive actions; If the obtained interactive behavior time sequence is less than or equal to the preset length, then the interactive behavior time sequence is used as an interactive behavior event stream. If the obtained interactive behavior sequence is longer than the preset length, then the nearest interactive behavior sequence of the preset length is selected as the interactive behavior event stream.

[0008] Optionally, generating the interaction behavior feature vector based on the interaction behavior event stream includes: Extract the mouse movement sequence from the interactive event stream to obtain the position of each interactive component element in the current user interface, the current display viewport height corresponding to the current user interface, and the interface height of the current user interface; The average speed, acceleration, and trajectory curvature of the mouse are calculated based on the mouse movement sequence as trajectory dynamics characteristics. Based on the mouse movement sequence and the positions of each interactive component element, the distance between the current mouse position and the positions of each interactive component element, and the duration of mouse dwell on the current hovering element are determined as element association features. Based on the current viewport height and the position of each interactive component element, determine the type of the visible interactive component element within the current viewport, perform multi-hot encoding on the type of the visible interactive component element to obtain a multi-hot encoding vector, determine the interface scroll percentage based on the current viewport height and the interface height, and use the multi-hot encoding vector and the interface scroll percentage as page context features. After normalizing the continuous numerical features in the trajectory dynamics features, the element association features, and the page context features, the processed features are organized into the interaction behavior feature vector.

[0009] Optionally, the step of predicting interactive behavior based on the interactive behavior feature vector using a pre-trained machine learning model, and determining the next interactive component and its confidence level, includes: The interaction behavior is predicted by a pre-trained machine learning model based on the interaction behavior feature vector, so as to predict the next interaction component and the confidence level of triggering the next interaction component among the visible interaction components in the current viewport.

[0010] Optionally, determining the preprocessing operation type for the next interaction component based on the confidence level, and performing the preprocessing operation for the next interaction component based on the preprocessing operation type, includes: If the confidence level is greater than or equal to the first preset threshold, then the preprocessing operation type for the next interactive component is determined to be the pre-rendering type, and the JavaScript object of the next interactive component is instantiated, and the JavaScript object is used to construct and compile a virtual DOM. If the confidence level is less than the first preset threshold and greater than or equal to the second preset threshold, then the preprocessing operation type for the next interaction component is determined to be the pre-acquisition type, and the required data for the next interaction component is acquired and stored in the cache. If the confidence level is less than the second preset threshold, the preprocessing operation type for the next interaction component is determined to be the priority adjustment type, and the resource loading priority of the next interaction component is increased.

[0011] Optionally, the method further includes: Obtain the actual interactive component triggered after the interactive behavior event stream; Training samples are constructed based on the interaction behavior feature vector and the real interaction components, and the machine learning model is iteratively trained.

[0012] Optionally, the machine learning model is obtained by receiving model parameters sent by a server and deploying the model parameters in a local machine learning model; after iteratively training the machine learning model, the method further includes: Periodically obtain the update amount of the model parameters of the machine learning model; The model parameter update is encrypted and uploaded to the server. The server then decrypts and merges the model parameter update data uploaded by multiple clients. Based on the merged model parameter update data, new model parameters are determined and sent to each client. The system receives the new model parameter update amount sent by the server and deploys the new model parameter update amount in the local machine learning model to update the local machine learning model.

[0013] According to another aspect of this application, a user interface preprocessing apparatus based on behavior prediction is provided, the apparatus comprising: The event stream acquisition module is used to listen for the event stream of interactive behaviors within the current user interface in the client. The feature vector generation module is used to generate interactive behavior feature vectors based on the interactive behavior event stream; The behavior prediction module is used to predict interactive behavior based on the interactive behavior feature vector using a pre-trained machine learning model, and to determine the next interactive component and the confidence level of the next interactive component. A preprocessing module is used to determine the preprocessing operation type for the next interaction component based on the confidence level, and to perform the preprocessing operation for the next interaction component based on the preprocessing operation type.

[0014] Optionally, the event stream acquisition module is specifically used for: Listen to the timing of actions within the current user interface in the client to obtain the timing sequence of interactive actions; If the obtained interactive behavior time sequence is less than or equal to the preset length, then the interactive behavior time sequence is used as an interactive behavior event stream. If the obtained interactive behavior sequence is longer than the preset length, then the nearest interactive behavior sequence of the preset length is selected as the interactive behavior event stream.

[0015] Optionally, the feature vector generation module is specifically used for: Extract the mouse movement sequence from the interactive event stream to obtain the position of each interactive component element in the current user interface, the current display viewport height corresponding to the current user interface, and the interface height of the current user interface; The average speed, acceleration, and trajectory curvature of the mouse are calculated based on the mouse movement sequence as trajectory dynamics characteristics. Based on the mouse movement sequence and the positions of each interactive component element, the distance between the current mouse position and the positions of each interactive component element, and the duration of mouse dwell on the current hovering element are determined as element association features. Based on the current viewport height and the position of each interactive component element, determine the type of the visible interactive component element within the current viewport, perform multi-hot encoding on the type of the visible interactive component element to obtain a multi-hot encoding vector, determine the interface scroll percentage based on the current viewport height and the interface height, and use the multi-hot encoding vector and the interface scroll percentage as page context features. After normalizing the continuous numerical features in the trajectory dynamics features, the element association features, and the page context features, the processed features are organized into the interaction behavior feature vector.

[0016] Optionally, the behavior prediction module is specifically used for: The interaction behavior is predicted by a pre-trained machine learning model based on the interaction behavior feature vector, so as to predict the next interaction component and the confidence level of triggering the next interaction component among the visible interaction components in the current viewport.

[0017] Optionally, the preprocessing module is specifically used for: If the confidence level is greater than or equal to the first preset threshold, then the preprocessing operation type for the next interactive component is determined to be the pre-rendering type, and the JavaScript object of the next interactive component is instantiated, and the JavaScript object is used to construct and compile a virtual DOM. If the confidence level is less than the first preset threshold and greater than or equal to the second preset threshold, then the preprocessing operation type for the next interaction component is determined to be the pre-acquisition type, and the required data for the next interaction component is acquired and stored in the cache. If the confidence level is less than the second preset threshold, the preprocessing operation type for the next interaction component is determined to be the priority adjustment type, and the resource loading priority of the next interaction component is increased.

[0018] Optionally, the behavior prediction module is further configured to: Obtain the actual interactive component triggered after the interactive behavior event stream; Training samples are constructed based on the interaction behavior feature vector and the real interaction components, and the machine learning model is iteratively trained.

[0019] Optionally, the machine learning model is obtained by receiving model parameters sent by the server and deploying the model parameters in a local machine learning model; the behavior prediction module is further configured to: Periodically obtain the update amount of the model parameters of the machine learning model; The model parameter update is encrypted and uploaded to the server. The server then decrypts and merges the model parameter update data uploaded by multiple clients. Based on the merged model parameter update data, new model parameters are determined and sent to each client. The system receives the new model parameter update amount sent by the server and deploys the new model parameter update amount in the local machine learning model to update the local machine learning model.

[0020] According to another aspect of this application, a storage medium is provided that stores a computer program thereon, which, when executed by a processor, implements the above-described behavior prediction-based user interface preprocessing method.

[0021] According to another aspect of this application, a computer device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor executes the program to implement the above-described behavior prediction-based user interface preprocessing method.

[0022] By employing the above technical solutions, this application provides a user interface preprocessing method, apparatus, storage medium, and computer device based on behavior prediction. This method monitors user interaction behavior in real time and generates feature vectors. It then uses a pre-trained model to predict the most likely interface component the user will operate on next, along with its confidence level. Based on the confidence level, it performs preprocessing operations of varying depths. This method overcomes the shortcomings of traditional preprocessing techniques, such as single prediction dimensions and inefficient resource allocation. It achieves a shift from static rule-driven to dynamic intelligent prediction, improving interface response speed and smoothness while ensuring intelligent and efficient utilization of system computing and network resources.

[0023] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0024] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 The illustration shows a flowchart of a user interface preprocessing method based on behavior prediction provided in an embodiment of this application; Figure 2 A flowchart illustrating another behavior prediction-based user interface preprocessing method provided in an embodiment of this application is shown. Figure 3 A schematic diagram of the structure of a user interface preprocessing device based on behavior prediction provided in an embodiment of this application is shown; Figure 4 A schematic diagram of the device structure of a computer device provided in an embodiment of this application is shown. Detailed Implementation

[0025] The present application will be described in detail below with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in the embodiments of the present application can be combined with each other.

[0026] This embodiment provides a user interface preprocessing method based on behavior prediction, such as... Figure 1As shown, the method includes: Step 101: Listen to the event stream of interactive behaviors within the current user interface in the client.

[0027] In this embodiment, firstly, after user authorization, the flow of interactive events within the current user interface of the client is monitored. By embedding a listener in the current interface of the client (such as a web browser), all fine-grained interactive events of the user are captured in real time, such as mouse movement trajectory, click position, hover duration, scroll wheel speed, keyboard shortcuts, etc. These events are collected in the form of a continuous "stream," forming the raw data foundation for the user's real-time intentions.

[0028] Optionally, in this embodiment of the application, the monitoring of the interactive behavior event stream within the current user interface of the client includes: monitoring the behavior time within the current user interface of the client to obtain an interactive behavior time sequence; if the obtained interactive behavior time sequence is less than or equal to a preset length, then the interactive behavior time sequence is used as an interactive behavior event stream; if the obtained interactive behavior time sequence is greater than the preset length, then the nearest interactive behavior time sequence of the preset length is extracted as an interactive behavior event stream.

[0029] In this embodiment, user interface behavior is monitored in real time to form a time-series sequence of interactive behaviors. When the sequence length does not exceed a preset threshold, the complete sequence is directly used as the event stream input; when the sequence is too long, the most recent subsequence of a preset length is truncated as the valid event stream. This dynamic truncation mechanism avoids the problem of excessive model computation caused by excessively long sequences, and ensures the timeliness of the prediction model by retaining the latest behavior sequence. For example, in e-commerce applications, when a user browses multiple products continuously, the system only retains the most recent 10 click behaviors as feature input. This filters out the interference of earlier irrelevant operations on the prediction, and shortens the model inference time by controlling the sequence length, achieving a balance between prediction efficiency and accuracy. This design ensures that the data input to subsequent feature generation and prediction models is continuous and complete in the time dimension, and is also of controllable length and focused on the latest behavior. Thus, while retaining the effective context, it avoids the interference of outdated or redundant data on real-time prediction, improving system processing efficiency and prediction timeliness.

[0030] Step 102: Generate an interactive behavior feature vector based on the interactive behavior event stream.

[0031] In this embodiment, an interaction behavior feature vector is generated based on the monitored interaction behavior event stream. The original event stream is unstructured and high-dimensional, and cannot be directly used by the model. This step extracts meaningful features from the event stream using specific algorithms and rules, and organizes them into a structured numerical vector (i.e., feature vector). By extracting key information from the event stream, such as operation type, operation time, and operation location, and combining them into a vector form according to certain rules, these interaction behaviors can be presented in a structured way, facilitating subsequent analysis and prediction by machine learning models.

[0032] Optionally, in this embodiment of the application, generating an interaction behavior feature vector based on the interaction behavior event stream includes: Extract the mouse movement sequence from the interactive event stream to obtain the position of each interactive component element in the current user interface, the current display viewport height corresponding to the current user interface, and the interface height of the current user interface; The average speed, acceleration, and trajectory curvature of the mouse are calculated based on the mouse movement sequence as trajectory dynamics characteristics. Based on the mouse movement sequence and the positions of each interactive component element, the distance between the current mouse position and the positions of each interactive component element, and the duration of mouse dwell on the current hovering element are determined as element association features. Based on the current viewport height and the position of each interactive component element, determine the type of the visible interactive component element within the current viewport, perform multi-hot encoding on the type of the visible interactive component element to obtain a multi-hot encoding vector, determine the interface scroll percentage based on the current viewport height and the interface height, and use the multi-hot encoding vector and the interface scroll percentage as page context features. After normalizing the continuous numerical features in the trajectory dynamics features, the element association features, and the page context features, the processed features are organized into the interaction behavior feature vector.

[0033] In this embodiment, an interactive behavior feature vector is constructed through multi-dimensional feature fusion, specifically including three dimensions: trajectory dynamics features, element association features, and page context features. 1. Trajectory dynamics features, such as speed, acceleration, and curvature: quantify the user's operational agility and intent intensity. Rapid straight-line movement often suggests a clear goal-oriented behavior, while slow, zigzag movement may indicate hesitation or exploration. 2. Element association features, such as distance and dwell time: directly characterize the spatial and temporal relationship between the user's attention and interface components. The closer the distance and the longer the dwell time, the higher the user's attention to or likelihood of operation on that component. 3. Page context features, such as visible element types and scroll percentage: provide information about the static and dynamic environment of the current screen. The distribution of visible element types reflects the composition of currently operable options, while the scroll percentage reveals the user's browsing progress within the page's information structure. All continuous numerical features are normalized and organized into a structured feature vector according to preset dimensions. Among them, trajectory dynamics features reveal the physical laws of user operation habits, element association features capture the real-time interaction between users and components, and page context features provide a global perspective on interface layout. The three are integrated to form a three-dimensional user behavior profile. For example, in game UI scenarios, trajectory curvature can identify whether the user is in a rapid operation state (such as aiming in shooting games), combined with element association features, it can determine whether the user is focusing on a specific button (such as a skill release button), and page context features can identify whether the current viewport contains key interactive components (such as map markers). This multi-dimensional feature combination not only improves the accuracy of behavior prediction, but also ensures the uniformity of feature vectors on the numerical scale through normalization processing, enabling pre-trained models to more efficiently capture the inherent patterns of user behavior, ultimately achieving more accurate pre-processing operation decisions and improving the responsiveness and smoothness of the user interface.

[0034] Step 103: Predict the interaction behavior based on the interaction behavior feature vector using a pre-trained machine learning model, and determine the next interaction component and the confidence level of the next interaction component.

[0035] In this embodiment, a pre-trained machine learning model is used to predict user behavior based on generated interaction behavior feature vectors. The pre-trained machine learning model acts like an experienced user behavior prediction expert; by learning patterns and rules from a large amount of historical interaction data, it can accurately predict the current user's interaction behavior. In this step, the model analyzes the most likely interactive component the user will interact with next based on the input feature vector and provides a confidence level for the prediction, i.e., the accuracy of the prediction. For example, if the model predicts that the user will click the "Buy" button next and gives a high confidence level, it means that the model considers this highly probable.

[0036] In this embodiment of the application, optionally, the step of predicting the interaction behavior based on the interaction behavior feature vector using a pre-trained machine learning model, and determining the next interaction component and the confidence level of the next interaction component, includes: predicting the interaction behavior based on the interaction behavior feature vector using a pre-trained machine learning model, so as to predict the next interaction component and the confidence level of triggering the next interaction component among all visible interaction components in the current viewport.

[0037] In this embodiment, a pre-trained machine learning model is used to predict and analyze the feature vectors of interactive behaviors. Based on a pre-constructed multi-dimensional feature vector (covering trajectory dynamics, element relationships, and page context information), the model makes targeted predictions within the set of visible interactive components in the current user viewport. Since the components that the user can actually operate are limited to the visible elements within the current viewport, limiting the prediction scope to this reduces the model's computational complexity and avoids invalid predictions of invisible components, thus improving prediction efficiency. For example, on a long list page, the user needs to scroll to view all components, but the model only needs to analyze 5-10 visible components (such as product cards, buttons, etc.) within the current viewport, rather than dozens of components across the entire page, reducing computational load. More importantly, by combining contextual features such as the percentage of screen scroll, the model can dynamically perceive the user's browsing progress. When the user scrolls to the bottom of the page, it can predict that they may operate the "Load More" button; when the user lingers on a product card for a long time, it can predict that they may click "View Details." This in-viewport prediction mechanism not only improves prediction accuracy but also provides a reliable basis for subsequent preprocessing operations through confidence quantification (such as continuous values ​​from 0 to 1). By focusing on the core interactive area, the optimal balance between prediction performance and computational efficiency is achieved under resource-constrained conditions.

[0038] Step 104: Determine the preprocessing operation type for the next interaction component based on the confidence level, and perform the preprocessing operation for the next interaction component based on the preprocessing operation type.

[0039] In this embodiment, the type of preprocessing operation for the next interactive component is determined based on the predicted confidence level, and the corresponding preprocessing operation is executed. This step prepares for possible interactive operations in advance based on the prediction results. If the confidence level is high, it indicates that the user is very likely to operate the interactive component next, so more in-depth preprocessing can be performed on the component, such as preloading relevant data and allocating computing resources in advance; if the confidence level is low, some lightweight preprocessing can be performed or no preprocessing can be performed. In this way, the corresponding preparation work can be done in advance before the user actually triggers the interactive operation, thereby improving the response speed and overall performance of the user interface. From the user experience perspective, since the user's next interactive operation can be predicted in advance and the corresponding preprocessing can be performed, the waiting time after the user triggers the operation is shortened. For example, when browsing a webpage, when it is predicted that the user may click on a link to enter the next page, the content of the next page is loaded in advance, and the user can see the page immediately after clicking, avoiding a long loading wait, making the entire interaction process smoother and more natural, and improving user satisfaction. From the perspective of application development and maintenance, this method provides a general user interface optimization solution without requiring large-scale changes to the original architecture of the application. Developers only need to integrate the corresponding listening, feature vector generation, prediction, and preprocessing modules according to the requirements of this method to implement the preprocessing function of the user interface, reducing development costs and maintenance difficulty. Moreover, as machine learning models are continuously optimized and updated, this method can continuously improve the accuracy of prediction and the effect of preprocessing, demonstrating good scalability and adaptability.

[0040] Optionally, in this embodiment of the application, determining the preprocessing operation type for the next interaction component based on the confidence level, and performing the preprocessing operation for the next interaction component based on the preprocessing operation type, includes: If the confidence level is greater than or equal to the first preset threshold, then the preprocessing operation type for the next interactive component is determined to be the pre-rendering type, and the JavaScript object of the next interactive component is instantiated, and the JavaScript object is used to construct and compile a virtual DOM. If the confidence level is less than the first preset threshold and greater than or equal to the second preset threshold, then the preprocessing operation type for the next interaction component is determined to be the pre-acquisition type, and the required data for the next interaction component is acquired and stored in the cache. If the confidence level is less than the second preset threshold, the preprocessing operation type for the next interaction component is determined to be the priority adjustment type, and the resource loading priority of the next interaction component is increased.

[0041] In this embodiment, a dynamic preprocessing strategy is implemented through a confidence level mechanism. Specifically, when the confidence level is ≥ a first preset threshold (e.g., 0.8), a pre-rendering operation is triggered, directly instantiating a JavaScript object and constructing a virtual DOM. Although this operation consumes significant computing resources, by completing the "cold start" phase of component rendering in advance (e.g., React's virtual DOM diff and compilation, but without inserting it into the current Document Object Model (DOM) tree), the rendering time when triggered by the user can be compressed from hundreds of milliseconds to single digits, achieving a "zero-latency" interactive experience. A typical scenario is the "Buy Now" button on an e-commerce platform; pre-rendering under high confidence prediction can avoid loading waits on the payment page. When the confidence level is between the first and second preset thresholds (e.g., 0.5-0.8), a pre-fetching strategy is adopted, storing the data required by the component in the cache. This operation achieves "data preloading" at a relatively low resource cost. For example, in news applications, predicting the image and text details that users may click on allows for pre-downloading of images and text content, avoiding page lag caused by network requests. Experimental data shows... When the confidence level is less than a second preset threshold (e.g., 0.5), priority adjustment is performed, achieving flexible optimization by dynamically increasing the resource loading priority. This hierarchical mechanism achieves a precise match between resource investment and prediction confidence, enabling the system to provide users with near-instantaneous interactive responses when confidence is high, while providing only a slight performance gain for potential operations with minimal overhead when confidence is low. This maximizes a smooth experience with optimal resource cost overall, avoiding the resource waste or insufficient coverage caused by the "one-size-fits-all" preprocessing in traditional solutions.

[0042] By applying the technical solution of this embodiment, user interaction behavior is monitored in real time and feature vectors are generated. A pre-trained model is used to predict the interface components that the user is most likely to operate on next and their confidence levels. Then, preprocessing operations of varying depths are performed based on the confidence levels. This method overcomes the shortcomings of traditional preprocessing techniques, such as single prediction dimensions and extensive resource allocation. It realizes the transformation from static rule-driven to dynamic intelligent prediction, which can improve the interface response speed and smoothness while ensuring the intelligent and efficient utilization of system computing and network resources.

[0043] Furthermore, as a refinement and extension of the specific implementation methods of the above embodiments, and to fully illustrate the specific implementation process of this embodiment, another user interface preprocessing method based on behavior prediction is provided, such as... Figure 2 As shown, the method includes: Step 201: Obtain the actual interactive component triggered after the interactive behavior event stream.

[0044] Step 202: Construct training samples based on the interaction behavior feature vector and the real interaction components, and iteratively train the machine learning model; the machine learning model is obtained by receiving model parameters sent by the server and deploying the model parameters in the local machine learning model.

[0045] Step 203: Periodically obtain the update amount of the model parameters of the machine learning model.

[0046] Step 204: The model parameter update amount is encrypted and uploaded to the server. The server decrypts and merges the model parameter update amounts uploaded by multiple clients. Based on the merged model parameter update amounts, new model parameters are determined and sent to each client.

[0047] Step 205: Receive the new model parameter update amount sent by the server, and deploy the new model parameter update amount in the local machine learning model to update the local machine learning model.

[0048] In this embodiment, the machine learning model can be any of the following: A) Temporal model: A pruned and quantized Long Short-Term Memory (LSTM) network or Gated Recurrent Unit (GRU) model, whose model parameters are pre-trained and converted to ONNX format, then sent from the server to the client, and loaded and executed in the client's WebWorker thread through the ONNX Runtime Web engine; B) Tree model: A Lightweight Gradient Boosting Decision Tree (LightGBM) model, whose model parameters are pre-trained and converted to ONNX format, then sent from the server to the client, and executed through the ONNX Runtime Web engine. Furthermore, based on the core real-time prediction and preprocessing workflow, this embodiment introduces a federated learning mechanism to construct a continuously evolving, privacy-preserving distributed model update system. First, using subsequent real user interactions as annotations, these are combined with previously generated feature vectors to form training samples for supervised incremental training of the local model. Then, the updated model parameters (not the original data) generated during local training are periodically encrypted and uploaded to a central server. After decryption, the server securely aggregates updates from numerous clients, generating improved global model parameters, which are then distributed to each client to update their local models. This approach offers at least the following benefits: First, it enables continuous model personalization and performance optimization, allowing predictions to adapt to different users' operating habits and interface changes. Second, it strictly adheres to privacy protection principles, keeping original interaction data on the client side and only uploading encrypted model parameter updates, reducing the risk of privacy leaks. Third, it leverages collective intelligence to improve the global model, allowing each client to benefit from broader behavioral pattern learning while maintaining good system scalability. This design upgrades isolated single-machine intelligence to co-evolving ecological intelligence, systematically solving the challenge of continuous adaptation and optimization of machine learning models after deployment while protecting user privacy.

[0049] Furthermore, as Figure 1 In terms of specific implementation, this application provides a user interface preprocessing device based on behavior prediction, such as... Figure 3 As shown, the device includes: The event stream acquisition module is used to listen for the event stream of interactive behaviors within the current user interface in the client. The feature vector generation module is used to generate interactive behavior feature vectors based on the interactive behavior event stream; The behavior prediction module is used to predict interactive behavior based on the interactive behavior feature vector using a pre-trained machine learning model, and to determine the next interactive component and the confidence level of the next interactive component. A preprocessing module is used to determine the preprocessing operation type for the next interaction component based on the confidence level, and to perform the preprocessing operation for the next interaction component based on the preprocessing operation type.

[0050] Optionally, the event stream acquisition module is specifically used for: Listen to the timing of actions within the current user interface in the client to obtain the timing sequence of interactive actions; If the obtained interactive behavior time sequence is less than or equal to the preset length, then the interactive behavior time sequence is used as an interactive behavior event stream. If the obtained interactive behavior sequence is longer than the preset length, then the nearest interactive behavior sequence of the preset length is selected as the interactive behavior event stream.

[0051] Optionally, the feature vector generation module is specifically used for: Extract the mouse movement sequence from the interactive event stream to obtain the position of each interactive component element in the current user interface, the current display viewport height corresponding to the current user interface, and the interface height of the current user interface; The average speed, acceleration, and trajectory curvature of the mouse are calculated based on the mouse movement sequence as trajectory dynamics characteristics. Based on the mouse movement sequence and the positions of each interactive component element, the distance between the current mouse position and the positions of each interactive component element, and the duration of mouse dwell on the current hovering element are determined as element association features. Based on the current viewport height and the position of each interactive component element, determine the type of the visible interactive component element within the current viewport, perform multi-hot encoding on the type of the visible interactive component element to obtain a multi-hot encoding vector, determine the interface scroll percentage based on the current viewport height and the interface height, and use the multi-hot encoding vector and the interface scroll percentage as page context features. After normalizing the continuous numerical features in the trajectory dynamics features, the element association features, and the page context features, the processed features are organized into the interaction behavior feature vector.

[0052] Optionally, the behavior prediction module is specifically used for: The interaction behavior is predicted by a pre-trained machine learning model based on the interaction behavior feature vector, so as to predict the next interaction component and the confidence level of triggering the next interaction component among the visible interaction components in the current viewport.

[0053] Optionally, the preprocessing module is specifically used for: If the confidence level is greater than or equal to the first preset threshold, then the preprocessing operation type for the next interactive component is determined to be the pre-rendering type, and the JavaScript object of the next interactive component is instantiated, and the JavaScript object is used to construct and compile a virtual DOM. If the confidence level is less than the first preset threshold and greater than or equal to the second preset threshold, then the preprocessing operation type for the next interaction component is determined to be the pre-acquisition type, and the required data for the next interaction component is acquired and stored in the cache. If the confidence level is less than the second preset threshold, the preprocessing operation type for the next interaction component is determined to be the priority adjustment type, and the resource loading priority of the next interaction component is increased.

[0054] Optionally, the behavior prediction module is further configured to: Obtain the actual interactive component triggered after the interactive behavior event stream; Training samples are constructed based on the interaction behavior feature vector and the real interaction components, and the machine learning model is iteratively trained.

[0055] Optionally, the machine learning model is obtained by receiving model parameters sent by the server and deploying the model parameters in a local machine learning model; the behavior prediction module is further configured to: Periodically obtain the update amount of the model parameters of the machine learning model; The model parameter update is encrypted and uploaded to the server. The server then decrypts and merges the model parameter update data uploaded by multiple clients. Based on the merged model parameter update data, new model parameters are determined and sent to each client. The system receives the new model parameter update amount sent by the server and deploys the new model parameter update amount in the local machine learning model to update the local machine learning model.

[0056] It should be noted that other corresponding descriptions of the functional units involved in the behavior prediction-based user interface preprocessing apparatus provided in this application embodiment can be found in the following references. Figures 1 to 2 The corresponding descriptions in the method will not be repeated here.

[0057] This application also provides a computer device, which may specifically be a personal computer, a server, a network device, etc. Figure 4As shown, the computer device includes a bus, a processor, memory, and a communication interface, and may also include an input / output interface and a display device. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores location information. The network interface allows communication with external terminals via a network connection. When the computer program is executed by the processor, it implements the steps in the various method embodiments.

[0058] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0059] In one embodiment, a computer-readable storage medium is provided, which may be non-volatile or volatile, having stored thereon a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0060] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0061] It should be noted that the user personal information involved in the embodiments of this application is all authorized (with the knowledge and consent) by the relevant parties or fully authorized by all parties, and the executing entity can obtain it through various legal and compliant means. The collection, storage, use, processing, transmission, provision, and disclosure of the information, data, and signals involved all comply with the relevant laws and regulations of the relevant countries and regions, and do not violate public order and good morals. It should be noted that if any software tools or components other than those of this company appear in the embodiments of this application, they are merely illustrative examples and do not represent actual use.

[0062] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, graphics processors, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0063] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0064] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A user interface preprocessing method based on behavior prediction, characterized in that, The method includes: Listen for the stream of interactive events within the current user interface of the client; Based on the interactive event stream, an interactive behavior feature vector is generated; The interaction behavior is predicted based on the interaction behavior feature vector using a pre-trained machine learning model, and the next interaction component and the confidence level of the next interaction component are determined. The type of preprocessing operation for the next interaction component is determined based on the confidence level, and the preprocessing operation for the next interaction component is performed based on the type of preprocessing operation.

2. The method according to claim 1, characterized in that, The event stream of interactive behaviors within the current user interface of the monitoring client includes: Listen to the timing of actions within the current user interface in the client to obtain the timing sequence of interactive actions; If the obtained interactive behavior time sequence is less than or equal to the preset length, then the interactive behavior time sequence is used as an interactive behavior event stream. If the obtained interactive behavior sequence is longer than the preset length, then the nearest interactive behavior sequence of the preset length is selected as the interactive behavior event stream.

3. The method according to claim 2, characterized in that, The step of generating an interaction behavior feature vector based on the interaction behavior event stream includes: Extract the mouse movement sequence from the interactive event stream to obtain the position of each interactive component element in the current user interface, the current display viewport height corresponding to the current user interface, and the interface height of the current user interface; The average speed, acceleration, and trajectory curvature of the mouse are calculated based on the mouse movement sequence as trajectory dynamics characteristics. Based on the mouse movement sequence and the positions of each interactive component element, the distance between the current mouse position and the positions of each interactive component element, and the duration of mouse dwell on the current hovering element are determined as element association features. Based on the current viewport height and the position of each interactive component element, determine the type of the visible interactive component element in the current viewport, perform multi-hot encoding on the type of the visible interactive component element to obtain a multi-hot encoding vector, determine the interface scroll percentage based on the current viewport height and the interface height, and use the multi-hot encoding vector and the interface scroll percentage as page context features. After normalizing the continuous numerical features in the trajectory dynamics features, the element association features, and the page context features, the processed features are organized into the interaction behavior feature vector.

4. The method according to claim 3, characterized in that, The step of predicting interaction behavior based on the interaction behavior feature vector using a pre-trained machine learning model, and determining the next interaction component and its confidence level, includes: The interaction behavior is predicted by a pre-trained machine learning model based on the interaction behavior feature vector, so as to predict the next interaction component and the confidence level of triggering the next interaction component among the visible interaction components in the current viewport.

5. The method according to claim 1, characterized in that, The step of determining the preprocessing operation type for the next interaction component based on the confidence level, and performing the preprocessing operation for the next interaction component based on the preprocessing operation type, includes: If the confidence level is greater than or equal to the first preset threshold, then the preprocessing operation type for the next interactive component is determined to be the pre-rendering type, and the JavaScript object of the next interactive component is instantiated, and the JavaScript object is used to construct and compile a virtual DOM. If the confidence level is less than the first preset threshold and greater than or equal to the second preset threshold, then the preprocessing operation type for the next interaction component is determined to be the pre-acquisition type, and the required data for the next interaction component is acquired and stored in the cache. If the confidence level is less than the second preset threshold, the preprocessing operation type for the next interaction component is determined to be the priority adjustment type, and the resource loading priority of the next interaction component is increased.

6. The method according to any one of claims 1 to 5, characterized in that, The method further includes: Obtain the actual interactive component triggered after the interactive behavior event stream; Training samples are constructed based on the interaction behavior feature vector and the real interaction components, and the machine learning model is iteratively trained.

7. The method according to claim 6, characterized in that, The machine learning model is obtained by receiving model parameters sent by the server and deploying the model parameters in a local machine learning model; after iteratively training the machine learning model, the method further includes: Periodically obtain the update amount of the model parameters of the machine learning model; The model parameter update is encrypted and uploaded to the server. The server then decrypts and merges the model parameter update data uploaded by multiple clients. Based on the merged model parameter update data, new model parameters are determined and sent to each client. The system receives the new model parameter update amount sent by the server and deploys the new model parameter update amount in the local machine learning model to update the local machine learning model.

8. A user interface preprocessing device based on behavior prediction, characterized in that, The device includes: The event stream acquisition module is used to listen for the event stream of interactive behaviors within the current user interface in the client. The feature vector generation module is used to generate interactive behavior feature vectors based on the interactive behavior event stream; The behavior prediction module is used to predict interactive behavior based on the interactive behavior feature vector using a pre-trained machine learning model, and to determine the next interactive component and the confidence level of the next interactive component. A preprocessing module is used to determine the preprocessing operation type for the next interaction component based on the confidence level, and to perform the preprocessing operation for the next interaction component based on the preprocessing operation type.

9. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.

10. A computer device, comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 7.