Resource level detection method, device and equipment of third-party script, and storage medium

CN121637188BActive Publication Date: 2026-10-27创优数字科技(广东)有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511879389.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-12
Publication Date
2026-10-27
Estimated Expiration
2045-12-12

AI Technical Summary

Technical Problem

[0002]第三方脚本是页面不可或缺的组成部分,然而这些脚本往往由不同供应商提供,其加载与执行能力不可控,容易引发性能瓶颈,包括资源加载阻塞,主线程占用过高、内存泄漏及网络延迟等问题,据统计,第三方脚本可导致页面加载时间增加百分之三十以上,严重影响用户体验与业务转化率

Benefits of technology

[0055]从上述技术方案可以看出,本申请分离第三方脚本资源中的各个第三方脚本,针对每一个所述第三方脚本,对该第三方脚本进行分类,得到该第三方脚本的脚本类型;基于所述脚本类型,生成与该第三方脚本对应的性能数据;分析各个所述第三方脚本之间的关联性,并根据所述关联性和性能数据对该第三方脚本进行性能评估,得到综合性能评分;按照所述关联性识别该第三方脚本的源头异常,并预测该第三方脚本的性能变化趋势;根据所述综合性能评分、源头异常和性能变化趋势确定该第三方脚本的资源级别。由于第三方脚本资源中存在多个第三方脚本,因此本申请首先分离第三方脚本资源中的各个第三方脚本,然后对每一个第三方脚本进行分类,得到脚本类型,然后根据脚本类型分析性能数据,由于这些第三方脚本都存在于一个第三方脚本资源中,因此它们之间会存在一些关联性,因此分析各个第三方脚本之间的关联性,从而进行性能评分,这是其中一个进行资源级别检测的数据;另外,还可以根据关联性识别第三方脚本的源头异常,再识别第三方脚本的性能变化趋势,从而根据这三类数据确定第三方脚本的资源级别。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121637188B_ABST
    Figure CN121637188B_ABST
Patent Text Reader

Abstract

The application discloses a third-party script resource level detection method and device, equipment and a storage medium. The application separates each third-party script in a third-party script resource, classifies each third-party script to obtain a script type of the third-party script, generates performance data corresponding to the third-party script based on the script type, analyzes the correlation between each third-party script, and performs performance evaluation on the third-party script according to the correlation and the performance data to obtain a comprehensive performance score. The application identifies the source anomaly of the third-party script according to the correlation, predicts the performance change trend of the third-party script, and determines the resource level of the third-party script according to the comprehensive performance score, the source anomaly and the performance change trend. The application can accurately determine the resource level of the third-party script according to multi-dimensional data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of script resource detection technology, specifically to a method, apparatus, device, and storage medium for detecting the resource level of third-party scripts. Background Technology

[0002] Third-party scripts are an indispensable part of web pages. However, these scripts are often provided by different vendors, and their loading and execution capabilities are uncontrollable, easily causing performance bottlenecks, including resource loading blockage, excessive main thread usage, memory leaks, and network latency. Statistics show that third-party scripts can increase page load time by more than 30%, severely impacting user experience and business conversion rates. Therefore, resource-level detection of third-party scripts is crucial. Accurate detection of their resource levels allows for flexible and precise responses, benefiting developers in handling and managing third-party scripts.

[0003] However, existing resource level detection methods for third-party scripts often only focus on a single property or data of the third-party script for detection, and cannot detect comprehensively. This results in inaccurate detection of resource level, which is not conducive to subsequent processing and management by developers, and may even cause page performance issues. Summary of the Invention

[0004] In view of this, this application provides a method, apparatus, device, and storage medium for resource level detection of third-party scripts.

[0005] To achieve the above objectives, the following solution is proposed:

[0006] Firstly, a resource level detection method using a third-party script includes:

[0007] Separate each third-party script from the third-party script resources, and for each third-party script, classify it to obtain the script type of the third-party script;

[0008] Based on the script type, generate performance data corresponding to the third-party script;

[0009] Analyze the correlation between the various third-party scripts, and evaluate the performance of each third-party script based on the correlation and performance data to obtain a comprehensive performance score;

[0010] Identify the source anomaly of the third-party script based on the aforementioned correlation, and predict the performance change trend of the third-party script;

[0011] The resource level of the third-party script is determined based on the comprehensive performance score, source anomalies, and performance change trends.

