A multi-dimensional perception front-end intelligent dynamic performance tuning method and system
Patent Information
- Application Number
- CN202611187116.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-06
- Publication Date
- 2026-10-30
AI Technical Summary
[0022]本发明提供的一种多维度感知下前端智能动态性能调优方法及系统,所述调优方法包括:实时采集原始数据;对采集的原始数据进行数据预处理,生成随机森林模型可识别的标准特征向量;部署轻量化随机森林模型,输入标准特征向量,输出设备性能等级L1-L5、网络质量等级N1-N4、用户行为预测结果三大决策结果;根据决策结果,调用渲染引擎、资源加载模块、后台逻辑管理模块,执行对应的动态优化策略,并将优化效果反馈至感知层,形成闭环。通过实时采集设备、网络、运行时、用户行为数据,利用轻量化随机森林模型智能划分设备性能等级与网络质量等级,通过AI调度层统一接管页面渲染、资源、请求、定时器、异步任务,实现高端机全开、中端机平衡、低端机保流畅、弱网智能预加载的全自动动态调优,无需修改业务代码,无需人工配置规则。
Smart Images

Figure CN123011350A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of front-end performance optimization, and in particular to a method and system for intelligent dynamic performance tuning of the front-end under multi-dimensional perception. Background Technology
[0002] The existing front-end performance optimization methods suffer from drawbacks such as reliance on static rules, limited optimization dimensions, strong coupling with business code, inability to adapt dynamically in real time, poor experience on weak networks and low-end devices, and lack of self-optimization loop. This solution aims to achieve front-end performance tuning without modifying business code, enabling real-time perception across multiple dimensions, AI-powered intelligent decision-making, dynamic automatic upgrades and downgrades, and full-scenario adaptive performance tuning.
[0003] 2.1 Technical Background of Static Degradation Adaptation Method for Front-End Performance To ensure compatibility with mobile devices of varying configurations, front-end applications commonly employ static degradation adaptation methods based on device model, memory size, or network type. This involves pre-setting "high-end / mid-range / low-end" device tiers during application development and using hard-coded if-else logic to configure fixed rendering and resource loading rules for different device tiers. This method is simple to implement and was initially widely used to address lag issues on low-end devices.
[0004] 2.2 Background of Front-end Performance Monitoring and Optimization Methods Based on Single-Dimensional Metrics With the development of front-end performance optimization technology, monitoring and optimization methods based on single metrics (such as page frame rate (FPS), first screen load time, and request success rate) have emerged. These methods collect a single performance metric periodically during page execution, and trigger simple degradation or alarm operations when the metric falls below a preset threshold.
[0005] 2.3 Optimization methods and system technical background for weak network conditions in front-end resource loading To address the issue of slow page loading in weak network environments, existing technologies employ various optimization methods for front-end resource loading, such as lazy loading, preloading, resource compression, and API merging. These methods primarily improve loading speed in weak network conditions by reducing the number of resource requests, decreasing resource size, and adjusting loading timing.
[0006] Disadvantages of existing technology Traditional front-end optimization relies on fixed thresholds, static rules, and manual configuration, which cannot adapt to the myriad of device models and real-time environmental changes.
[0007] The optimization is too narrow, focusing only on resource loading or frame rate, without integrating multiple dimensions such as device hardware, network quality, runtime status, and user behavior.
[0008] The degradation strategy is tightly coupled with the business code, requiring a large number of if-else statements, resulting in high maintenance costs and poor scalability.
[0009] It cannot achieve dynamic upgrades and downgrades during runtime, and cannot automatically adjust strategies when the device overheats and reduces frequency, switches networks, or experiences network jitter.
[0010] In scenarios with weak networks and low-end machines, the inability to intelligently distinguish between core and non-core resources can easily lead to lag in critical functions or waste of unnecessary resources.
[0011] Without a unified intelligent decision-making engine, optimization results rely on human experience and cannot form a closed loop of perception-decision-execution-feedback. Summary of the Invention
[0012] In view of the above problems, the present invention is proposed to provide a method and system for front-end intelligent dynamic performance optimization under multi-dimensional perception to overcome or at least partially solve the above problems.
[0013] According to one aspect of the present invention, a method for front-end intelligent dynamic performance optimization under multi-dimensional perception is provided, the optimization method comprising: Real-time collection of raw data; The collected raw data is preprocessed to generate standard feature vectors that can be recognized by the random forest model; Deploy a lightweight random forest model, input standard feature vectors, and output three major decision results: device performance level L1-L5, network quality level N1-N4, and user behavior prediction results; Based on the decision results, the rendering engine, resource loading module, and backend logic management module are invoked to execute the corresponding dynamic optimization strategies, and the optimization effects are fed back to the perception layer to form a closed loop.
[0014] Optionally, the real-time acquisition of raw data specifically includes: It collects 16 types of data across four dimensions in real time, with a sampling frequency of 100ms / time, covering all scenarios including devices, networks, runtime, and user behavior.
[0015] Optionally, the real-time collection of 16 types of data across four dimensions, with a sampling frequency of 100ms / time, covering all scenarios including device, network, runtime, and user behavior, specifically includes: Real-time data collection across four dimensions is achieved through browser native APIs, WeChat Mini Program basic library APIs, and custom tracking points: Device hardware dimensions: CPU model / number of cores, GPU model, available memory size, device pixel ratio (DPR), device type, including mobile phone / tablet / PC; Network quality dimensions: real-time network speed, RTT, packet loss rate, network standard, and network stability index; Runtime state dimensions: page frame rate (FPS), memory usage, CPU utilization, main thread long task blocking duration, number of DOM nodes, and number of rendering layers; User behavior dimensions: page click heatmap, swipe direction / speed, page dwell time, historical page visit path, and resource click priority.
[0016] Optionally, the step of preprocessing the collected raw data to generate standard feature vectors recognizable by the random forest model specifically includes: The collected raw data is denoised, normalized, feature-filtered, and missing value-filled to generate a standard feature vector that can be recognized by the random forest model.
[0017] Optionally, the step of denoising, normalizing, feature filtering, and imputing missing values in the collected raw data to generate a standard feature vector recognizable by the random forest model specifically includes: Data denoising: outliers are removed, and sliding window filtering is used to smooth fluctuating data; Normalization: Mapping data of different dimensions to the [0,1] interval; Feature selection: Based on the feature importance assessment of random forest, low-contribution features are removed, and 12 core features are retained; Missing value imputation: For missing data in packet loss rate and RTT caused by network fluctuations, the average of adjacent time points is used to imput the missing data.
[0018] Optionally, the deployment of the lightweight random forest model, taking a standard feature vector as input, outputs three major decision results: device performance level L1-L5, network quality level N1-N4, and user behavior prediction results. These specifically include: Lightweight Model Adaptation: Lightweight modifications to the Random Forest model: Model size: The number of decision trees is reduced to 30-50, the maximum depth of a single tree is ≤8, and the minimum number of samples in a leaf node is ≥5; Deployment method: After the model is trained, it is converted into JSON format, and the front end loads and runs it through a lightweight JS engine, with an inference latency of ≤10ms; Dynamic optimization: Supports incremental model updates, with the backend periodically pushing feature weight update packages, eliminating the need for the frontend to re-download the complete model; Model training and classification rules: Training dataset: Collect millions of real user devices-network-runtime data, manually label device levels L1-L5 and network levels N1-N4, and construct a labeled dataset; Equipment Tier Classification: L1 is the top-tier high-end machine: CPU cores ≥ 8, RAM ≥ 8GB, FPS ≥ 58, CPU utilization ≤ 30%; L2 is the high-end machine: CPU cores ≥ 6, RAM ≥ 6GB, FPS ≥ 55, CPU utilization ≤ 40%; L3 is the mid-range machine: CPU cores ≥ 4, RAM ≥ 4GB, FPS ≥ 50, CPU utilization ≤ 50%; L4 is the low-end machine: CPU cores ≥ 2, RAM ≥ 2GB, FPS ≥ 40, CPU utilization ≤ 70%; L5 is the entry-level low-end machine: CPU cores = 1, RAM < 2GB, FPS < 40, CPU utilization > 70%. Network quality classification: N1 is an excellent network: network speed ≥ 10Mbps, RTT ≤ 50ms, packet loss rate ≤ 1%; N2 is a good network: network speed ≥ 5Mbps, RTT ≤ 100ms, packet loss rate ≤ 3%; N3 is a weak network: network speed ≥ 1Mbps, RTT ≤ 200ms, packet loss rate ≤ 8%; N4 is an extremely weak network: network speed < 1Mbps, RTT > 200ms, packet loss rate > 8%. User behavior prediction: Based on historical access paths and current interaction behavior, random forest predicts the probability of a user visiting a page / clicking a resource next, and outputs a list of top 3 high-priority resources; The random forest model outputs three core results through voting by multiple decision trees: device performance level L1-L5; network quality level N1-N4; and a list of high-priority resources for user behavior prediction.
[0019] Optionally, the step of invoking the rendering engine, resource loading module, and backend logic management module to execute the corresponding dynamic optimization strategy based on the decision result specifically includes: Based on the device level, network level, and user behavior prediction results output by Random Forest, three levels of optimization rules are dynamically executed: rendering strategy, resource loading strategy, and backend logic strategy. The core rules are: Rendering strategies are dynamically switched, including: Top-of-the-line high-end L1: Full animation, high-definition resources, GPU acceleration enabled, multi-layer rendering, and maximum preloading; High-end L2: Retains core animations and high-definition resources, enables GPU acceleration, merges non-core rendering tasks, and preloads core resources; Mid-range L3: Disable non-core animations, standard resolution resources, limit the number of rendering layers, merge long rendering tasks, and preload on demand; Low-end L4: Disable all animations, low-resolution resources, disable GPU acceleration, single-layer rendering, split long tasks, and only preload the first screen resources; Entry-level low-end L5: Disable animations and static pages, use the lowest resolution resources, freeze non-core rendering logic, use minimal rendering for the first screen, and disable preloading; Resource loading strategies are dynamically adapted, including: N1 for superior networks: all resources are loaded in parallel with no delay, and all related resources are preloaded; N2 for good networks: core resources are loaded first, non-core resources are lazy-loaded, and high-priority resources predicted by user behavior are preloaded; N3 for weak networks: the first screen and high-priority resources are loaded, resources are compressed to the minimum, loaded serially, and request timeouts are increased with retry mechanisms; N4 for extremely weak networks: plain text is loaded first, image / video placeholders are loaded late, only the top 1 high-priority resources are preloaded, interface requests are merged, and unnecessary network requests are disabled. The background logic strategy is dynamically optimized, including: L1-L2: all background logic runs, timers execute normally, and data is synchronized in real time; L3: merging idle timers, delaying the synchronization of non-core data, and limiting the frequency of background calculations; L4-L5: freezing idle background logic, pausing unnecessary timers, synchronizing data on demand, and destroying redundant DOM nodes / event listeners.
[0020] Optionally, feeding back the optimization effect to the perception layer to form a closed loop specifically includes: After the system executes the optimization strategy, the perception layer continuously collects performance data such as optimized FPS, memory usage, loading time, and request success rate, and feeds this data back to the decision-making layer. If the desired results are achieved, maintain the current strategy; If the results are not satisfactory, trigger a fine-tuning of the strategy; The backend periodically collects all feedback data, retrains the random forest model, updates feature weights and classification rules, and distributes the updates to the frontend to achieve iterative optimization of the model.
[0021] This invention also provides a front-end intelligent dynamic performance tuning system under multi-dimensional perception, which applies the aforementioned front-end intelligent dynamic performance tuning method under multi-dimensional perception. The tuning system includes: A multi-dimensional data perception module is used to collect raw data in real time; The data preprocessing module is used to preprocess the collected raw data and generate standard feature vectors that can be recognized by the random forest model. The Random Forest Intelligent Decision Module is used to deploy a lightweight random forest model. It takes a standard feature vector as input and outputs three decision results: device performance level L1-L5, network quality level N1-N4, and user behavior prediction results. The dynamic strategy execution module is used to call the rendering engine, resource loading module, and backend logic management module to execute the corresponding dynamic optimization strategy based on the decision results. The closed-loop feedback and model iteration module is used to feed the optimization effect back to the perception layer to form a closed loop.
[0022] This invention provides a multi-dimensional perception-based intelligent dynamic performance optimization method and system for the front end. The optimization method includes: real-time acquisition of raw data; data preprocessing of the acquired raw data to generate standard feature vectors recognizable by a random forest model; deployment of a lightweight random forest model, inputting the standard feature vectors, and outputting three decision results: device performance level L1-L5, network quality level N1-N4, and user behavior prediction results; based on the decision results, invoking the rendering engine, resource loading module, and backend logic management module to execute corresponding dynamic optimization strategies, and feeding back the optimization effect to the perception layer to form a closed loop. By acquiring real-time data on devices, networks, runtime, and user behavior, and using a lightweight random forest model to intelligently classify device performance levels and network quality levels, the AI scheduling layer uniformly manages page rendering, resources, requests, timers, and asynchronous tasks, achieving fully automatic dynamic optimization with high-end machines running at full capacity, mid-range machines maintaining balance, low-end machines ensuring smooth performance, and intelligent preloading in weak network conditions, without requiring modification of business code or manual rule configuration.
[0023] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0024] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 The flowchart illustrates a front-end intelligent dynamic performance optimization method under multi-dimensional perception, as provided in an embodiment of the present invention. Detailed Implementation
[0026] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0027] The terms "comprising" and "having," and any variations thereof, in the specification, embodiments, claims, and drawings of this invention are intended to cover non-exclusive inclusion, such as including a series of steps or units.
[0028] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments.
[0029] A front-end intelligent dynamic performance optimization system with multi-dimensional perception collects real-time data on devices, networks, runtime, and user behavior. It uses a lightweight random forest model to intelligently classify device performance levels and network quality levels. Through an AI scheduling layer, it uniformly manages page rendering, resources, requests, timers, and asynchronous tasks, achieving fully automatic dynamic optimization with high-end machines running at full capacity, mid-range machines maintaining balance, low-end machines ensuring smooth performance, and intelligent preloading in weak network conditions. No business code modification or manual rule configuration is required.
[0030] like Figure 1 As shown, the system of the present invention consists of a multi-dimensional data perception layer, a data preprocessing layer, a random forest intelligent decision-making layer, a dynamic policy execution layer, closed-loop feedback, and model iteration.
[0031] Multi-dimensional data perception layer: responsible for real-time collection of 16 types of data across four dimensions, with a sampling frequency of 100ms / time, covering all scenarios including devices, networks, runtime, and user behavior; Data preprocessing layer: Denoises, normalizes, filters features, and fills missing values in the collected raw data to generate standard feature vectors that can be recognized by the random forest model; Random Forest Intelligent Decision Layer: Deploys a lightweight random forest model, inputs standard feature vectors, and outputs three major decision results: device performance level (L1-L5), network quality level (N1-N4), and user behavior prediction results; Dynamic strategy execution layer: Based on the decision results, it calls the rendering engine, resource loading module, and backend logic management module to execute the corresponding dynamic optimization strategy, and feeds back the optimization effect to the perception layer to form a closed loop.
[0032] The multi-dimensional data perception layer includes: By utilizing native browser APIs, WeChat Mini Program basic library APIs, and custom tracking points, we collect data in real time across the following four dimensions to ensure comprehensive, accurate, and time-efficient data collection: Device hardware dimensions: CPU model / number of cores, GPU model, available memory size, device pixel ratio (DPR), device type (phone / tablet / PC). Network quality dimensions: real-time network speed (uplink / downlink), RTT (round-trip time), packet loss rate, network standard (5G / 4G / 3G / 2G / Wi-Fi), and network stability index; Runtime state dimensions: page frame rate (FPS), memory usage, CPU utilization, main thread long task blocking duration, number of DOM nodes, number of rendering layers; User behavior dimensions: page click heatmap, swipe direction / speed, page dwell time, historical page visit path, resource click priority (such as images / videos / buttons).
[0033] The data preprocessing layer includes: To adapt to the input requirements of the random forest model, the original data undergoes standardization preprocessing. The core process is as follows: Data denoising: Remove outliers (such as instantaneous network speed peaks and occasional frame rate drops), and use sliding window filtering to smooth fluctuating data; Normalization: Map data of different dimensions (such as memory MB, frame rate FPS, RTT ms) to the [0,1] interval to eliminate the influence of dimensions; Feature selection: Based on the feature importance assessment of random forest, low-contribution features are eliminated, and 12 core features are retained to reduce the computational complexity of the model; Missing value imputation: For packet loss rate and RTT missing data caused by network fluctuations, the average of adjacent time points is used to imput the missing data to ensure the integrity of the feature vector.
[0034] The intelligent decision-making layer of the random forest includes: (1) Lightweight model adaptation To address the limitations of front-end environment resources (memory ≤ 50MB, limited CPU computing power), a lightweight modification of the random forest model is implemented: Model size: The number of decision trees is reduced to 30-50 (balancing accuracy and speed), the maximum depth of a single tree is ≤8, and the minimum number of samples in a leaf node is ≥5; Deployment method: After the model is trained, it is converted into JSON format (size ≤200KB), and the front end loads and runs it through a lightweight JS engine (such as ForestJS), with an inference latency of ≤10ms; Dynamic optimization: Supports incremental model updates, with the backend periodically pushing feature weight update packages, eliminating the need for the frontend to re-download the complete model.
[0035] (2) Model training and classification rules Training dataset: Collect millions of real user devices-network-runtime data, manually label device levels (L1-L5) and network levels (N1-N4), and construct a labeled dataset (sample size ≥ 500,000). Equipment classification (5 levels): L1 (Top-tier high-end machine): CPU cores ≥8, RAM ≥8GB, runtime FPS ≥58, CPU utilization ≤30%; L2 (High-end machine): CPU cores ≥6, memory ≥6GB, runtime FPS ≥55, CPU utilization ≤40%; L3 (mid-range): CPU cores ≥4, RAM ≥4GB, runtime FPS ≥50, CPU utilization ≤50%; L4 (low-end machine): CPU cores ≥2, memory ≥2GB, runtime FPS ≥40, CPU utilization ≤70%; L5 (Entry-level low-end machine): CPU core count = 1, RAM < 2GB, runtime FPS < 40, CPU utilization > 70%; Network Classification (4 Levels): N1 (Excellent Network): Network speed ≥ 10Mbps, RTT ≤ 50ms, Packet loss rate ≤ 1%; N2 (Good Network): Network speed ≥ 5Mbps, RTT ≤ 100ms, Packet loss rate ≤ 3%; N3 (Weak Network): Network speed ≥ 1Mbps, RTT ≤ 200ms, Packet loss rate ≤ 8%; N4 (Extremely Weak Network): Network speed < 1Mbps, RTT > 200ms, Packet loss rate > 8%; User behavior prediction: Based on historical access paths and current interaction behavior, random forest predicts the probability of a user visiting a page / clicking on a resource next, and outputs a list of the top 3 high-priority resources.
[0036] (3) Decision output The random forest model outputs three core results through voting among multiple decision trees: device performance level (L1-L5); network quality level (N1-N4); and a list of high-priority resources for user behavior prediction.
[0037] Dynamic policy execution layer: Based on the device level, network level, and user behavior prediction results output by Random Forest, three levels of optimization rules are dynamically executed: rendering strategy, resource loading strategy, and background logic strategy. (1) Dynamic switching of rendering strategy L1 (Top-of-the-line high-end machine): Unlimited animations (CSS animations / JS animations), high-definition resources (4K / 2K images, 1080P videos), GPU acceleration enabled, multi-layer rendering, and maximum preloading (all resources preloaded). L2 (high-end machine): Retains core animations (critical interactive animations), high-definition resources (2K / 1080P images, 720P videos), enables GPU acceleration, merges non-core rendering tasks, and preloads core resources; L3 (Mid-range): Disable non-core animations (such as background decoration animations), standard resolution resources (1080P / 720P images, 480P videos), limit the number of rendering layers (≤3 layers), merge long rendering tasks, and preload on demand; L4 (Low-end): Disable all animations, low-resolution resources (720P / 480P images, 360P videos), disable GPU acceleration, single-layer rendering, split long tasks (single ≤50ms), and preload only the first screen resources; L5 (Entry-level low-end): Disable animations + static pages, minimum resolution resources (480P / 360P images), freeze non-core rendering logic, minimal first screen rendering, and disable preloading (pure lazy loading).
[0038] (2) Dynamic adaptation of resource loading strategies, including: N1 (good network): parallel loading of all resources, no delay, preloading of all related resources; N2 (good network): priority loading of core resources, lazy loading of non-core resources, preloading of high-priority resources based on user behavior prediction; N3 (weak network): loading only the first screen + high-priority resources, resource compression to the minimum (WebP / AVIF format), serial loading (avoiding bandwidth contention), increasing request timeout (15s) + retry mechanism (2 times); N4 (extremely weak network): priority loading of plain text, lazy loading of image / video placeholders, preloading only the top 1 high-priority resources, merging interface requests (reducing the number of HTTP connections), disabling unnecessary network requests.
[0039] (3) Dynamic optimization of backend logic strategies, including: L1-L2: full execution of backend logic, normal execution of timers, and real-time data synchronization; L3: merging idle timers, delaying the synchronization of non-core data (such as user profile data), and limiting the frequency of backend calculations; L4-L5: freezing idle backend logic (such as listening events of inactive pages), pausing unnecessary timers, synchronizing data on demand (synchronizing only when interacting with the front end), destroying redundant DOM nodes / event listeners, and releasing memory.
[0040] Closed-loop feedback and model iteration include: After the system executes the optimization strategy, the perception layer continuously collects performance data such as optimized FPS, memory usage, loading time, and request success rate, and feeds it back to the decision layer: If the performance meets the target (e.g., FPS ≥ 40 for L4 devices, loading time ≤ 3s for N3 weak networks), the current strategy is maintained; if the performance does not meet the target (e.g., lag, loading timeout), strategy fine-tuning is triggered (e.g., downgrading rendering level, reducing resource resolution); the backend periodically collects all feedback data, retrains the random forest model, updates feature weights and classification rules, and sends them to the frontend to achieve iterative optimization of the model and continuously improve adaptation accuracy.
[0041] Beneficial effects: 1. This invention adopts a unified management architecture of multi-dimensional perception + AI intelligent decision-making + AI scheduling layer, which replaces the traditional front-end performance optimization method of fixed thresholds and static rules. It eliminates the need for manual preset of degradation levels and rules, realizes fully automatic dynamic performance tuning in all scenarios, and significantly improves the accuracy and coverage of adaptation.
[0042] 2. This invention achieves unified global management of image resources, animation effects, network requests, timers, and main thread rendering tasks through an AI scheduling layer. Automatic upgrades and downgrades can be achieved without modifying any business code, solving the problems of strong coupling between traditional optimization solutions and business code, high maintenance costs, and poor scalability, and significantly reducing project access and adaptation costs.
[0043] 3. This invention constructs a closed-loop self-optimization mechanism of "perception-decision-execution-feedback", which can dynamically and seamlessly adjust the optimization strategy according to the real-time performance fluctuations of the device and changes in the network environment. It solves the problems of existing technologies being unable to adapt dynamically in real time and having a lagging optimization effect, and significantly improves the page smoothness and user experience in complex scenarios.
[0044] 4. This invention introduces a core resource intelligent protection strategy, which performs differentiated degradation processing on critical and non-core resources. While ensuring the core user experience, it maximizes performance optimization and avoids the experience loss caused by the one-size-fits-all degradation of traditional solutions, thus achieving a precise balance between performance and experience.
[0045] The above specific embodiments further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for intelligent dynamic performance optimization of the front end under multi-dimensional perception, characterized in that, The optimization method includes: Real-time collection of raw data; The collected raw data is preprocessed to generate standard feature vectors that can be recognized by the random forest model; Deploy a lightweight random forest model, input standard feature vectors, and output three major decision results: device performance level L1-L5, network quality level N1-N4, and user behavior prediction results; Based on the decision results, the rendering engine, resource loading module, and backend logic management module are invoked to execute the corresponding dynamic optimization strategies, and the optimization effects are fed back to the perception layer to form a closed loop.
2. The method for front-end intelligent dynamic performance optimization under multi-dimensional perception as described in claim 1, characterized in that, The real-time acquisition of raw data specifically includes: It collects 16 types of data across four dimensions in real time, with a sampling frequency of 100ms / time, covering all scenarios including devices, networks, runtime, and user behavior.
3. The method for front-end intelligent dynamic performance optimization under multi-dimensional perception as described in claim 1, characterized in that, The real-time collection of 16 types of data across four dimensions, with a sampling frequency of 100ms / time, covers all scenarios including device, network, runtime, and user behavior, specifically including: Real-time data collection across four dimensions is achieved through browser native APIs, WeChat Mini Program basic library APIs, and custom tracking points: Device hardware dimensions: CPU model / number of cores, GPU model, available memory size, device pixel ratio (DPR), device type, including mobile phone / tablet / PC; Network quality dimensions: real-time network speed, RTT, packet loss rate, network standard, and network stability index; Runtime state dimensions: page frame rate (FPS), memory usage, CPU utilization, main thread long task blocking duration, number of DOM nodes, and number of rendering layers; User behavior dimensions: page click heatmap, swipe direction / speed, page dwell time, historical page visit path, and resource click priority.
4. The method for front-end intelligent dynamic performance optimization under multi-dimensional perception as described in claim 1, characterized in that, The process of preprocessing the collected raw data to generate standard feature vectors recognizable by the random forest model specifically includes: The collected raw data is denoised, normalized, feature-filtered, and missing value-filled to generate standard feature vectors that can be recognized by the random forest model.
5. The method for front-end intelligent dynamic performance optimization under multi-dimensional perception as described in claim 1, characterized in that, The process of denoising, normalizing, feature filtering, and missing value imputation of the collected raw data to generate a standard feature vector recognizable by the random forest model specifically includes: Data denoising: outliers are removed, and sliding window filtering is used to smooth fluctuating data; Normalization: Mapping data of different dimensions to the [0,1] interval; Feature selection: Based on the feature importance assessment of random forest, low-contribution features are eliminated, and 12 core features are retained; Missing value imputation: For missing data in packet loss rate and RTT caused by network fluctuations, the average of adjacent time points is used to imput the missing data.
6. The method for front-end intelligent dynamic performance optimization under multi-dimensional perception as described in claim 1, characterized in that, The lightweight random forest model is deployed, taking a standard feature vector as input and outputting three main decision results: device performance level L1-L5, network quality level N1-N4, and user behavior prediction results. Lightweight Model Adaptation: Lightweight modifications to the Random Forest model: Model size: The number of decision trees is reduced to 30-50, the maximum depth of a single tree is ≤8, and the minimum number of samples in a leaf node is ≥5; Deployment method: After the model is trained, it is converted into JSON format, and the front end loads and runs it through a lightweight JS engine, with an inference latency of ≤10ms; Dynamic optimization: Supports incremental model updates, with the backend periodically pushing feature weight update packages, eliminating the need for the frontend to re-download the complete model; Model training and classification rules: Training dataset: Collect millions of real user devices-network-runtime data, manually label device levels L1-L5 and network levels N1-N4, and construct a labeled dataset; Equipment Tier Classification: L1 is the top-tier high-end machine: CPU cores ≥ 8, RAM ≥ 8GB, FPS ≥ 58, CPU utilization ≤ 30%; L2 is the high-end machine: CPU cores ≥ 6, RAM ≥ 6GB, FPS ≥ 55, CPU utilization ≤ 40%; L3 is the mid-range machine: CPU cores ≥ 4, RAM ≥ 4GB, FPS ≥ 50, CPU utilization ≤ 50%; L4 is the low-end machine: CPU cores ≥ 2, RAM ≥ 2GB, FPS ≥ 40, CPU utilization ≤ 70%; L5 is the entry-level low-end machine: CPU cores = 1, RAM < 2GB, FPS < 40, CPU utilization > 70%. Network quality classification: N1 is an excellent network: network speed ≥ 10Mbps, RTT ≤ 50ms, packet loss rate ≤ 1%; N2 is a good network: network speed ≥ 5Mbps, RTT ≤ 100ms, packet loss rate ≤ 3%; N3 is a weak network: network speed ≥ 1Mbps, RTT ≤ 200ms, packet loss rate ≤ 8%; N4 is an extremely weak network: network speed < 1Mbps, RTT > 200ms, packet loss rate > 8%. User behavior prediction: Based on historical access paths and current interaction behavior, random forest predicts the probability of a user visiting a page / clicking on a resource next, and outputs a list of top 3 high-priority resources; The random forest model outputs three core results through voting by multiple decision trees: device performance level L1-L5; network quality level N1-N4; and a list of high-priority resources for user behavior prediction.
7. The method for front-end intelligent dynamic performance optimization under multi-dimensional perception as described in claim 1, characterized in that, The step of invoking the rendering engine, resource loading module, and backend logic management module based on the decision results to execute the corresponding dynamic optimization strategy specifically includes: Based on the device level, network level, and user behavior prediction results output by Random Forest, three levels of optimization rules are dynamically executed: rendering strategy, resource loading strategy, and backend logic strategy. The core rules are: Rendering strategies are dynamically switched, including: Top-of-the-line high-end L1: Full animation, high-definition resources, GPU acceleration enabled, multi-layer rendering, and maximum preloading; High-end L2: Retains core animations and high-definition resources, enables GPU acceleration, merges non-core rendering tasks, and preloads core resources; Mid-range L3: Disable non-core animations, standard resolution resources, limit the number of rendering layers, merge long rendering tasks, and preload on demand; Low-end L4: Disable all animations, low-resolution resources, disable GPU acceleration, single-layer rendering, split long tasks, and only preload the first screen resources; Entry-level low-end L5: Disable animations and static pages, use the lowest resolution resources, freeze non-core rendering logic, use minimal rendering for the first screen, and disable preloading; Resource loading strategies are dynamically adapted, including: N1 for superior networks: all resources are loaded in parallel with no delay, and all related resources are preloaded; N2 for good networks: core resources are loaded first, non-core resources are lazy-loaded, and high-priority resources predicted by user behavior are preloaded; N3 for weak networks: the first screen and high-priority resources are loaded, resources are compressed to the minimum, loaded serially, and request timeouts are increased with retry mechanisms; N4 for extremely weak networks: plain text is loaded first, image / video placeholders are loaded late, only the top 1 high-priority resources are preloaded, interface requests are merged, and unnecessary network requests are disabled. The background logic strategy is dynamically optimized, including: L1-L2: all background logic runs, timers execute normally, and data is synchronized in real time; L3: merging idle timers, delaying the synchronization of non-core data, and limiting the frequency of background calculations; L4-L5: freezing idle background logic, pausing unnecessary timers, synchronizing data on demand, and destroying redundant DOM nodes / event listeners.
8. The method for front-end intelligent dynamic performance optimization under multi-dimensional perception as described in claim 1, characterized in that, The step of feeding back the optimization effect to the perception layer to form a closed loop specifically includes: After the system executes the optimization strategy, the perception layer continuously collects performance data such as optimized FPS, memory usage, loading time, and request success rate, and feeds this data back to the decision-making layer. If the desired results are achieved, maintain the current strategy; If the results are not satisfactory, a strategy fine-tuning will be triggered. The backend periodically collects all feedback data, retrains the random forest model, updates feature weights and classification rules, and distributes the updates to the frontend to achieve iterative optimization of the model.
9. A front-end intelligent dynamic performance optimization system under multi-dimensional perception, employing the front-end intelligent dynamic performance optimization method under multi-dimensional perception as described in any one of claims 1-8, characterized in that, The optimization system includes: A multi-dimensional data perception module is used to collect raw data in real time; The data preprocessing module is used to preprocess the collected raw data and generate standard feature vectors that can be recognized by the random forest model. The Random Forest Intelligent Decision Module is used to deploy a lightweight random forest model. It takes a standard feature vector as input and outputs three decision results: device performance level L1-L5, network quality level N1-N4, and user behavior prediction results. The dynamic strategy execution module is used to call the rendering engine, resource loading module, and backend logic management module to execute the corresponding dynamic optimization strategy based on the decision results. The closed-loop feedback and model iteration module is used to feed the optimization effect back to the perception layer to form a closed loop.