[0012] Preferably, the step of classifying the third-party script to obtain its script type includes:

[0013] Determine the URL of the third-party script;

[0014] Searching in a pre-created third-party domain name database based on the URL;

[0015] If the URL is contained in the third-party domain name database, the third-party script is classified using the third-party domain name database to obtain the script type;

[0016] If the URL is not contained in the third-party domain name database, the third-party script is temporarily classified to obtain the script type.

[0017] Preferably, generating performance data corresponding to the third-party script based on the script type includes:

[0018] Obtain the key timing points corresponding to this third-party script;

[0019] Calculate the basic metrics of the third-party script based on the key time points mentioned above;

[0020] Based on the aforementioned basic indicators, the impact range of the first screen time, the estimated main thread usage, and the network efficiency ratio are determined.

[0021] Determine the time window and page session dimensions;

[0022] The performance data corresponding to the third-party script is obtained by aggregating the impact range of the first screen time, the estimated main thread usage, and the network efficiency ratio based on the script type, time window, and page session dimension.

[0023] Preferably, the step of evaluating the performance of the third-party script based on the correlation and performance data to obtain a comprehensive performance score includes:

[0024] Match the corresponding rule subset from the preset rule set based on the script type of the third-party script;

[0025] The third-party script is matched against each rule in the rule subset to obtain the performance sub-score of the third-party script under each rule.

[0026] The initial score is obtained by weighted summation of the performance sub-scores under each of the aforementioned rules.

[0027] The initial score is modified using the correlation to obtain a comprehensive performance score.

[0028] Preferably, the step of modifying the initial score using the correlation to obtain a comprehensive performance score includes:

[0029] The initial weight matrix is ​​defined based on the number of third-party scripts and the correlation.

[0030] Analyze the criticality of each of the aforementioned third-party scripts;

[0031] The initial weight matrix is ​​dynamically adjusted based on the criticality to obtain the target weight matrix;

[0032] Determine the weights in the target weight matrix that correspond to the third-party script;

[0033] The initial score is modified using the weights to obtain a comprehensive performance score.

[0034] Preferably, identifying the source anomaly of the third-party script based on the correlation includes:

[0035] Identify significant deviations in the performance data;

[0036] Based on the performance data, identify the abnormal timing of the third-party script;

[0037] Based on the aforementioned correlation, identify any collaboration anomalies between the various third-party scripts;

[0038] A comprehensive analysis of the significant deviations, abnormal patterns, and collaborative anomalies is conducted to identify the source anomaly.

[0039] Preferably, determining the resource level of the third-party script based on the comprehensive performance score, source anomaly, and performance change trend includes:

[0040] Get the base level of this third-party script;

[0041] Determine the criticality of the third-party script, and determine whether the third-party script meets the non-downgrade condition based on the script type and criticality.

[0042] If so, then the base level will be used as the resource level of the third-party script;

[0043] If not, the level range of the third-party script is determined based on the comprehensive performance score. If the basic level is within the level range, the basic level is taken as the resource level of the third-party script.

[0044] If it is not within the range of the stated level, the base level is modified according to the source anomaly and performance change trend to obtain the resource level.

[0045] Secondly, a resource level detection device for a third-party script includes:

[0046] The script type determination module is used to separate each third-party script in the third-party script resources, and for each third-party script, classify the third-party script to obtain the script type of the third-party script;

[0047] The performance data generation module is used to generate performance data corresponding to the third-party script based on the script type.

[0048] The performance score calculation module is used to analyze the correlation between the various third-party scripts, and to evaluate the performance of the third-party scripts based on the correlation and performance data to obtain a comprehensive performance score.

[0049] The performance change trend prediction module is used to identify the source anomaly of the third-party script according to the correlation and predict the performance change trend of the third-party script.

[0050] The resource level determination module is used to determine the resource level of the third-party script based on the comprehensive performance score, source anomalies, and performance change trends.

[0051] Thirdly, a resource-level detection device for third-party scripts, including memory and processor;

[0052] The memory is used to store programs;

[0053] The processor is configured to execute the program to implement the various steps of the resource level detection method for third-party scripts as described in any of the first aspects.

[0054] Fourthly, a storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the resource level detection method for a third-party script as described in any of the first aspects.

[0055] As can be seen from the above technical solution, this application separates each third-party script from the third-party script resource, classifies each third-party script to obtain its script type, generates performance data corresponding to the script type, analyzes the correlation between each third-party script, and evaluates the performance of each third-party script based on the correlation and performance data to obtain a comprehensive performance score, identifies the source anomaly of the third-party script according to the correlation, and predicts the performance change trend of the third-party script, and determines the resource level of the third-party script based on the comprehensive performance score, source anomaly, and performance change trend. Since there are multiple third-party scripts in the third-party script resource, this application first separates each third-party script from the third-party script resource, then classifies each third-party script to obtain its script type, and then analyzes the performance data based on the script type. Since these third-party scripts all exist in one third-party script resource, there will be some correlation between them. Therefore, analyzing the correlation between each third-party script to obtain a performance score is one type of data used for resource level detection. In addition, source anomalies of the third-party script can be identified based on the correlation, and the performance change trend of the third-party script can be identified, thereby determining the resource level of the third-party script based on these three types of data. Attached Figure Description

[0056] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0057] Figure 1 An optional flowchart of a resource level detection method for a third-party script provided in an embodiment of this application;

[0058] Figure 2 A schematic diagram of the structure of a resource level detection device for third-party scripts provided in this application embodiment;

[0059] Figure 3 This is a schematic diagram of the structure of a resource level detection device for a third-party script provided in an embodiment of this application. Detailed Implementation

[0060] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0061] This invention can be used in a wide variety of general-purpose or special-purpose computing environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor devices, distributed computing environments including any of the above devices, etc.

[0062] This invention provides a resource level detection method for third-party scripts. This method can be applied to various computer terminals or smart terminals, and its execution entity can be the processor or server of the computer terminal or smart terminal. The method flowchart is shown below. Figure 1 As shown, it specifically includes:

[0063] S1: Separate each third-party script from the third-party script resources, and classify each third-party script to obtain its script type.

[0064] It is understandable that different types of scripts have different performance characteristics and business importance. For example, analysis scripts can be loaded late, while payment verification scripts need to prioritize timeliness. Therefore, it is very important to clarify the script type for detecting resource importance.

[0065] Once the script type is determined, each third-party script can be assigned a unique resource identifier and category metadata to provide context information for subsequent processes.

[0066] S2: Based on the script type, generate performance data corresponding to the third-party script.

[0067] The key performance indicators (KPIs) differ for different types of third-party scripts. For example, for user interface-related scripts, the initial input delay is a key performance indicator; for advertising scripts, cumulative layout offset and in-view visibility are key performance indicators.

[0068] Key performance indicators (KPIs) better reflect the true performance of third-party scripts, so they should be the focus when generating performance data.

[0069] S3: Analyze the correlation between the various third-party scripts, and evaluate the performance of the third-party scripts based on the correlation and performance data to obtain a comprehensive performance score.

[0070] For the various third-party scripts within the same third-party script resource, these scripts do not run in isolation. They may have dependencies, execution order, or resource competition. By analyzing their relationships, we can identify which slow script is blocking the execution of several subsequent important scripts, the impact of problems with common libraries that one or more scripts depend on, and other related data.

[0071] Therefore, this application incorporates the correlation between various third-party scripts into the analysis, which is beneficial for detecting their resource levels. For example, a script with acceptable performance but strong dependencies on other critical third-party scripts should have its resource level increased. Conversely, a poor-performing but isolated script has relatively controllable harm. This allows the calculated performance score to better reflect the true impact of third-party scripts, rather than just their own technical indicators.

[0072] S4: Identify the source anomaly of the third-party script based on the aforementioned correlation, and predict the performance change trend of the third-party script.

[0073] Third-party scripts, due to their unique and external nature, often have problems of varying degrees. Traditional performance monitoring methods only analyze which performance indicators have decreased or reached their maximum. However, this application uses correlation analysis to trace the source of the problem, which helps in subsequent resource-level detection.

[0074] In addition, predicting performance trends, such as if the memory usage of a certain third-party script is steadily increasing and is expected to trigger a leak alert in two weeks, allows for advance planning by changing its resource level, such as lowering it, to prevent major problems from arising from its reuse later.

[0075] S5: Determine the resource level of the third-party script based on the comprehensive performance score, source anomaly, and performance change trend.

[0076] This step integrates the various types of information determined in the previous steps to accurately determine the resource level of the third-party script. In subsequent processes, the loading process or loading method can be determined based on the resource level to drive the downstream system.

[0077] For example, if a third-party script has a very high resource level, it can be loaded first and included in the core performance budget monitoring; if its level is relatively high, its loading process can be monitored in real time and strict performance thresholds can be set; if its level is medium, it can be loaded late and reviewed periodically; if its level is low, it can be loaded after user interaction or passively written when performance is tight.

[0078] As can be seen from the above technical solution, this application separates each third-party script from the third-party script resource, classifies each third-party script to obtain its script type, generates performance data corresponding to the script type, analyzes the correlation between each third-party script, and evaluates the performance of each third-party script based on the correlation and performance data to obtain a comprehensive performance score, identifies the source anomaly of the third-party script according to the correlation, and predicts the performance change trend of the third-party script, and determines the resource level of the third-party script based on the comprehensive performance score, source anomaly, and performance change trend. Since there are multiple third-party scripts in the third-party script resource, this application first separates each third-party script from the third-party script resource, then classifies each third-party script to obtain its script type, and then analyzes the performance data based on the script type. Since these third-party scripts all exist in one third-party script resource, there will be some correlation between them. Therefore, analyzing the correlation between each third-party script to obtain a performance score is one type of data used for resource level detection. In addition, source anomalies of the third-party script can be identified based on the correlation, and the performance change trend of the third-party script can be identified, thereby determining the resource level of the third-party script based on these three types of data.

[0079] This application does not rely solely on a single performance metric, but integrates multiple dimensions such as script type, performance data, inter-script correlation, root causes of anomalies, and future trends. This comprehensive evaluation score is more complete, more reliable, and better reflects the overall impact of scripts in real and complex environments.

[0080] In the method provided by this embodiment of the invention, in response to a received gift display instruction, a (supplementary) process is determined from a set of preset gift animations to determine the gift animation to be displayed corresponding to the gift display instruction. The specific details are as follows:

[0081] Determine the URL of the third-party script;

[0082] Searching in a pre-created third-party domain name database based on the URL;

[0083] If the URL is contained in the third-party domain name database, the third-party script is classified using the third-party domain name database to obtain the script type;

[0084] If the URL is not contained in the third-party domain name database, the third-party script is temporarily classified to obtain the script type.

[0085] Specifically, this application can perform pattern matching and classification tagging on the URLs of third-party script resources by developing a pre-built third-party domain name library, such as public CDN domains and common analysis tool domains.

[0086] The script type of a third-party script can be determined from different perspectives. For example, based on the function type, it can be divided into tracking type and monitoring type; based on the business criticality type, it can be divided into core type, auxiliary type and optional type; based on the loading priority, it can be divided into blocking type, asynchronous type and delayed type.

[0087] For unknown domains, temporary classification can be performed by setting rules. For example, the difference between the domain and the main site can be calculated. If the difference is small, it can be determined directly. Resource path patterns can also be analyzed, and types with the same or similar resource path patterns can be used as script types.

[0088] The process of generating performance data corresponding to the third-party script based on the script type in this application will be described in detail below.

[0089] Obtain the key timing points corresponding to this third-party script;

[0090] Calculate the basic metrics of the third-party script based on the key time points mentioned above;

[0091] Based on the aforementioned basic indicators, the impact range of the first screen time, the estimated main thread usage, and the network efficiency ratio are determined.

[0092] Determine the time window and page session dimensions;

[0093] The performance data corresponding to the third-party script is obtained by aggregating the impact range of the first screen time, the estimated main thread usage, and the network efficiency ratio based on the script type, time window, and page session dimension.

[0094] Specifically, this application achieves standardized and high-precision data collection by obtaining key timing points of third-party scripts. The key timing points are derived from standard browser Performance APIs, ensuring the accuracy and consistency of the data source. Key timing points include the start of redirection, the end of DNS query, and the end of response. Therefore, various basic metrics of the third-party script can be calculated based on the key timing points, including DNS latency and TCP connection latency. Then, based on the basic metrics, key performance metrics can be calculated in conjunction with Navigation Timing, including the impact range of first-screen time, main thread usage estimation, and network efficiency ratio. These key performance metrics are then aggregated using time windows and page session dimensions to obtain performance data.

[0095] Among them, the first-screen time impact range quantifies the direct impact on core user experience metrics. It no longer looks at how long the script itself takes to load in isolation, but assesses the degree to which it delays or speeds up the display of the first-screen content. For example, a script may load very quickly on its own, but some external factors affect this loading speed, including synchronous execution, injection of large style sheets, etc., which seriously block rendering. In this case, the first-screen time impact range can clearly show the impact of these external factors.

[0096] Even if a script file is small, if it contains complex calculations or inefficient DOM operations, its main thread usage can be high. Therefore, this application uses main thread usage estimation to represent the destructive power of a script on page responsiveness, which can cause page lag and input delay. The main thread usage estimation can be calculated by estimating or actually measuring the execution time of the script and long-running tasks.

[0097] Network efficiency ratio refers to the resource utilization efficiency and economic cost of a script. It quantifies transmission efficiency by comparing the effective content transmission time with the total loading time, or by calculating the script size / (total loading time × bandwidth). A script with a low network efficiency ratio may indicate that it is uncompressed or has an incorrect caching strategy configuration, which not only affects itself but also consumes bandwidth for other critical resources.

[0098] A time window can refer to a historical period such as the past 12 hours or the past three days. It is understandable that data from a single page load may be affected by accidental factors such as network jitter and is not representative. Therefore, only by aggregating data over a period of time can we obtain stable and reliable performance data.

[0099] Page session dimensions refer to data categorized by URL pattern, user location, device type, etc. This type of data enables precise location and segmentation of performance issues.

[0100] The following embodiments provide a detailed explanation of the steps in this application for evaluating the performance of the third-party script based on the aforementioned correlation and performance data to obtain a comprehensive performance score.

[0101] Match the corresponding rule subset from the preset rule set based on the script type of the third-party script;

[0102] The third-party script is matched against each rule in the rule subset to obtain the performance sub-score of the third-party script under each rule.

[0103] The initial score is obtained by weighted summation of the performance sub-scores under each of the aforementioned rules.

[0104] The initial score is modified using the correlation to obtain a comprehensive performance score.

[0105] The specific steps for modifying the initial score using the correlation described above to obtain the comprehensive performance score are as follows:

[0106] The initial weight matrix is ​​defined based on the number of third-party scripts and the correlation.

[0107] Analyze the criticality of each of the aforementioned third-party scripts;

[0108] The initial weight matrix is ​​dynamically adjusted based on the criticality to obtain the target weight matrix;

[0109] Determine the weights in the target weight matrix that correspond to the third-party script;

[0110] The initial score is modified using the weights to obtain a comprehensive performance score.

[0111] Specifically, the rule set is configured with evaluation rules for different data and performance under various environments and conditions. The third-party scripts will have multiple rules that need to be matched. Therefore, each rule can be selected from the rule set and then matched to obtain the performance score under each rule. These performance scores are then weighted and summed to obtain the initial score. Since there is a correlation between the various third-party scripts, the initial score can be corrected using the correlation to obtain an accurate comprehensive performance score.

[0112] In the specific correction process, the initial weight matrix is ​​first defined according to the number of scripts, reflecting the topology of the dependency network between scripts and identifying those scripts located at the center of the network. Then, the criticality of each third-party script is analyzed. Criticality is an advanced indicator that integrates the script type, the number of scripts it depends on, and the criticality of the scripts that depend on it. A script that is depended on by multiple scripts has a relatively high criticality. Finally, the initial weight matrix is ​​dynamically adjusted based on the criticality, which involves quantifying the criticality calculated in the previous step and injecting it into the weight matrix.

[0113] Optionally, the step of identifying the source anomaly of the third-party script based on the aforementioned correlation includes:

[0114] Identify significant deviations in the performance data;

[0115] Based on the performance data, identify the abnormal timing of the third-party script;

[0116] Based on the aforementioned correlation, identify any collaboration anomalies between the various third-party scripts;

[0117] A comprehensive analysis of the significant deviations, abnormal patterns, and collaborative anomalies is conducted to identify the source anomaly.

[0118] Specifically, in the process of analyzing the source of anomalies, the first step is to identify significant deviations in the performance data, which are the obvious points of anomaly. Then, the timing of the anomalies is identified based on the performance data. Furthermore, collaborative anomalies between various third-party scripts are identified based on their correlations. Thus, a comprehensive analysis can be conducted using significant deviations, anomaly patterns, and collaborative anomalies to determine the source of the anomaly.

[0119] Furthermore, the process of determining the resource level of the third-party script based on the comprehensive performance score, source anomalies, and performance change trends may include the following steps:

[0120] Get the base level of this third-party script;

[0121] Determine the criticality of the third-party script, and determine whether the third-party script meets the non-downgrade condition based on the script type and criticality.

[0122] If so, then the base level will be used as the resource level of the third-party script;

[0123] If not, the level range of the third-party script is determined based on the comprehensive performance score. If the basic level is within the level range, the basic level is taken as the resource level of the third-party script.

[0124] If it is not within the range of the stated level, the base level is modified according to the source anomaly and performance change trend to obtain the resource level.

[0125] Specifically, the above process introduces the principle of business priority. That is to say, some third-party resources have hard conditions that cannot be downgraded. Therefore, their basic level can be directly obtained and used as the resource level, thereby preventing functional failures caused by over-optimization.

[0126] For third-party scripts that do not meet the condition of being non-downgradeable, logical judgment is required:

[0127] If the base level is within the specified range, it indicates that the script's business importance and technical performance are commensurate. It's normal for an important script to run well, or for a less important script to perform only moderately; in such cases, the base level can be directly used as the final resource level to be determined.

[0128] If the base level is not within the level range, this application does not perform a simple downgrade or upgrade. Instead, it analyzes the source anomaly and performance change trend, that is, it guides the direction of correction based on the root cause analysis of the source anomaly. If the source anomaly is temporary and external, it can be temporarily downgraded or re-evaluated using other methods, rather than directly defining the resource level to prevent too large an error. If the source anomaly is permanent and internal, the base level is downgraded directly.

[0129] Performance trends can predict future changes, so preventative grading can be implemented based on these trends. For example, if the performance trend is deteriorating, the base level can be appropriately lowered to avoid problems. If the performance trend is optimizing, a script that is currently performing poorly but is rapidly improving can maintain the base level, while a script that has always performed well can have its base level appropriately increased to a resource level.

[0130] During the downgrade process, in addition to the quantitative reduction in resource levels, the corresponding levels of the scripts will also be reduced. For example, replacing them with lightweight CDN links, enabling Gzip compression, delaying loading to idle periods, changing asynchronous loading to delayed loading, disabling non-core functions, and replacing them with static placeholders, etc. Specifically:

[0131] The system dynamically modifies script tag attributes via the DOM API, intercepts resource requests and returns cached responses using Service Workers, and wraps native functions in a proxy pattern for loaded scripts to achieve runtime functionality degradation. A state manager maintains the degradation session state, including the current degradation strategy, effective time, list of affected scripts, and user-perceived metrics. Additionally, a degradation rollback mechanism is configured to automatically revert the degradation action and restore the original script's resource level when performance recovers or degradation triggers new issues.

[0132] After downgrading, you can compare the changes in performance metrics before and after the script downgrade, such as changes in loading time, FCP, CPU utilization, etc. At the same time, you can evaluate the business impact through user behavior analysis (such as click-through rate, conversion rate, etc.), and then dynamically adjust subsequent operations based on changes in performance metrics. If performance improves, maintain the downgrade strategy or strengthen the downgrade strategy; if performance degrades, analyze and develop a new strategy to achieve flexibility.

[0133] and Figure 1 Corresponding to the method described above, this embodiment of the invention also provides a resource level detection device for third-party scripts, used for... Figure 1 In the specific implementation of the method, the resource level detection device for third-party scripts provided in this embodiment of the invention can be used on computer terminals or various mobile devices, in conjunction with... Figure 2 This section introduces resource level detection devices for third-party scripts, such as... Figure 2 As shown, the device may include:

[0134] The script type determination module 10 is used to separate each third-party script in the third-party script resources, and for each third-party script, classify the third-party script to obtain the script type of the third-party script.

[0135] The performance data generation module 20 is used to generate performance data corresponding to the third-party script based on the script type.

[0136] The performance score calculation module 30 is used to analyze the correlation between the various third-party scripts, and to evaluate the performance of the third-party scripts based on the correlation and performance data to obtain a comprehensive performance score.

[0137] The performance change trend prediction module 40 is used to identify the source anomaly of the third-party script according to the correlation and predict the performance change trend of the third-party script.

[0138] Resource level determination module 50 is used to determine the resource level of the third-party script based on the comprehensive performance score, source anomaly, and performance change trend.

[0139] As can be seen from the above technical solution, this application separates each third-party script from the third-party script resource, classifies each third-party script to obtain its script type, generates performance data corresponding to the script type, analyzes the correlation between each third-party script, and evaluates the performance of each third-party script based on the correlation and performance data to obtain a comprehensive performance score, identifies the source anomaly of the third-party script according to the correlation, and predicts the performance change trend of the third-party script, and determines the resource level of the third-party script based on the comprehensive performance score, source anomaly, and performance change trend. Since there are multiple third-party scripts in the third-party script resource, this application first separates each third-party script from the third-party script resource, then classifies each third-party script to obtain its script type, and then analyzes the performance data based on the script type. Since these third-party scripts all exist in one third-party script resource, there will be some correlation between them. Therefore, analyzing the correlation between each third-party script to obtain a performance score is one type of data used for resource level detection. In addition, source anomalies of the third-party script can be identified based on the correlation, and the performance change trend of the third-party script can be identified, thereby determining the resource level of the third-party script based on these three types of data.

[0140] Furthermore, embodiments of this application provide a resource-level detection device based on a third-party script. Optionally, Figure 3The diagram shows the hardware structure of the resource level detection device based on a third-party script. Figure 3 The hardware structure of a resource level detection device for third-party scripts may include: at least one processor 01, at least one communication interface 02, at least one memory 03, and at least one communication bus 04.

[0141] In this embodiment, the number of processor 01, communication interface 02, memory 03 and communication bus 04 is at least one, and processor 01, communication interface 02 and memory 03 communicate with each other through communication bus 04.

[0142] Processor 01 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.

[0143] Memory 03 may include high-speed RAM, and may also include non-volatile memory, such as at least one disk storage device.

[0144] The memory stores a program that the processor can call. The program executes the resource level detection method of the following third-party scripts, including:

[0145] Separate each third-party script from the third-party script resources, and for each third-party script, classify it to obtain the script type of the third-party script;

[0146] Based on the script type, generate performance data corresponding to the third-party script;

[0147] Analyze the correlation between the various third-party scripts, and evaluate the performance of each third-party script based on the correlation and performance data to obtain a comprehensive performance score;

[0148] Identify the source anomaly of the third-party script based on the aforementioned correlation, and predict the performance change trend of the third-party script;

[0149] The resource level of the third-party script is determined based on the comprehensive performance score, source anomalies, and performance change trends.

[0150] Optionally, the refined and extended functions of the program can be found in the description of the resource level detection method for third-party scripts in the method embodiments.

[0151] This application embodiment also provides a storage medium that can store a program suitable for processor execution, wherein the program, when running, controls the device where the storage medium is located to execute the following resource level detection method using a third-party script, including:

[0152] Separate each third-party script from the third-party script resources, and for each third-party script, classify it to obtain the script type of the third-party script;

[0153] Based on the script type, generate performance data corresponding to the third-party script;

[0154] Analyze the correlation between the various third-party scripts, and evaluate the performance of each third-party script based on the correlation and performance data to obtain a comprehensive performance score;

[0155] Identify the source anomaly of the third-party script based on the aforementioned correlation, and predict the performance change trend of the third-party script;

[0156] The resource level of the third-party script is determined based on the comprehensive performance score, source anomalies, and performance change trends.

[0157] Specifically, the storage medium can be a computer-readable storage medium, which can be an electronic storage device such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM.

[0158] Optionally, the refined and extended functions of the program can be found in the description of the resource level detection method for third-party scripts in the method embodiments.

[0159] Furthermore, the functional modules in the various embodiments of this disclosure can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part. If the function is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a live streaming device, or a network device, etc.) to execute all or part of the steps of the methods in the various embodiments of this disclosure.

[0160] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0161] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0162] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A resource level detection method using a third-party script, characterized in that, include: Separate each third-party script from the third-party script resources, and for each third-party script, classify it to obtain the script type of the third-party script; Based on the script type, generate performance data corresponding to the third-party script; including: obtaining key time points corresponding to the third-party script; calculating various basic indicators of the third-party script based on the key time points; determining the first-screen time impact range, main thread usage estimate, and network efficiency ratio based on each of the basic indicators; determining the time window and page session dimension; and aggregating the first-screen time impact range, main thread usage estimate, and network efficiency ratio according to the script type, time window, and page session dimension to obtain the performance data corresponding to the third-party script. Analyze the relationships between the various third-party scripts, and evaluate the performance of each third-party script based on the relationships and performance data to obtain a comprehensive performance score; Identify the source anomaly of the third-party script based on the aforementioned correlation, and predict the performance change trend of the third-party script; The resource level of the third-party script is determined based on the comprehensive performance score, source anomalies, and performance change trends. This includes: obtaining the base level of the third-party script; determining the criticality of the third-party script, and determining whether the third-party script meets the non-downgrade condition based on the script type and criticality; if yes, the base level is used as the resource level of the third-party script; if not, the level range of the third-party script is determined based on the comprehensive performance score; if the base level is within the level range, the base level is used as the resource level of the third-party script; if it is not within the level range, the base level is modified according to the source anomalies and performance change trends to obtain the resource level.

2. The method according to claim 1, characterized in that, The process of classifying the third-party script to obtain its script type includes: Determine the URL of the third-party script; Searching in a pre-created third-party domain name database based on the URL; If the URL is contained in the third-party domain name database, the third-party script is classified using the third-party domain name database to obtain the script type; If the URL is not contained in the third-party domain name database, the third-party script is temporarily classified to obtain the script type.

3. The method according to claim 1, characterized in that, The performance evaluation of the third-party script based on the correlation and performance data yields a comprehensive performance score, including: Match the corresponding rule subset from the preset rule set based on the script type of the third-party script; The third-party script is matched against each rule in the rule subset to obtain the performance sub-score of the third-party script under each rule. The initial score is obtained by weighted summation of the performance sub-scores under each of the aforementioned rules. The initial score is modified using the correlation to obtain a comprehensive performance score.

4. The method according to claim 3, characterized in that, The process of modifying the initial score using the correlation to obtain a comprehensive performance score includes: The initial weight matrix is ​​defined based on the number of third-party scripts and the correlation. Analyze the criticality of each of the aforementioned third-party scripts; The initial weight matrix is ​​dynamically adjusted based on the criticality to obtain the target weight matrix; Determine the weights in the target weight matrix that correspond to the third-party script; The initial score is modified using the weights to obtain a comprehensive performance score.

5. The method according to claim 1, characterized in that, The method of identifying the source anomaly of the third-party script based on the aforementioned correlation includes: Identify significant deviations in the performance data; Based on the performance data, identify the abnormal timing of the third-party script; Based on the aforementioned correlation, identify any collaboration anomalies between the various third-party scripts; A comprehensive analysis of the significant deviations, abnormal patterns, and collaborative anomalies is conducted to identify the source anomaly.

6. A resource level detection device for a third-party script, characterized in that, include: The script type determination module is used to separate each third-party script in the third-party script resources, and for each third-party script, classify the third-party script to obtain the script type of the third-party script; The performance data generation module is used to generate performance data corresponding to the third-party script based on the script type; including: obtaining key time-series points corresponding to the third-party script; calculating various basic indicators of the third-party script based on the key time-series points; determining the first-screen time impact range, main thread usage estimate, and network efficiency ratio based on the various basic indicators; determining the time window and page session dimension; and aggregating the first-screen time impact range, main thread usage estimate, and network efficiency ratio according to the script type, time window, and page session dimension to obtain the performance data corresponding to the third-party script. The performance scoring calculation module is used to analyze the correlation between the various third-party scripts, and to evaluate the performance of the third-party scripts based on the correlation and performance data to obtain a comprehensive performance score. The performance change trend prediction module is used to identify the source anomaly of the third-party script according to the correlation and predict the performance change trend of the third-party script. The resource level determination module is used to determine the resource level of the third-party script based on the comprehensive performance score, source anomalies, and performance change trends. This includes: obtaining the base level of the third-party script; determining the criticality of the third-party script, and determining whether the third-party script meets the non-downgradeable condition based on the script type and criticality; if yes, then the base level is used as the resource level of the third-party script; if not, then the level range of the third-party script is determined based on the comprehensive performance score; if the base level is within the level range, then the base level is used as the resource level of the third-party script; if it is not within the level range, then the base level is modified according to the source anomalies and performance change trends to obtain the resource level.

7. A resource level detection device using a third-party script, characterized in that, Including memory and processor; The memory is used to store programs; The processor is configured to execute the program to implement each step of the resource level detection method for third-party scripts as described in any one of claims 1-5.

8. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements each step of the resource level detection method for third-party scripts as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Front-end performance intelligent optimization method and device, electronic equipment and storage medium

    CN120295879A

  • Webpage resource preloading method and system based on multi-factor dynamic evaluation

    CN120508722A