System gray release based on product value distribution automatic testing method and device
By automatically selecting and dynamically calculating the value distribution range, and by parallel computing and sharpening the difference rate of the range values, the problem of frequent adjustments to the manually configured return value range and the incomparability of sub-product differences in canary releases has been solved, thereby improving the efficiency of automated testing and the ability to identify risks.
Patent Information
- Application Number
- CN202511518225.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-23
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2045-10-23
AI Technical Summary
Existing technologies require extensive manual configuration of return value ranges during canary releases. These ranges need frequent adjustments, and the differences between sub-products lack comparability, impacting the efficiency of automated testing and risk identification capabilities.
By using an automated testing method based on product value distribution, the system automatically selects sub-products that meet the configuration conditions, dynamically calculates the value distribution range, calculates the difference rate of the range value proportion in parallel, performs call volume and proportion sharpening processing, identifies the value range and sub-product with the largest difference, and generates a risk warning report.
It reduces the workload of manual configuration, ensures that the analyzed samples are statistically significant, improves processing efficiency and the accuracy of risk identification, and comprehensively captures potential risk points during grayscale by combining the average sharpening difference rate of merged groups and the sharpening difference rate of single intervals.
Smart Images

Figure CN120994570B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of software testing, in particular to a product value distribution-based automatic testing method and device in system gray release, which is used for automatically identifying potential problems and risks in the process of software system gray release. BACKGROUND
[0002] In the field of modern software development, gray release is a commonly used software iteration online strategy, which aims to reduce system change risk by gradually pushing new versions to part of the users. In the process of gray release, the automatic testing system plays a crucial role, which can monitor the system running state and discover potential problems in time.
[0003] The current automatic testing technology mainly identifies risks by comparing the differences of various indicators between the gray system and the original system. Especially for product systems with enumerable API return values, the return value enumeration interval is usually set, and the difference between the return value proportion of each interval in the gray period and the previous period is calculated to determine whether the system has abnormalities. For example, a cloud service platform will configure return value intervals for each API service, and monitor the changes of these intervals to determine whether the new version has problems.
[0004] A more typical method in the prior art is to manually pre-configure the return value enumeration and enumeration interval of each sub-product, and the automatic testing system calculates the return value proportion of each interval in the previous N days before gray release, and then calculates the return value proportion of each interval in the gray period, and then calculates the difference between the two, and identifies the sub-products with the largest difference as potential risk points.
[0005] However, this method has obvious limitations. First, when the number of sub-products is large, a large amount of manual work is needed to configure the return value interval; second, as time goes by and the production environment changes, the configured return value interval may no longer be applicable and needs to be adjusted frequently; third, the difference in the return value proportion of each interval of each sub-product calculated by the automatic system still needs manual judgment to determine whether there is an actual problem, and the differences between different sub-products lack effective comparability. Therefore, these problems seriously affect the efficiency, problem discovery and risk identification ability of automatic testing in the process of gray release. SUMMARY
[0006] The purpose of the present application is to provide a product value distribution-based automatic testing method and device in system gray release, which aims to solve the problem that the efficiency, problem discovery and risk identification ability of automatic testing in the process of gray release are seriously affected due to the need for a large amount of manual configuration of return value intervals, frequent adjustment of interval configuration and lack of comparability between sub-products.
[0007] To achieve the above object, in the first aspect, the application provides an automatic testing method based on product value distribution in system gray release, comprising:
[0008] Based on the obtained preset calling quantity threshold, the first calling quantity data and the second calling quantity data of each sub-product in the previous N days and during the gray period are queried, and the sub-products whose first calling quantity data and second calling quantity data both exceed the corresponding calling quantity threshold are screened out to form a list of sub-products to be tested, wherein the calling quantity threshold includes a calling quantity threshold in the previous N days and a calling quantity threshold during the gray period,
[0009] Based on the API calling return value of each target sub-product in the previous N days in the list of sub-products to be tested, value interval division is performed according to the API calling return value, a preset central interval target calling quantity proportion value and a target interval number of execution value interval, and the value interval of each target sub-product is generated;
[0010] The first calling quantity proportion value and the second calling quantity proportion value are calculated by multi-thread parallel computing, and the difference rate of the calling quantity proportion value of each value interval in the two time periods is calculated based on the first calling quantity proportion value and the second calling quantity proportion value as original difference rate data, wherein the first calling quantity proportion value is used to indicate that the calling quantity of the target sub-product in each value interval accounts for a percentage of the total calling quantity of the target sub-product, and the second calling quantity proportion value is used to indicate that the calling quantity of the target sub-product in each value interval accounts for a percentage of the total calling quantity;
[0011] Based on the gray period calling quantity of each target sub-product in each value interval during the gray period, the original difference rate data is subjected to calling quantity sharpening processing to obtain calling quantity sharpened difference rate data, and the calling quantity sharpened difference rate data and the first calling quantity proportion value are subjected to proportion value sharpening processing to obtain sharpened difference rate data;
[0012] Based on the sharpened difference rate data, the group average sharpened difference rate of each target sub-product is calculated, the a target sub-products whose group average sharpened difference rate is in the front are identified, and the b value intervals whose sharpened difference rate data is in the front are screened out, the identified target sub-products and the target sub-products corresponding to the screened value intervals are merged and de-duplicated to generate a high-risk sub-product list and a corresponding risk prompt report, wherein the group average sharpened difference rate is used to indicate the average value of the sharpened difference rate data of all value intervals of a single sub-product, .
[0013] In some embodiments, the value interval of each target sub-product is generated according to the API call return value of each target sub-product in the list of sub-products to be tested in the previous N days, value interval division according to the API call return value, a preset central interval target call amount proportion value, and a target interval number, including:
[0014] Query the API call return value of each target sub-product in the list of sub-products to be tested in the previous N days, and arrange the API call return value in ascending order to form a return value array;
[0015] Filter the possible intervals that meet the central interval target call amount proportion value from the return value array, and select the possible interval that minimizes the return value range as the central interval;
[0016] According to the central interval target call amount proportion value and the target interval number, determine the target proportion value of each interval;
[0017] Take the central interval as a reference, and expand to the left and right according to the target proportion value to determine other intervals, until the number of intervals reaches the target interval number, and the value interval of each target sub-product is obtained.
[0018] In some embodiments, the first call amount proportion value and the second call amount proportion value are calculated by multi-thread parallel computing, and the difference rate of the value interval call amount proportion value of the two time periods is calculated based on the first call amount proportion value and the second call amount proportion value as the original difference rate data, including:
[0019] Create a thread pool according to the available resources of the system, and allocate an independent computing thread for each target sub-product in the thread pool;
[0020] In the computing thread of each target sub-product, query the historical call amount of each value interval of the target sub-product in the previous N days, and calculate the proportion of the historical call amount of each value interval to the total call amount as the first call amount proportion value;
[0021] In the computing thread, query the gray period call amount of each value interval of the target sub-product during the gray period, and calculate the proportion of the gray period call amount of each value interval to the total call amount as the second call amount proportion value;
[0022] For the value interval of each target sub-product, the difference rate of the interval call amount proportion value between the gray period and the previous N days is calculated according to the first call amount proportion value and the second call amount proportion value, and the original difference rate data is obtained by aggregating the calculation results of each computing thread.
[0023] In some embodiments, the original difference rate data is subjected to call quantity sharpening processing based on the call quantity of each value interval during the grayscale period of each target sub-product, to obtain call quantity sharpened difference rate data, including:
[0024] The call quantity during the grayscale period of all target sub-products is sorted from small to large, and the call quantity during the grayscale period at the median of the sorting is selected as a reference call quantity;
[0025] If the call quantity during the grayscale period of the target sub-product is greater than the reference call quantity, a first sharpening parameter calculation model is used to calculate the call quantity during the grayscale period and the reference call quantity, to obtain a first sharpening parameter; otherwise, a second sharpening parameter calculation model is used to calculate the call quantity during the grayscale period and the reference call quantity, to obtain a second sharpening parameter; wherein the second sharpening parameter is the inverse of the first sharpening parameter, and the sharpening parameter is one of the first sharpening parameter and the second sharpening parameter;
[0026] The original difference rate data is subjected to call quantity sharpening processing according to the sharpening parameter, to obtain call quantity sharpened difference rate data.
[0027] In some embodiments, the call quantity sharpened difference rate data and the first call quantity proportion value are subjected to proportion value sharpening processing, to obtain sharpened difference rate data, including:
[0028] The first call quantity proportion value of all value intervals of all target sub-products is sorted from small to large, and the first call quantity proportion value at the median of the sorting is taken as a reference proportion value;
[0029] For each value interval of each target sub-product, a ratio between the first call quantity proportion value and the reference proportion value is calculated, and a sharpening coefficient is calculated according to a configured proportion value sharpening percentage;
[0030] For a value interval of the target sub-product in which the first call quantity proportion value is greater than the reference proportion value, a first sharpening coefficient calculation model is used to calculate the ratio and a preset proportion value sharpening percentage, to obtain a first sharpening coefficient;
[0031] For a value interval of the target sub-product in which the first call quantity proportion value is not greater than the reference proportion value, a second sharpening coefficient calculation model is used to calculate the ratio and a preset proportion value sharpening percentage, to obtain a second sharpening coefficient, wherein the sharpening coefficient is one of the first sharpening coefficient and the second sharpening coefficient;
[0032] The call quantity sharpened difference rate data is subjected to proportion value sharpening processing according to the sharpening coefficient, to obtain the sharpened difference rate data.
[0033] In some embodiments, the value interval of each target sub-product is generated based on the API call return value of each target sub-product in the list of sub-products to be tested in the past N days, value interval division according to the API call return value, a preset central interval target call amount proportion value, and a target interval number of execution values, and further comprising:
[0034] The API call return value of the target sub-product in the past N days is constructed into a streaming data graph, wherein each vertex in the streaming data graph represents an API call return value, and the weight of an edge in the streaming data graph represents the frequency difference between two adjacent API call return values;
[0035] The return value frequency information of the API call return value is compressed and stored using a counting sketch data structure to optimize the streaming data graph, so that the space complexity of the optimized streaming data graph is reduced from a linear level to a logarithmic level;
[0036] In a single data stream scan, a path is constructed using a preset approximation factor, wherein the path represents a natural clustering interval of the API call return value, and the length of the path is determined by the approximation factor and the length of the longest path in the optimized streaming data graph;
[0037] From the constructed multiple paths, paths that meet the path requirements related to the central interval target call amount proportion value are selected, and the selected paths are divided according to the target interval number according to a preset segmentation strategy, which is used to indicate the selection of segmentation points that minimize the total difference of each interval from the target proportion value;
[0038] The interval boundaries after segmentation are fine-tuned so that the actual proportion value of each interval after segmentation is less than a preset difference threshold from the preset target proportion value distribution, and the value interval of each target sub-product is obtained.
[0039] In some embodiments, the first call amount proportion value and the second call amount proportion value are calculated by multi-thread parallel computing, and the difference rate of the value interval call amount proportion values in the two time periods is calculated based on the first call amount proportion value and the second call amount proportion value as the original difference rate data, further comprising:
[0040] A first graph structure is constructed based on the first call amount proportion value of each target sub-product, wherein a node in the first graph structure represents a value interval, and an edge in the first graph structure represents the relationship between the first call amount proportion values corresponding to adjacent value intervals;
[0041] A second graph structure is constructed based on the second call amount proportion value of each target sub-product, wherein a node in the second graph structure represents a value interval, and an edge in the second graph structure represents the relationship between the second call amount proportion values corresponding to adjacent value intervals;
[0042] adopting a preset semi-streaming strategy to perform parallel processing on the first graph structure and the second graph structure corresponding to all target sub-products, so as to find a target path with the largest difference between the first graph structure and the second graph structure, the semi-streaming strategy being used to indicate that only key intermediate results are saved;
[0043] calculating an interval proportion difference rate based on the target path, mapping the target path to overall changes of an interval sequence, and identifying an interval distribution change mode;
[0044] summarizing a path difference analysis result composed of the interval proportion difference rate and the interval distribution change mode, and obtaining the original difference rate data.
[0045] In some embodiments, the method further includes performing call quantity sharpening processing on the original difference rate data based on the call quantity of each value interval of each target sub-product during the gray period, to obtain call quantity sharpened difference rate data.
[0046] establishing a Gaussian process regression model for each target sub-product, wherein the input of the Gaussian process regression model includes the call quantity during the gray period and the first call quantity proportion value, and the target variable of the Gaussian process regression model is the original difference rate data;
[0047] determining a multi-objective optimization function, wherein the multi-objective optimization function includes a difference rate detection model and a false positive rate model composed of a sharpening parameter vector, the sharpening parameter vector including the sharpening coefficient and the sharpening coefficient, and the multi-objective optimization function is used to indicate that the difference rate detection model is maximized and the false positive rate model is minimized;
[0048] determining a trust region constraint for limiting the variation range of parameters in each optimization iteration;
[0049] using a preset Bayesian optimization algorithm to iteratively optimize the sharpening parameter vector based on the Gaussian process regression model and the multi-objective optimization function under the condition of the trust region constraint until convergence or a preset number of iterations is reached;
[0050] performing data enhancement on the sharpening parameter vector and the original difference rate data after iteration, to optimize the call quantity sharpened difference rate data.
[0051] In some embodiments, the method further includes:
[0052] identifying implicit confounding factors in a gray environment, the implicit confounding factors including user access pattern changes, network environment fluctuations, and dependent service performance changes;
[0053] adopting a preset two-stage least squares method algorithm to establish a causal inference model, wherein a first stage of the causal inference model is used to indicate prediction of a gray state using a quasi-instrumental variable related to the implicit confounding factor, and a second stage of the causal inference model is used to indicate estimation of a true causal effect on a return value distribution using a predicted value of the gray state;
[0054] based on the original difference rate data and difference rate adjustment data, calculating a confounding sensitivity index of each target sub-product, wherein the difference rate adjustment data is obtained by adjusting the original difference rate data by the causal inference model;
[0055] based on the confounding sensitivity index, calculating a causal weight;
[0056] causally enhancing and sharpening the causal weight and the sharpened difference rate data to form a causal enhancement risk assessment result;
[0057] based on the causal enhancement risk assessment result, dividing the identified risk points into high-confidence causal risks, possible causal risks, and correlation risks to generate the high-risk sub-product list and a corresponding risk prompt report.
[0058] In a second aspect, the present application also provides an automatic testing device for product value distribution-based system gray release, comprising:
[0059] a to-be-tested sub-product screening module, configured to query first calling amount data of each sub-product in the previous N days and second calling amount data during the gray period based on a preset calling amount threshold obtained, and screen out sub-products whose first calling amount data and second calling amount data both exceed the corresponding calling amount threshold to form a to-be-tested sub-product list, wherein the calling amount threshold includes a previous N-day calling amount threshold and a gray-period calling amount threshold, ;
[0060] a value interval division module, configured to perform value interval division according to API calling return values of each target sub-product in the to-be-tested sub-product list in the previous N days, a preset central interval target calling amount proportion value, and a target interval number execution value interval, to generate a value interval of each target sub-product;
[0061] The difference calculation module is configured to calculate a first call amount proportion value and a second call amount proportion value in parallel through multi-threading, and calculate a difference rate of the call amount proportion value of each value interval in the two time periods based on the first call amount proportion value and the second call amount proportion value, as original difference rate data, wherein the first call amount proportion value is used to indicate the percentage of the call amount of each value interval of the target sub-product in the previous N days in the total call amount of the target sub-product, and the second call amount proportion value is used to indicate the percentage of the call amount of each value interval of the target sub-product in the gray period in the total call amount.
[0062] The sharpening processing module is configured to perform call amount sharpening processing on the original difference rate data based on the call amount of each value interval of each target sub-product in the gray period, to obtain call amount sharpened difference rate data, and perform proportion value sharpening processing based on the call amount sharpened difference rate data and the first call amount proportion value, to obtain sharpened difference rate data.
[0063] The risk identification module is configured to calculate a group average sharpened difference rate of each target sub-product based on the sharpened difference rate data, identify a first a target sub-product in the order of the group average sharpened difference rate, and filter a first b value interval in the order of the sharpened difference rate data, and merge and remove the identified target sub-products and the target sub-products corresponding to the filtered value intervals, to generate a high-risk sub-product list and a corresponding risk prompt report. , .
[0064] The system gray release automatic testing method and device based on product value distribution provided by the application can automatically select sub-products meeting the configuration conditions for analysis, reduce the manual screening workload, ensure that the analysis samples have statistical significance, dynamically calculate the value distribution interval for each sub-product, avoid the cumbersome process of manual pre-configuration of the interval, ensure that the value interval division is more in line with the current data distribution characteristics, improve the processing efficiency by using multi-thread parallel calculation, can quickly process a large amount of sub-product data, and make the difference rates between different sub-products and different intervals comparable through call amount sharpening and proportion value sharpening, improve the accuracy of risk identification, and then combine the risk identification results of the group average sharpened difference rate and the single interval sharpened difference rate in two dimensions, to comprehensively capture the possible risk points in the gray period. BRIEF DESCRIPTION OF DRAWINGS
[0065] Figure 1 The flowchart of the system gray release automatic testing method based on product value distribution provided by the embodiment of the application;
[0066] Figure 2 A detailed flowchart for performing value interval division in an embodiment of the present application;
[0067] Figure 3 A detailed flowchart for calculating original difference rate data in an embodiment of the present application;
[0068] Figure 4 A structural diagram of an automatic testing device based on product value distribution in system gray release provided by an embodiment of the present application. DETAILED DESCRIPTION
[0069] The present application aims to provide a system gray release automatic testing method and device based on product value distribution, which automatically selects sub-products meeting the conditions, dynamically calculates value distribution intervals, calculates interval value proportion difference rates in parallel, sharpens the difference rates, and selects the value interval and sub-product with the largest difference from the sharpened difference rate data for risk prompt, thereby solving the technical problems of the prior art, such as the need for a large amount of manual return value interval configuration, frequent interval configuration adjustment, and lack of comparability between sub-products.
[0070] The system gray release automatic testing method based on product value distribution provided by the embodiment of the present application mainly includes: automatically selecting sub-products meeting the configuration conditions for analysis, dynamically calculating value distribution intervals for each sub-product, calculating interval value proportion values and difference rates of each sub-product in parallel, sharpening the difference rates according to the calling amount and interval value proportion values of each sub-product, and selecting the value interval and sub-product with the largest difference from the sharpened difference rate data for risk prompt. Figure 1 As shown in the figure, the system gray release automatic testing method based on product value distribution includes the following steps S1 to S5.
[0071] S1. Based on the obtained preset calling amount threshold, query the first calling amount data of each sub-product in the previous N days and the second calling amount data in the gray period, and filter out the sub-products whose first calling amount data and second calling amount data both exceed the corresponding calling amount threshold, to form a list of sub-products to be tested, wherein the calling amount threshold includes a previous N-day calling amount threshold and a gray period calling amount threshold, .
[0072] It should be noted that the automatic testing method provided in the present application first needs to establish an analysis basis by pre-setting two key thresholds: a call volume threshold in the first N days before the gray release and a call volume threshold during the gray release period, which ensures that only statistically significant sub-product data is analyzed. When starting, the call volume of each sub-product in the first N days before the gray release (first call volume data) and the call volume during the gray release period (second call volume data) are queried and filtered, and only sub-products with call volumes in both time periods exceeding the respective thresholds are retained. Among them, sub-products with too little call volume have little significance in statistical analysis, and a small amount of returned value change can cause a huge fluctuation in the difference rate, thereby producing misleading results. Here, N is a configurable parameter, usually greater than or equal to 1, representing the number of days before the gray release whose data is used as a benchmark for comparison.
[0073] S2. Based on the API call return value of each target sub-product in the list of sub-products to be tested in the first N days, value interval division is performed according to the API call return value, a preset central interval target call volume proportion value, and a target interval number, to generate a value interval for each target sub-product.
[0074] In the present application, after filtering, a value interval distribution is dynamically calculated for each target sub-product. That is, the API return value range of each sub-product is divided into several meaningful intervals, rather than using fixed or pre-configured intervals. All API call return value data of the target sub-product in the first N days are analyzed, and a preset central interval target call volume proportion value (such as 20% or 50%) and a target interval number (such as 9 intervals) are combined to perform an adaptive value interval division algorithm. Specifically, the present application first determines the central interval, then expands to both sides, ensuring that the divided intervals both conform to the natural distribution of the return value and meet the target proportion value requirement. After value interval division, each sub-product has a customized value interval, and the interval boundaries are completely based on the historical return value distribution characteristics, without the need for manual intervention.
[0075] S3. The first call volume proportion value and the second call volume proportion value are calculated through multi-thread parallel computing, and the difference rate of the call volume proportion value of each value interval in the two time periods is calculated based on the first call volume proportion value and the second call volume proportion value, as the original difference rate data, wherein the first call volume proportion value is used to indicate the percentage of the call volume of the target sub-product in each value interval to the total call volume of the target sub-product, and the second call volume proportion value is used to indicate the percentage of the call volume of the target sub-product in each value interval to the total call volume.
[0076] In the present application, after obtaining the value interval, the multi-thread parallel computing architecture is adopted to process the data analysis tasks of multiple sub-products simultaneously. For each sub-product, the call volume proportion value of each value interval in the previous N days (first call volume proportion value) and the call volume proportion value of each value interval during the gray period (second call volume proportion value) are calculated. Then, by comparing the proportion value difference of the two time periods, the call volume proportion value difference rate of each interval is calculated to form the original difference rate data. The present application significantly improves the computing efficiency by using multi-thread technology, especially when a large number of sub-products need to be analyzed, the multi-core processing capability of modern computers can be fully utilized.
[0077] S4. Based on the gray period call volume of each target sub-product in each value interval during the gray period, the original difference rate data is subjected to call volume sharpening processing to obtain call volume sharpened difference rate data, and based on the call volume sharpened difference rate data and the first call volume proportion value, proportion value sharpening processing is performed to obtain sharpened difference rate data.
[0078] In the present application, although the original difference rate data intuitively reflects the changes, the difference rates between different sub-products lack comparability, because the call volume levels and interval distributions of different sub-products may differ greatly. To solve this problem, the present application introduces an innovative double sharpening processing mechanism. First, call volume sharpening processing is performed to make the difference rates of sub-products with different call volume levels comparable by calculating the ratio to the median call volume and applying logarithmic transformation. Then, proportion value sharpening processing is performed to calculate the sharpening coefficient according to the ratio of the call volume proportion value of each interval in the previous N days to its baseline proportion value, and apply it to the difference rate. Through these two steps of sharpening processing, the present application adjusts the difference rates of different sub-products and different intervals to a fair baseline for comparison, eliminating the interference caused by different call volume and proportion value distributions.
[0079] S5. Based on the sharpened difference rate data, the group average sharpened difference rate of each target sub-product is calculated, the a target sub-products with the highest group average sharpened difference rate are identified, and the b value intervals with the highest sharpened difference rate data are screened out. The identified target sub-products and the target sub-products corresponding to the screened value intervals are merged and de-duplicated to generate a high-risk sub-product list and a corresponding risk prompt report, wherein the group average sharpened difference rate is used to indicate the average value of the sharpened difference rate data of all value intervals of a single sub-product, , .
[0080] In this application, based on the sharpened difference rate data, potential risks are identified from two dimensions. On the one hand, the group average sharpened difference rate of all value intervals of each sub-product is calculated, and the top a sub-products with the highest average difference rate are identified; on the other hand, the top b value intervals with the highest sharpened difference rate and their corresponding sub-products are directly screened out. Then, the results of the two dimensions are combined and de-duplicated to form the final high-risk sub-product list, and a detailed risk prompt report is generated. Through the double-dimensional risk identification, this application can not only find sub-products with significant overall changes, but also capture situations where local intervals change dramatically, and comprehensively cover potential risk points. The detailed information contained in the report, such as sub-product identification, name, high-risk interval range, original difference rate and sharpened difference rate, etc., provides a comprehensive risk assessment basis for system administrators.
[0081] Therefore, this application can completely eliminate the need for manual configuration of return value intervals, and through adaptive value interval division and difference rate sharpening, the risk assessment results between different sub-products are comparable, greatly improving the accuracy and efficiency of risk identification in gray release. The parameters a and b are both configurable, usually taking values greater than or equal to 1, respectively controlling the risk identification range based on sub-product level and interval level, which can be adjusted according to system size and risk tolerance.
[0082] Exemplarily, in another embodiment, the above steps specifically include:
[0083] Step 1: Automatically select sub-products that meet the configured conditions for analysis:
[0084] When the call volume is too small, a small change in the API return value may cause a large difference, and such samples have little significance in statistics and cannot determine whether there is a risk. Therefore, this step first configures sub-product screening thresholds, including the previous N-day call volume threshold MinCallCountPre and the gray period call volume threshold MinCallCountGray, where N is greater than or equal to 1.
[0085] Specifically, this step includes:
[0086] Configure sub-product screening thresholds, set the previous N-day call volume threshold MinCallCountPre and the gray period call volume threshold MinCallCountGray.
[0087] Query the call volume data of all sub-products in the previous N days and the gray period in the system database to form a sub-product call volume mapping table ProductCallMap, which contains each sub-product ID, sub-product name, previous N-day call volume PreCallCount and gray period call volume GrayCallCount.
[0088] Traverse each sub-product in the ProductCallMap, determine whether the call volume of the previous N days and the call volume during the gray period exceed the corresponding threshold value at the same time, filter out the sub-products that meet the conditions PreCallCount>MinCallCountPre and GrayCallCount>MinCallCallGray, and form the ValidProductList.
[0089] Step 2: Dynamically calculate the value distribution interval for each sub-product:
[0090] When the API return value is sufficient, the return value call volume generally presents a normal distribution, and the return value call volume near the middle is relatively large, and the maximum return value and the minimum return value call volume are generally small. This step utilizes this feature to dynamically divide the interval for each sub-product return value range.
[0091] This step specifically includes:
[0092] Configure the value interval division parameters, set the center interval target call volume proportion value CenterRangeRatio (such as 20%, 50%, etc.) and the target interval number RangeCount (such as 9), and calculate the interval target proportion value according to the geometric progression principle to form the TargetRatioArray.
[0093] For each sub-product in the ValidProductList, query all API call return values in the previous N days to form the ValueArray and sort it in ascending order.
[0094] Find all possible intervals that meet the center interval target call volume proportion value CenterRangeRatio (the interval left and right endpoints are in the position of the ValueArray) from the sorted ValueArray, and select the interval with the smallest return value range as the CenterRange.
[0095] Take the CenterRange as the benchmark, and according to the target proportion value in the TargetRatioArray, expand to the left and right sides to determine other intervals. Select the interval closest to the target proportion value and with the smallest return value range until the target interval number RangeCount is divided or the boundary of the ValueArray is reached.
[0096] When the left and right side value interval division is not balanced, the divided interval is moved as a whole to the side with less call volume, ensuring that the interval distribution is more reasonable. Finally, a set of continuous value intervals RangeList is generated for each sub-product, and each interval contains upper and lower bound values and the corresponding call volume proportion value.
[0097] For example, for a certain sub-product, the following value interval division results can be obtained by the above method:
[0098] Table 1
[0099]
[0100] Step 3: Calculate the value interval proportion value and difference rate of each sub-product in parallel:
[0101] According to the available resources of the system, create a thread pool ThreadPool and allocate an independent calculation thread for each sub-product to improve calculation efficiency.
[0102] In each sub-product calculation thread, according to the value interval RangeList generated in step S2, calculate the call volume PreRangeCallCount and the proportion of the total call volume PreRangeRatio of each interval of the sub-product in the past N days.
[0103] Similarly, in each calculation thread, query the call volume GrayRangeCallCount of each interval of the sub-product during the gray period, and calculate the proportion GrayRangeRatio of the total call volume.
[0104] For each interval of each sub-product, calculate the difference rate DiffRatio = | GrayRangeRatio - PreRangeRatio | / PreRangeRatio between the interval value call volume proportion value during the gray period and the past N days, to obtain the original difference rate data OriginalDiffRatioMap.
[0105] After waiting for all calculation threads to complete, summarize the interval proportion value and difference rate data of each sub-product to form a complete original difference rate data set AllOriginalDiffRatio.
[0106] Step 4: According to the call volume and interval value proportion value of each sub-product, the difference rate is sharpened:
[0107] The purpose of data sharpening is to process the difference rate between the gray period and the past N days of each sub-product for each interval value call volume proportion value, so that it is more comparable, and thus it is easier to identify the sub-product with the greatest risk. Data sharpening is divided into two parts: call volume sharpening and proportion value sharpening.
[0108] Call sharp processing: the purpose of call sharp is to eliminate the difference of call in gray period of each sub-product, so that the difference rate comparison is carried out in the case of as equal as possible. The specific processing method is:
[0109] Sort the call of all sub-products in gray period ProductCallCount from small to large, and select the median as the reference call MedianCallCount.
[0110] For each sub-product, when its call is greater than the reference call MedianCallCount, calculate the sharp parameter CallSharpParam = log3(ProductCallCount / MedianCallCount); when the call is less than the reference call MedianCallCount, calculate the sharp parameter CallSharpParam = 1 / log3(MedianCallCount / ProductCallCount).
[0111] Call sharp processing is carried out on the difference rate of each interval value of each sub-product: when the sharp parameter CallSharpParam>1, the difference rate data SharpedDiffRatio1 after call sharp is SharpedDiffRatio1 = original difference rate data OriginalDiffRatio * CallSharpParam; when CallSharpParam<1, the difference rate data SharpedDiffRatio1 after call sharp is SharpedDiffRatio1 = original difference rate data OriginalDiffRatio / (1 / CallSharpParam).
[0112] Ratio sharp processing: the purpose of ratio sharp is to eliminate the difference of call in each interval of each sub-product in the past N days, so that the difference rate of call in each interval in gray period and the past N days can be compared as close as possible. The specific processing method is:
[0113] Configure the ratio sharp parameter, set the maximum multiple / quotient upper limit MaxMultiple and the ratio sharp percentage SharpPercent.
[0114] Sort the call of all sub-products in all intervals in the past N days from small to large, and take the median as the reference ratio MedianRatio.
[0115] For each interval of each sub-product, calculate the ratio of the interval call volume in the previous N days to the benchmark ratio value MedianRatio, Multiple = RangeRatio / MedianRatio; for the interval where RangeRatio>MedianRatio, the sharpening coefficient RatioSharpCoef = (Multiple - 1) SharpPercent + 1; for the interval where RangeRatio<MedianRatio, the sharpening coefficient RatioSharpCoef = 1 / ((1 / Multiple - 1) SharpPercent + 1).
[0116] Sharpen the difference rate data SharpedDiffRatio1 after the call volume is sharpened: when the sharpening coefficient RatioSharpCoef>1, the sharpened difference rate data FinalSharpedDiffRatio =SharpedDiffRatio1 * RatioSharpCoef; when the sharpening coefficient RatioSharpCoef<1, the sharpened difference rate data FinalSharpedDiffRatio = SharpedDiffRatio1 / (1 / RatioSharpCoef).
[0117] Step 5: Select the interval with the largest difference and the sub-product from the sharpened difference rate data (i.e. the sharpened difference rate data) for risk prompt:
[0118] For each sub-product, calculate the average value AvgSharpedDiffRatio of the sharpened difference rate of all intervals, and form a sub-product group average sharpened difference rate mapping table ProductAvgDiffMap.
[0119] Sort the sub-product group average sharpened difference rate mapping table ProductAvgDiffMap by difference rate from large to small, select the top a sub-products with the largest average sharpened difference rate, and form a high-risk sub-product list TopProductList, where a is greater than or equal to 1, for example a=3.
[0120] Sort all intervals of all sub-products by sharpened difference rate from large to small, select the top b intervals with the largest sharpened difference rate and their corresponding sub-products, and form a high-risk interval list TopRangeList, where b is greater than or equal to 1, for example b=5.
[0121] The sub-products in the high-risk sub-product list TopProductList and the high-risk range list TopRangeList are merged and deduplicated to form the final high-risk sub-product list FinalRiskProductList; at the same time, the high-risk range information corresponding to these sub-products, FinalRiskRangeList, is retained.
[0122] Based on the final high-risk sub-product list FinalRiskProductList and the high-risk range information FinalRiskRangeList, a detailed risk warning report RiskReport is generated, which includes information such as sub-product ID, name, high-risk range, original difference rate, and sharpened difference rate, for system administrators to assess the risks of gray-scale deployment.
[0123] Based on the configured difference rate threshold DiffRatioThreshold, it is determined whether the identified high-risk sub-products exceed the threshold. If there are sub-products whose difference rate after sharpening exceeds the threshold, a clear warning of deployment risk is issued.
[0124] In some embodiments, such as Figure 2 As shown, step S2 includes the following steps S2.1 to S2.4.
[0125] S2.1: Query the API call return values of each target sub-product in the list of sub-products to be tested in the previous N days, and sort the API call return values in ascending order to form a return value array.
[0126] During the dynamic value interval partitioning process, the API call return values of each target sub-product are first preprocessed and statistically analyzed. After obtaining all API call return values of the target sub-product for the previous N days, data cleaning is performed to remove outliers and noisy data, ensuring the accuracy of subsequent value interval partitioning. While sorting the return values in ascending order to form a return value array, the frequency of each return value is recorded; this frequency information serves as an important basis for the subsequent value interval partitioning algorithm.
[0127] S2.2: Filter out possible intervals from the return value array that satisfy the target call volume ratio of the central interval, and select the possible interval that minimizes the range of return values as the central interval.
[0128] In this embodiment, the determination process of the center interval adopts an optimized search algorithm, which traverses all possible interval combinations and calculates the cumulative call quantity proportion value of the return value in each interval. In order to select the possible interval that minimizes the return value range as the center interval, an interval compactness evaluation index is introduced, which comprehensively considers the distribution density of the return value in the interval and the rationality of the interval boundary. When there are multiple candidate intervals that meet the target call quantity proportion value of the center interval, the interval with the smallest return value variance is preferentially selected to ensure that the center interval has good statistical properties.
[0129] In this embodiment, the determination process of the center interval adopts an optimized search algorithm based on a sliding window, which significantly improves the search efficiency through an intelligent traversal strategy. Specifically, first, the return value array is preprocessed to establish a cumulative frequency mapping table, which associates each return value position with its corresponding cumulative call quantity. In the traversal process, a double-pointer technique is used to enumerate all possible interval combinations through the coordinated movement of the left and right boundary pointers.
[0130] In the specific implementation process, a dynamic candidate interval pool is maintained, which is empty in the initial state. The search algorithm starts from the starting position of the return value array and generates candidate intervals by gradually expanding the right boundary. For each candidate interval, the pre-constructed cumulative frequency mapping table is used to quickly calculate the cumulative call quantity proportion value of the return value in the interval, avoiding repeated statistical calculations. When the cumulative call quantity proportion value of a certain interval is close to or reaches the preset target call quantity proportion value of the center interval, the interval is added to the candidate pool and its specific proportion value deviation and interval range are recorded.
[0131] To optimize the search performance, an intelligent pruning mechanism is implemented. When the cumulative call quantity proportion value of the current interval has significantly exceeded the target value, the algorithm will stop further expansion at this starting position and directly jump to the next starting position. At the same time, this embodiment also adopts a heuristic search strategy, which preferentially explores areas with higher return value density, as these areas are more likely to contain the required center interval. During the search process, the current optimal solution, i.e., the candidate interval with the smallest deviation from the target proportion value and the most compact interval range, is dynamically maintained. After the traversal is completed, the interval with the highest comprehensive score is selected from the candidate pool as the final center interval.
[0132] S2.3: Determine the target proportion value of each interval according to the center interval target call quantity proportion value and the target number of intervals.
[0133] S2.4: Based on the center interval, expand to the left and right sides according to the target proportion value to determine other intervals, until the number of intervals obtained reaches the target number of intervals, to obtain the value interval of each target sub-product.
[0134] In the process of determining the target proportion value of each interval, the principle of geometric progression is adopted to ensure that the importance of each interval gradually decreases when expanding from the center interval to both sides. This design conforms to the natural distribution law of API return value, that is, most of the call volume is concentrated in the central area of the numerical range. According to the target call volume proportion value of the center interval and the target interval number, the complete target proportion value sequence is automatically calculated, and the boundary position is dynamically adjusted during the interval expansion process to maximize the matching degree of the actual proportion value and the target proportion value.
[0135] In the embodiment, the principle of geometric progression is adopted to determine the target proportion value distribution of each interval, which fully reflects the natural characteristics and statistical rules of API return value distribution. In the specific implementation, first, the common ratio parameter of the geometric progression is calculated according to the target call volume proportion value of the center interval and the target interval number. Assuming that the target proportion value of the center interval is a preset value, the decreasing law of the proportion value of each interval when expanding from the center to both sides needs to be determined.
[0136] It should be noted that the implementation process of the geometric progression considers the symmetry and continuity requirements of interval distribution. The remaining interval number after subtracting the target interval number from the center interval is evenly distributed to the left and right sides of the center interval. For each side of the interval, the target proportion value is allocated in a geometrically decreasing manner to ensure that the farther the interval is from the center interval, the smaller the target proportion value it obtains. The allocation method provided in the embodiment conforms to the characteristics of most API return values that are normally distributed, that is, the call volume is most concentrated in the central region, and the call volume is relatively sparse in the edge region.
[0137] When calculating the common ratio of the geometric progression, it needs to satisfy the constraint condition that the sum of all interval target proportion values is equal to 100%. The optimal common ratio is solved by numerical iteration, so that the calculated target proportion values of each interval not only satisfy the geometrically decreasing rule, but also completely cover the entire call volume distribution. In order to ensure numerical stability, the value range of the common ratio is limited to avoid the problem that the target proportion value of some interval is too small to have statistical significance.
[0138] In the specific implementation process of interval expansion, starting from the center interval, the expansion is alternately performed to the left and right sides. Each time the expansion is performed, the target proportion value calculated according to the geometric progression is used to find the interval boundary that best meets the proportion value requirement in the current remaining return value range. A greedy strategy is adopted to preferentially select the boundary position that minimizes the deviation between the actual proportion value and the target proportion value. When the return value range on one side has been exhausted while the other side still has remaining, the expansion strategy is automatically adjusted to allocate all the remaining target intervals to the side that still has space, and the target proportion values of these intervals are adjusted accordingly to maintain the rationality of the overall distribution.
[0139] Based on the above embodiments, in some embodiments, such as Figure 3As shown, step S3 can include the following steps S3.1 to S3.4.
[0140] S3.1: Create a thread pool according to the available resources of the system, and allocate an independent computing thread for each target sub-product in the thread pool.
[0141] In the parallel computing architecture, the creation and management of the thread pool adopts an adaptive strategy to dynamically determine the optimal number of threads according to the current available CPU core number and memory capacity. In order to avoid resource competition and data conflict between threads, each target sub-product computing thread has an independent data cache area and computing context. This embodiment also implements an intelligent load balancing mechanism. When the data volume of some sub-products is significantly greater than that of other sub-products, the computing task will be automatically further split into multiple threads for execution.
[0142] S3.2: In each target sub-product computing thread, query the historical call volume of each value interval of the target sub-product in the past N days, and calculate the proportion of the historical call volume of each value interval to the total call volume as the first call volume proportion value.
[0143] In the process of calculating the first call volume proportion value, not only the absolute call volume of each value interval is counted, but also metadata information such as call time distribution and call source is recorded, which is helpful for subsequent difference rate analysis and anomaly detection. In order to improve the calculation accuracy, high-precision floating-point operations are used, and cumulative error correction is performed during the proportion value calculation process to ensure that the sum of all interval proportion values is strictly equal to 100%.
[0144] S3.3: In the computing thread, query the gray period call volume of each value interval of the target sub-product during the gray period, and calculate the proportion of the gray period call volume of each value interval to the total call volume as the second call volume proportion value.
[0145] The difference rate calculation link introduces multiple difference measurement methods. In addition to the basic absolute difference rate, this embodiment also calculates relative difference rate, standardized difference rate and other indicators. This multi-dimensional difference rate calculation method can more comprehensively reflect the changes between the gray period and the benchmark period. In order to handle possible division by zero errors and numerical overflow problems, this embodiment implements a perfect exception handling mechanism. When the call volume of a certain interval is zero in the benchmark period, Laplace smoothing and other techniques are used for processing.
[0146] In this embodiment, the multi-dimensional measurement method of the difference rate calculation link embodies the system's pursuit of precision in risk identification accuracy. Based on the basic absolute difference rate calculation, relative difference rate and standardized difference rate are also implemented, forming a complete difference evaluation system.
[0147] It should be noted that the calculation process of the relative difference rate fully considers the influence weight of the proportion value of the call amount in the benchmark period. By dividing the difference between the proportion value in the gray period and the proportion value in the previous N days by the proportion value in the previous N days, a quantitative indicator of the relative change amplitude is obtained. This calculation method can effectively distinguish the change significance at different base levels. For example, although the absolute difference is the same, the relative difference rate can accurately reflect the higher risk of the former change when the proportion value changes from 2% to 4% and from 50% to 52%. In this embodiment, a smoothing processing technique is used when calculating the relative difference rate. When the benchmark proportion value is close to zero, a small smoothing factor is added to avoid division by zero error and ensure the numerical stability of the calculation result.
[0148] The implementation of the standardized difference rate is more complex and needs to consider the distribution characteristics of the entire sub-product group. In the specific implementation process, first, the mean and standard deviation of the difference rate of all target sub-products in all intervals are calculated to establish a global difference rate distribution benchmark. Then, the difference rate of each specific interval is standardized and converted into a standardized score relative to the global distribution. This standardization eliminates the comparison difficulties caused by the absolute numerical difference of the difference rate between different sub-products, so that the risk assessment results from different sub-products have a unified evaluation standard.
[0149] Optionally, the embodiment also implements auxiliary measurement methods such as quantile difference rate and dynamic weighted difference rate. The quantile difference rate identifies significant changes in relative ranking by comparing the position changes of the proportion values of the gray period and the benchmark period in the global distribution. The dynamic weighted difference rate assigns different importance weights to different intervals according to historical stability. Lower weights are given to intervals with larger historical fluctuations, and higher weights are given to intervals with stable historical performance. These multi-dimensional difference measurement results are weighted and fused to form a comprehensive difference score, providing a more rich and accurate data basis for subsequent sharpening processing.
[0150] S3.4: For each value interval of the target sub-product, a difference rate of the interval call amount proportion value in the gray period and the previous N days is calculated according to the first call amount proportion value and the second call amount proportion value, and the calculation results of each calculation thread are summarized to obtain the original difference rate data.
[0151] In this embodiment, the result summarization process of each calculation thread uses a lock-free concurrent programming technique to ensure data consistency through atomic operations and memory barriers. This embodiment also implements real-time monitoring and quality checking mechanisms for the calculation results, which can timely discover and handle abnormal situations in the calculation process, ensuring that the final output of the original difference rate data has high reliability and accuracy.
[0152] In some embodiments, the original difference rate data is subjected to call quantity sharpening processing based on the call quantity of each value interval during the grayscale period of each target sub-product in step S4, to obtain call quantity sharpened difference rate data, which can be further refined as steps S4.1.1 to S4.1.3.
[0153] S4.1.1: Sort the call quantity of all target sub-products during the grayscale period from small to large, and select the call quantity during the grayscale period in the middle of the sorting as the reference call quantity.
[0154] In the present embodiment, through call quantity sharpening processing, in the process of determining the reference call quantity, not only the median of the call quantity during the grayscale period of all target sub-products is calculated, but also the skewness and kurtosis of the call quantity distribution and other statistical characteristics are analyzed. When the call quantity distribution presents obvious skewness characteristics, the adjusted median or truncated mean is used as the reference call quantity to improve the stability and representativeness of the sharpening processing.
[0155] It should be noted that the call quantity sharpening processing solves the fundamental problem of difference rate comparability between sub-products of different call quantity levels. By way of example, a specific numerical case is used to show the significant difference before and after sharpening processing. Considering two representative sub-product cases, sub-product A has a call quantity of ten thousand times during the grayscale period, and the proportion of a certain interval changes from twenty percent during the reference period to twenty-five percent during the grayscale period, with an absolute difference rate of twenty-five percent. Sub-product B has a call quantity of only one thousand times during the grayscale period, and the proportion of the corresponding interval changes from twenty percent to twenty-five percent, with the same absolute difference rate of twenty-five percent. The traditional method considers that the risk levels of the two sub-products are the same, but this obviously ignores the statistical significance difference caused by the call quantity difference.
[0156] In the present embodiment, the call quantity sharpening processing is improved by introducing a standardization mechanism based on the median of the call quantity, that is, assuming that the median of the call quantity of all target sub-products is five thousand times, then the call quantity sharpening parameter of sub-product A is calculated by logarithmic transformation, and since its call quantity is higher than the median, the weight of its difference rate is correspondingly increased. On the contrary, the call quantity of sub-product B is lower than the median, and its difference rate weight is appropriately reduced. This processing method embodies the basic principle of the influence of sample size on the reliability of results in statistics. Changes in large samples have more statistical significance and should be given more attention.
[0157] In addition, the logarithmic transformation is sharpened by selecting a logarithmic function with base 3, which is based on the optimization results of a large amount of empirical data. The logarithmic transformation can effectively control the excessive influence of extreme call volume on the difference rate, and avoid that the sub-products with ultra-high call volume completely dominate the risk ranking. At the same time, the continuity and monotonicity of the logarithmic function ensure the smoothness of the sharpening parameter with the change of the call volume, avoiding unreasonable jump phenomenon near some critical points.
[0158] After the call volume sharpening processing, the originally same absolute difference rate shows reasonable differentiation after considering the call volume factor. The difference rate of the sub-products with high call volume is moderately amplified, reflecting the high credibility of its change; the difference rate of the sub-products with low call volume is appropriately suppressed, avoiding that the random fluctuations of small samples are misjudged as high risk. This sharpening mechanism makes the risk identification result more scientific and reasonable, significantly improving the accuracy and practicality of the gray release risk assessment. In practical application, the call volume sharpening processing can reduce the false positive rate by about thirty percent, while maintaining high sensitivity to real risks, fully proving the effectiveness of this innovative method.
[0159] S4.1.2: If the call volume of the target sub-product during the gray period is greater than the reference call volume, a preset first sharpening parameter calculation model is used to calculate the call volume during the gray period and the reference call volume to obtain a first sharpening parameter; otherwise, a preset second sharpening parameter calculation model is used to calculate the call volume during the gray period and the reference call volume to obtain a second sharpening parameter; wherein the second sharpening parameter is the inverse of the first sharpening parameter, and the sharpening parameter is one of the first sharpening parameter and the second sharpening parameter.
[0160] In this embodiment, the design of the first sharpening parameter calculation model fully considers the difference amplification effect under different call volume levels. When the call volume of the target sub-product during the gray period is significantly greater than the reference call volume, a logarithmic transformation is used to control the sharpening amplitude, preventing the difference rate of the sub-products with high call volume from being excessively amplified. Specifically, the first sharpening parameter calculation model is:
[0161]
[0162] Wherein, the base 3 logarithm is selected based on the optimization results of a large amount of experimental data, which can avoid numerical instability problems while maintaining the sharpening effect.
[0163] Optionally, the second sharpening parameter calculation model is used to process the sharpening demand of low-call sub-products. For sub-products with call volume less than the benchmark call volume during the gray period, the reciprocal of the call volume ratio is first calculated, then the same logarithmic transformation as the first sharpening parameter is applied, and finally the reciprocal is taken to obtain the second sharpening parameter. This design ensures the symmetry and continuity of the sharpening parameter on both sides of the call volume benchmark, avoiding numerical jumps near the benchmark point.
[0164] It should be noted that the application process of the sharpening parameter adopts an adaptive adjustment strategy, that is, the sharpening parameter is fine-tuned according to the historical stability and business importance of each sub-product. For sub-products with stable historical performance and regular call patterns, the sharpening intensity is appropriately reduced; while for newly online or historically volatile sub-products, the sharpening sensitivity is correspondingly increased. This personalized sharpening processing method can better adapt to the characteristics of different types of sub-products.
[0165] S4.1.3: According to the sharpening parameter, the call volume sharpening processing is performed on the original difference rate data to obtain call volume sharpened difference rate data.
[0166] In the specific execution process of call volume sharpening processing, the embodiment also implements a numerical stability guarantee mechanism. When the sharpening parameter is too large or too small, boundary limitation is automatically performed to prevent abnormal values of the sharpened difference rate. At the same time, the detailed parameters and intermediate results of each sharpening processing are recorded to provide data support for subsequent algorithm optimization and problem diagnosis. After the sharpening processing is completed, the results are quality inspected to ensure that the sharpened difference rate data still maintains reasonable distribution characteristics and statistical properties.
[0167] In some embodiments, the call volume sharpening based on the call volume sharpened difference rate data and the first call volume ratio value in step S4 to obtain the sharpened difference rate data can be further refined as steps S4.2.1 to S4.2.5.
[0168] S4.2.1: Sort all the first call volume ratio values of all target sub-products in all value intervals from small to large, and take the first call volume ratio value ranked in the middle as the benchmark ratio value.
[0169] In the initial stage of the proportion value sharpening process, a global proportion value reference point needs to be established. In this embodiment, the reference proportion value determination process uses a robust statistical method. First, the first call volume proportion value data of all target sub-products in all value intervals is collected to form a large data set containing thousands of proportion values. To ensure the representativeness and stability of the reference proportion value, the proportion value data is preprocessed to eliminate obvious outliers and extreme values. In the sorting process, a high-efficiency quick selection algorithm is used to locate the median, avoiding the computational overhead caused by complete sorting. When the data set size is even, the geometric mean of the middle two values is taken as the reference proportion value. This method is more suitable for handling the multiplicative characteristics of proportion data than the arithmetic mean.
[0170] S4.2.2: For each value interval of each target sub-product, calculate the ratio between its first call volume proportion value and the reference proportion value, and calculate the sharpening coefficient according to the configured proportion value sharpening percentage.
[0171] In this embodiment, the ratio calculation process uses a sharpening algorithm. For each value interval of each target sub-product, the ratio of its first call volume proportion value to the reference proportion value is calculated. This ratio reflects the relative position of the interval in the overall proportion value distribution. When the ratio is greater than 1, it means that the proportion value of the interval is higher than the global median level; when the ratio is less than 1, it means that the proportion value is lower than the median level. The proportion value sharpening percentage (SharpPercent) is a key adjustment parameter, usually set between 10% and 50%. This parameter controls the size of the sharpening intensity. A larger proportion value sharpening percentage SharpPercent value will produce a stronger sharpening effect, making the differences between different proportion value intervals more pronounced; a smaller value will produce a more moderate adjustment effect.
[0172] S4.2.3: For the value interval of the target sub-product whose first call volume proportion value is greater than the reference proportion value, calculate the first sharpening coefficient using the preset first sharpening coefficient calculation model based on the ratio and the preset proportion value sharpening percentage.
[0173] In this embodiment, the first sharpening coefficient calculation model is used to handle the sharpening needs of high proportion value intervals. For the value interval whose first call volume proportion value is greater than the reference proportion value, the first sharpening coefficient calculation formula is:
[0174] RatioSharpCoef = (Multiple - 1) × SharpPercent + 1
[0175] The first sharpening coefficient is determined by the above calculation method, which considers the linear controllability of the sharpening effect. When the ratio is close to 1, the sharpening coefficient is close to 1, and almost no sharpening effect is produced. When the ratio is significantly greater than 1, the sharpening coefficient will increase accordingly, but the growth rate is controlled by the ratio sharpening percentage SharpPercent. This design avoids the problem of numerical instability caused by excessive sharpening, while ensuring that the sharpening effect is positively correlated with the difference between the original ratio.
[0176] S4.2.4: For the value interval of the first call amount ratio of the target sub-product not greater than the reference ratio, a preset second sharpening coefficient calculation model is used to calculate the ratio and a preset ratio sharpening percentage to obtain a second sharpening coefficient, wherein the sharpening coefficient is one of the first sharpening coefficient and the second sharpening coefficient.
[0177] In this embodiment, the second sharpening coefficient calculation model adopts a symmetrical mathematical design to ensure the consistency of the sharpening process on both sides of the reference ratio. For the value interval of the first call amount ratio not greater than the reference ratio, first calculate the reciprocal ratio 1 / Multiple, and then apply a similar formula to the first sharpening coefficient:
[0178] RatioSharpCoef = 1 / ((1 / Multiple - 1) × SharpPercent + 1)
[0179] Wherein, the second sharpening coefficient is determined by the above calculation method, which ensures the continuity and symmetry of the sharpening coefficient near the reference point. For example, if the ratio of a certain interval is half of the reference ratio, and the ratio of another interval is twice the reference ratio, their sharpening coefficients will show a symmetrical reciprocal relationship.
[0180] S4.2.5: According to the sharpening coefficient, the difference rate data after the call amount sharpening is subjected to ratio sharpening processing to obtain the sharpened difference rate data.
[0181] In this embodiment, the ratio sharpening application process combines the results of the previous call amount sharpening. According to the type of sharpening coefficient of each interval, the corresponding mathematical operation is used to adjust the difference rate data after the call amount sharpening. When the sharpening coefficient is greater than 1, it indicates that the ratio of this interval is relatively high, and its difference rate is amplified through multiplication operation; when the sharpening coefficient is less than 1, it indicates that the ratio is relatively low, and its difference rate is reduced through division operation. This two-way adjustment mechanism ensures that the final sharpened difference rate data can fairly reflect the relative importance of different ratio intervals.
[0182] In this embodiment, step S2 can further include the following steps S2.A.1 to S2.A.5.
[0183] S2.A.1: constructing the API call return values of the target sub-product in the past N days as a stream graph, wherein each vertex in the stream graph represents an API call return value, and the weight of the edge in the stream graph represents the frequency difference between two adjacent API call return values.
[0184] In this embodiment, the stream graph construction process uses advanced graph theory algorithms to process large-scale API return value data. First, statistical analysis is performed on all API call return values of the target sub-product in the past N days to identify the occurrence frequency and time distribution pattern of different return values. When constructing the stream graph, each unique API return value is mapped to a vertex in the graph, and the attributes of the vertex include the return value itself, occurrence frequency, first occurrence time, etc. The construction of edges in the graph follows the adjacency principle, that is, adjacent return values with similar values will establish an edge. The weight calculation formula of the edge is:
[0185] |freq(vi) - freq(vj)| / max(freq(vi), freq(vj))
[0186] Where freq(vi) and freq(vj) represent the occurrence frequencies of two adjacent return values. Through the weight calculation of the edge, the gradient information of the return value frequency change can be effectively captured.
[0187] S2.A.2: using a count sketch data structure to compress the return value frequency information of the API call return values to optimize the stream graph, so that the space complexity of the optimized stream graph is reduced from linear level to logarithmic level.
[0188] In this embodiment, the count sketch data structure optimization can help achieve sub-linear space complexity. Traditional frequency statistics methods require maintaining a counter for each different return value, which consumes a large amount of memory when the number of return values is large. The count sketch algorithm maps return values to a fixed-size count array through multiple independent hash functions, achieving significant improvement in space efficiency. Using the Count-Min Sketch variant, d hash functions and w counters are used, and the total space complexity is O(dw), which is usually much smaller than the O(n) space required for direct statistics. In order to ensure the estimation accuracy, the number of hash functions and the width of the counter are adjusted adaptively according to the data size, ensuring that the relative error of the frequency estimation is controlled within an acceptable range.
[0189] The core of the sketching algorithm is to compress the frequency information by using the randomness and independence of hash functions, so as to fundamentally change from linear space complexity to logarithmic space complexity. First, a plurality of independent hash function families are constructed, and each hash function can map any API return value to an integer position in a fixed range. The design of these hash functions adopts the theoretical basis of the general hash family, which ensures that the probability of different return values being mapped to the same position is uniformly distributed in theory.
[0190] In the specific implementation process, a two-dimensional count matrix is maintained, and the number of rows of the matrix corresponds to the number of hash functions, and the number of columns corresponds to the output range of each hash function. When a certain API return value is encountered, all hash functions are used to map the return value, and the count is increased at the corresponding matrix position. Since different return values may be mapped to the same position, this mapping will cause count conflicts, but through the parallel use of multiple independent hash functions, the real frequency value can be estimated by statistical methods.
[0191] It should be noted that the frequency query process adopts a minimum value estimation strategy. When the frequency of a return value needs to be queried, all hash functions are used to map the return value, and the count values of multiple count matrix positions are obtained, and then the minimum value of these count values is taken as the frequency estimation result. The theoretical basis of this minimum value strategy is that although hash conflicts will cause the count value to be overestimated, at least one function in multiple independent hash functions has a high probability of producing fewer conflicts, so the minimum value can provide a relatively accurate lower bound estimate of the frequency.
[0192] To further improve the estimation accuracy, the embodiment also implements a dynamic adjustment mechanism. By monitoring the conflict rate and estimation bias of different hash functions, the dimension parameters of the count matrix are dynamically adjusted. When the estimation accuracy is detected to be insufficient, the number of hash functions is appropriately increased or the output range of each hash function is expanded. At the same time, the embodiment also adopts a hierarchical sampling technique, and different processing strategies are used for high-frequency return values and low-frequency return values to maximize the overall estimation accuracy in limited storage space.
[0193] S2.A.3: In a single data stream scan, a preset approximation factor is used to construct a path, wherein the path represents a natural clustering interval of the API call return value, and the length of the path is determined by the approximation factor and the length of the longest path in the optimized stream data graph.
[0194] In this embodiment, the single-pass data stream path construction algorithm embodies the efficiency of stream processing. The preset approximation factor a is usually set between 0.6 and 0.9, which controls the balance between the quality and efficiency of path construction. A dynamic path set is maintained during the single-pass scanning process. Whenever a new return value vertex is encountered, a decision is made based on the greedy strategy whether to add it to an existing path or start a new path. The determination of path length combines the approximation factor and the topological properties of the graph, and the specific calculation formula combines the heuristic algorithm. This path construction method can discover the main clustering patterns in the data in a single-pass, providing high-quality candidate solutions for subsequent value interval division.
[0195] In addition, the path decision-making process of the greedy strategy embodies the intelligent selection ability of the system in real-time stream processing. When a new return value vertex is encountered, the compatibility and potential contribution of the vertex with all existing paths are first evaluated. Compatibility evaluation mainly considers the numerical proximity and frequency similarity between the new vertex and the endpoints of the existing paths. The numerical distance between the return value of the new vertex and the nearest endpoint of each existing path is calculated, and their frequency characteristics are compared. If the distance is within the preset threshold range and the frequency characteristics are similar, it is considered that the vertex has good compatibility with the path.
[0196] The evaluation of potential contribution is more complex, which needs to predict the impact on the overall path quality after adding the new vertex to the existing path. The quality evaluation indicators include the continuity, density uniformity and matching degree with the target proportion value distribution of the path. The changes in various quality indicators of the path after adding the new vertex are simulated and calculated. If the addition operation can significantly improve the path quality, the path will get a higher contribution score. At the same time, this embodiment also considers the balance of path length to avoid some paths growing too much while others are too short.
[0197] The decision to start a new path is based on multiple judgment criteria. When the compatibility of the new vertex with all existing paths is poor, starting a new path is preferred. In addition, even if there is a compatible existing path, if the new vertex shows unique frequency characteristics or numerical characteristics, this embodiment may choose to start a new path to maintain the diversity of the path set. The decision to start a new path also considers the control of the global path number. When the number of existing paths has reached close to the upper limit set by the system, the threshold for starting a new path is increased, and the new vertex is more inclined to be added to the existing path.
[0198] The implementation of the greedy strategy also includes a forward-looking evaluation mechanism. This embodiment not only considers the processing decision of the current vertex, but also predicts the characteristics of the subsequent vertices based on the historical data patterns, so as to make more globally optimized decisions. This forward-looking mechanism is realized by maintaining statistical characteristics in a sliding window, analyzing the sequence of recently processed vertices, identifying patterns and trends therein, and adjusting the parameter settings of the greedy strategy accordingly.
[0199] S2.A.4: From the constructed multiple paths, paths meeting the path requirement related to the target call amount proportion value of the center interval are screened out, and the screened out paths are divided according to the target interval number according to a preset segmentation strategy, the segmentation strategy is used to indicate selecting a segmentation point that minimizes the total difference of each interval and the target proportion value.
[0200] In this embodiment, the path screening and segmentation process adopts a multi-objective optimization method. Specifically, first, the candidate paths with the highest matching degree to the target call amount proportion value of the center interval are screened out from the constructed multiple paths. The matching degree evaluation considers multiple factors such as the return value range covered by the path, the uniformity of the frequency distribution, and the fitting degree to the target proportion value. The preset segmentation strategy is based on a dynamic programming algorithm, and the objective function is to minimize the weighted squared error of the actual proportion value of each interval and the target proportion value. The selection of the segmentation point not only considers the proportion value matching degree, but also evaluates the rationality of the interval boundary to avoid segmentation at positions with sharp frequency changes.
[0201] It should be noted that the implementation of the dynamic programming segmentation strategy is based on the classical theory of optimal substructure and overlapping subproblems. First, define the state space, where each state represents the optimal segmentation scheme from the starting point of the path to a certain specific position. The design of the state transition equation considers two core objectives: proportion value matching degree and boundary rationality. The proportion value matching degree is quantified by calculating the weighted squared error between the actual call amount proportion value of each candidate interval and the target proportion value, and the weight coefficient is dynamically adjusted according to the size of the target proportion value to ensure that important intervals have higher matching accuracy requirements.
[0202] In addition, the evaluation of boundary rationality adopts a multi-dimensional quantitative index system. Analyze the frequency change gradient near the candidate segmentation point, calculate the local frequency variance and the frequency difference between adjacent points. When the frequency change gradient at a certain position is too large, a penalty term is added to the segmentation at that position, guiding the algorithm to select positions with relatively flat frequency changes as interval boundaries. Therefore, it ensures that the finally divided intervals have internal consistency and clear boundaries, avoiding the forced grouping of return values with large frequency feature differences into the same interval.
[0203] Furthermore, the state transition process of dynamic programming adopts a multi-stage decision model. At each decision stage, the optimal position of the next segmentation point needs to be determined. The algorithm enumerates all possible candidate positions for the segmentation point, and calculates the cost function value of transitioning from the current state to the new state for each candidate position. The cost function integrates multiple components such as proportion value matching error, boundary rationality penalty, and path continuity reward. By maintaining a dynamic programming table to record the optimal values and optimal decision paths of each state, the traceability of the global optimal solution is ensured.
[0204] Optionally, to handle the computational complexity problem brought by large-scale data, the embodiment implements state space compression and pruning optimization techniques. State space compression reduces storage requirements by identifying equivalent states, merging them into a single representative state when multiple states have the same optimal value and similar characteristics. Pruning optimization excludes obviously suboptimal search branches in advance by maintaining the bounds of the current optimal solution, significantly reducing the algorithm's computation time. At the same time, the embodiment also adopts a divide-and-conquer strategy, decomposing large-scale segmentation problems into multiple relatively independent sub-problems, solving them in parallel and then merging the results.
[0205] S2.A.5: Fine-tune the interval boundaries after segmentation, so that the difference between the actual proportion value of each interval after segmentation and the preset target proportion value distribution is less than the preset difference threshold, to obtain the value interval of each target sub-product.
[0206] In this embodiment, the interval boundary fine-tuning process uses an iterative optimization algorithm. The initial segmentation result is fine-tuned by a local search method, and each iteration attempts to slightly move the interval boundaries to improve the proportion value matching degree. The preset difference threshold is usually set to 5% to 10% of the target proportion value, and when the difference between the actual proportion value of all intervals and the target proportion value is less than the threshold, the optimization process terminates. To avoid overfitting and high computational complexity, the embodiment sets a maximum number of iterations limit and adopts an early stopping strategy to terminate the optimization process when there is no significant improvement in consecutive iterations. The final output value interval not only meets the proportion value requirement, but also has good statistical properties and business interpretability.
[0207] It should be noted that the iterative optimization algorithm for interval boundary fine-tuning uses a hybrid strategy combining gradient descent and local search. The initialization phase of the algorithm is based on the output results of the dynamic programming segmentation strategy, taking the boundary positions of each interval as the initial values of the optimization variables. The embodiment defines a multi-objective optimization function, with main objectives including minimizing the deviation of actual proportion value from target proportion value, maximizing the uniformity of frequency distribution within the interval, and smoothing the transition between adjacent intervals. The optimization function uses a weighted sum, and the weights of each objective are dynamically adjusted according to business needs and historical optimization experience.
[0208] The gradient calculation process takes into account the impact of boundary position changes on multiple objective functions. Since a small movement of the interval boundary will affect the proportion value and statistical characteristics of the adjacent two intervals, the gradient of the composite function needs to be calculated. Gradient calculation uses numerical differentiation method, which estimates the rate of change of the objective function by making small perturbations near each boundary position. To improve the accuracy of gradient estimation, the embodiment uses the central difference format and an adaptive step size adjustment mechanism, dynamically adjusting the perturbation amplitude according to the smoothness of the local function.
[0209] The implementation of the local search strategy is based on the definition of the neighborhood structure and the design of the search rule. In this embodiment, multiple types of neighborhood structures are defined for each boundary position, including fixed step neighborhood, proportional step neighborhood, and intelligent neighborhood, etc. The fixed step neighborhood searches for better solutions within a fixed range near the boundary position, which is suitable for fine adjustment of local optimization. The proportional step neighborhood dynamically adjusts the search range according to the current interval size, ensuring that the search amplitude matches the interval size. The intelligent neighborhood adaptively determines the search direction and range based on historical optimization trajectories and function characteristics.
[0210] The convergence judgment of the iteration process adopts a comprehensive evaluation mechanism of multiple criteria. In this embodiment, multiple indicators such as the change amplitude of the objective function value, the change amplitude of the boundary position, and the modulus of the gradient vector are monitored simultaneously. When the changes of these indicators in consecutive iterations are all less than the preset threshold, the algorithm is determined to be converged and the iteration is terminated. To avoid falling into a local optimal solution, this embodiment also implements a random restart mechanism and a multi-start parallel search strategy. When the algorithm converges at a certain starting point, a new optimization process is started from a different initial position, and the optimal solutions obtained from different starting points are compared, and the global optimal result is selected as the final output. In addition, this embodiment also sets a maximum iteration number limit and a calculation time limit to ensure that the algorithm completes the optimization process within a reasonable time.
[0211] Based on the above embodiments, in some embodiments, step S3 can further include S3.A.1 to S3.A.5.
[0212] S3.A.1: Based on the first call volume proportion value of each target sub-product, a first graph structure is constructed, wherein the nodes in the first graph structure represent a value interval, and the edges in the first graph structure represent the relationship between the first call volume proportion values corresponding to adjacent value intervals.
[0213] In this embodiment, the first graph structure construction process adopts a graph theory modeling method based on proportion value relationship. In this embodiment, a special graph structure is created for each target sub-product, where each node represents a value interval obtained by dynamic division in the previous step. The attributes of the node not only include the upper and lower boundary values of the interval, but also include rich statistical information such as the first call volume proportion value, the number of calls, and the average response time of the interval in the previous N days. The construction of edges in the graph follows the interval adjacency principle, i.e. an edge is established between intervals that are adjacent in value. The weight of the edge takes into account the smoothness of the proportion value change, and the calculation formula is:
[0214]
[0215] where weight represents the weight of the edge, and respectively represent the first call volume proportion value of adjacent intervals. By setting the weight of the edge, it is ensured that the intervals with similar proportion values have stronger connection strength, reflecting the continuity of the running state.
[0216] S3.A.2: Based on the second call volume proportion value of each target sub-product, a second graph structure is constructed, the nodes in the second graph structure represent a value interval, and the edges in the second graph structure represent the relationship between the corresponding second call volume proportion values of adjacent value intervals.
[0217] In this embodiment, the second graph structure adopts the same topological structure as the first graph structure, but the node attributes and edge weights reflect the running state during the gray period. The nodes in the second graph structure contain the second call volume proportion value and related statistical indicators of the same interval during the gray period. In order to facilitate subsequent graph matching and difference analysis, it is ensured that the first graph structure and the second graph structure have completely consistent node identifiers and edge connection relationships. The calculation of the edge weight is also based on the proportion value data during the gray period. This symmetrical graph structure design lays a foundation for subsequent parallel difference analysis. This embodiment also calculates the proportion value change gradient for each edge, which is used to describe the continuity and directionality of the proportion value change between adjacent intervals.
[0218] S3.A.3: A preset semi-streaming strategy is adopted to perform parallel processing on the first graph structure and the second graph structure corresponding to all target sub-products, so as to find a target path with the largest difference between the first graph structure and the second graph structure, and the semi-streaming strategy is used to indicate that only key intermediate results are saved.
[0219] In this embodiment, the semi-streaming strategy is a key technology for efficient processing of large-scale graph data. Unlike the traditional full graph loading method, the semi-streaming strategy adopts a block processing and incremental calculation method, which significantly reduces memory occupation. This embodiment maintains a fixed-size work buffer that only saves the graph nodes currently being processed and key intermediate results. When finding the target path with the largest difference, an improved shortest path algorithm variant is adopted, and the objective function is changed from distance minimization to difference maximization. During the path search process, the corresponding path state is maintained in the first graph structure and the second graph structure, and the proportion value difference cumulative value of each node on the path is calculated in real time. The core advantage of semi-streaming processing is that it can process graph data far exceeding the memory capacity in a limited memory space, while ensuring the accuracy of difference identification.
[0220] It should be noted that the core of the semi-streaming strategy is to break through the memory limit of the traditional full graph loading method through intelligent memory management and data flow control. The embodiment realizes a hierarchical cache architecture, which divides the graph data into multiple levels according to access frequency and importance. The highest level cache saves the active nodes and key path information currently being processed, the middle layer cache maintains the adjacency relationship of the recently accessed nodes, and the bottom layer cache stores the complete graph structure index. When a node not in the current cache needs to be accessed, the subsequent access probability of the node is judged according to the prediction algorithm to decide whether to load it into the cache and which cache level to place it in.
[0221] The data flow control mechanism adopts a priority-based scheduling strategy, and the embodiment assigns different priority weights to different types of graph operations. The difference calculation operation has the highest priority, the path construction operation is next, and the statistical information update operation has the lowest priority. When the system resources are tight, low-priority operations will be temporarily suspended to ensure that critical difference identification tasks can be completed in time. At the same time, the embodiment also realizes an incremental processing mechanism, which only recalculates the changed graph area, avoiding the computational overhead brought by full graph reprocessing.
[0222] It should be noted that the improved shortest path algorithm variant converts the traditional distance minimization objective function into a difference maximization objective function, which requires redefining edge weights and path evaluation criteria. In the new algorithm framework, the edge weight no longer represents the distance cost between two nodes, but represents the contribution of the difference between the two adjacent intervals. The embodiment determines the edge weight by calculating the synergistic effect of the change in the occupancy value of adjacent intervals in two time periods. When the change direction of the occupancy value of two adjacent intervals is consistent and the amplitude is large, the corresponding edge weight will be set to a higher value.
[0223] In addition, the redesign of the path evaluation criteria considers two key factors: difference accumulation effect and path continuity. The difference accumulation effect is calculated by weighted sum of all edge weights in the path, and the weight coefficient is adjusted according to the position of the edge in the path. The edges in the center of the path get higher weights, reflecting their important role in the overall difference pattern. Path continuity is quantified by evaluating the smoothness of the change in adjacent edge weights in the path. Excessive jump in weight will result in a continuity penalty, guiding the algorithm to find a more stable and interpretable difference pattern.
[0224] In this embodiment, the search strategy of the algorithm adopts a heuristic-guided breadth-first search variant. Traditional breadth-first search expands nodes in order of increasing distance, while the improved algorithm expands in order of decreasing difference contribution. This embodiment maintains a priority queue, with elements in the queue sorted by the cumulative difference value of the current path. Each time the expansion is selected, the path with the highest cumulative difference value is extended, and the newly generated path is reinserted into the priority queue. In order to avoid search space explosion, the path length limit and the cumulative difference threshold are set, when the path length exceeds the limit or the cumulative difference is below the threshold, the corresponding search branch will be terminated in advance.
[0225] S3.A.4: Calculate the interval proportion difference rate based on the target path, map the target path to the overall change of the interval sequence, and identify the interval distribution change pattern.
[0226] In this embodiment, the target path difference rate calculation process integrates path-level and node-level analysis methods. Specifically, first, the target path is mapped to an ordered interval sequence, and then the proportion difference of each interval in the sequence is calculated in two time periods. The path-level difference rate calculation considers the overall characteristics of the path, including path length, average proportion change, maximum single-point difference, and other indicators. The identification of interval distribution change pattern uses time series analysis technology to detect whether there is a significant trend change, periodic pattern or mutation point in the path. This multi-level analysis method can identify structural change patterns that are difficult to find by traditional single-point comparison methods, such as systematic deviation or proportion value redistribution of a specific pattern within a continuous interval range.
[0227] It should be noted that the core of the target path difference rate calculation process is to convert complex graph structure information into quantifiable difference indicators. First, the path mapping operation is performed, which rearranges the node sequence in the target path according to the numerical order of the return value, forming a continuous interval sequence. This mapping process needs to handle the non-continuous jumps that may exist in the path. When the path contains non-adjacent intervals, the missing intervals are filled by interpolation method to ensure the integrity and continuity of the sequence.
[0228] The node-level difference analysis adopts a combination of point-by-point comparison and statistical testing methods. For each interval node in the sequence, the call volume proportion value in the previous N days and the gray period is calculated, and various difference measurement methods are applied for quantification. In addition to the basic absolute difference and relative difference, this embodiment also calculates advanced indicators such as standardized difference and quantile difference. The standardized difference compares the proportion value change of the interval with the standard deviation of the historical fluctuation of the interval, identifying abnormal changes beyond the normal fluctuation range. The quantile difference compares the ranking change of the interval proportion value in the global distribution, discovering significant adjustments in relative position.
[0229] The path-level difference rate calculation comprehensively considers the multi-dimensional characteristic attributes of the path. The path length characteristic is quantified by calculating the number of intervals contained in the path and the covered return value range. Longer paths generally represent a wider range of system impact. The average proportion value change is calculated by weighted averaging the proportion value differences of all intervals on the path. The weight is determined according to the call volume and historical stability of each interval. The maximum single-point difference identifies the interval with the most dramatic change in proportion value in the path and analyzes its contribution to the overall path difference.
[0230] The application of time series analysis technology provides a powerful analysis tool for interval distribution change pattern recognition. This embodiment constructs a time series model for each interval, using historical proportion value data as training samples to predict the expected proportion value during the gray period under normal circumstances. Trend change detection identifies systematic change patterns by comparing the deviation of the actual proportion value from the trend prediction value. The Mann-Kendall trend test is used to statistically verify the significance of the trend change. When the test result shows a significant upward or downward trend, this embodiment marks it as an important change pattern.
[0231] Periodic pattern recognition uses a frequency domain analysis method. By using fast Fourier transform, the time series is converted to the frequency domain to identify periodic components in the proportion value change. When a significant periodic pattern is detected, this embodiment further analyzes whether the pattern has changed during the gray period, including adjustments in cycle length, changes in amplitude, and phase shifts. Abrupt point detection is based on the theory of change point analysis. By using CUSUM test and Bayesian change point detection, structural breakpoints in the proportion value sequence are identified. These breakpoints usually correspond to sudden changes in system operation state.
[0232] S3.A.5: Aggregate the path difference analysis results composed of the interval proportion value difference rate and the interval distribution change pattern to obtain the original difference rate data.
[0233] In this embodiment, the path difference analysis result aggregation process uses a weighted fusion strategy. This embodiment takes the interval proportion value difference rate and the interval distribution change pattern as two independent characteristic dimensions and calculates a comprehensive difference score using multivariate statistical methods. During the aggregation process, the difference results of different paths are standardized to ensure that the difference scores from different sub-products and different path lengths are comparable. The final original difference rate data not only contains traditional point-to-point difference information, but also incorporates path-level structural difference characteristics, providing richer and more accurate input data for subsequent sharpening.
[0234] The weighted fusion strategy of the path difference analysis result aggregation embodies the complexity and accuracy requirements of multi-dimensional information integration. The embodiment first standardizes the interval proportion difference rate and the interval distribution change pattern, which are two core feature dimensions. The standardization of the interval proportion difference rate uses the Z-score method to convert the difference rate values of all paths into the standard normal distribution form, eliminating the differences in numerical scales between different paths. The standardization of the interval distribution change pattern is more complex, as it contains multiple sub-dimensions such as trend, cycle, and mutation, and needs to be standardized for each sub-dimension.
[0235] The weight determination mechanism uses an adaptive learning method to optimize the weight configuration of each feature dimension by analyzing the risk identification effect of historical gray releases. Machine learning models are used to establish the mapping relationship between feature weights and risk identification accuracy. The training data of the model includes feature values, weight configurations, and final risk identification results in historical gray releases. The embodiment also implements an online learning mechanism to dynamically adjust weight parameters based on real-time feedback of the current gray release, ensuring that the fusion strategy can adapt to changing system environments and business features.
[0236] The application of multivariate statistical methods provides a theoretical basis for the calculation of comprehensive difference scores. Principal component analysis is used to identify the main variation direction in the feature space, and the embodiment determines the importance weight of each feature dimension by calculating its projection on the principal component. Discriminant analysis is used to optimize the classification effect of feature combination by maximizing the inter-class difference and minimizing the intra-class difference to determine the optimal feature weight configuration. The embodiment also uses the idea of ensemble learning to independently calculate the comprehensive score using multiple different statistical methods, and then obtains the final result through voting or weighted averaging.
[0237] The quality control mechanism of the fusion process ensures the reliability and stability of the results. The embodiment implements a cross-validation framework by dividing historical data into training and test sets to verify the generalization ability of the fusion strategy. Confidence interval estimation calculates the uncertainty range of the comprehensive difference score through bootstrap resampling. When the confidence interval is too wide, the embodiment increases the feature sampling density or adjusts the fusion parameters to improve the estimation accuracy. The anomaly detection mechanism identifies fusion results that deviate significantly from the normal pattern based on statistical distance and clustering analysis. These abnormal results are marked and manually reviewed.
[0238] The explainability analysis of the fusion results provides system administrators with a tool for in-depth understanding of the risk assessment process. The embodiment generates a feature contribution decomposition report detailing the specific contribution of each feature dimension to the final comprehensive score. Sensitivity analysis assesses the stability of the fusion results by perturbing input feature values, identifying feature combinations that are highly sensitive to small changes. The visualization display module converts complex multi-dimensional feature relationships into intuitive chart forms, including feature importance bar charts, correlation heat maps, and time series evolution trajectories, helping users quickly understand and verify the rationality of risk assessment.
[0239] Based on the above embodiment, in the present embodiment, step S4.1 can further include steps S4.A.1 to S4.A.5.
[0240] S4.A.1: Establish a Gaussian process regression model for each target sub-product, wherein the input of the Gaussian process regression model includes the gray period calling volume and the first calling volume proportion value, and the target variable of the Gaussian process regression model is the original difference rate data.
[0241] In the present embodiment, the construction of the Gaussian process regression model embodies the application of Bayesian machine learning in parameter optimization. The present embodiment independently establishes a GPR model for each target sub-product, and the input feature matrix includes two dimensions of gray period calling volume and first calling volume proportion value. These features are standardized to ensure numerical stability. The kernel function of the Gaussian process selects a combination of RBF kernel and Matérn kernel, which can effectively capture the non-linear relationship between the input features and the target variables. The hyperparameters of the model are automatically determined by the maximum likelihood estimation method, including the length scale, signal variance and noise variance of the kernel function. The GPR model can not only predict the expected value of the target variable, but also quantify the uncertainty of the prediction, which provides important confidence information for the subsequent optimization algorithm.
[0242] The construction process of the Gaussian process regression model embodies the unique advantages of the Bayesian framework in handling uncertainty and small sample learning. The design of the present embodiment, which independently establishes a GPR model for each target sub-product, takes into account the heterogeneity characteristics between different sub-products, avoiding the generalization bias that may be produced by a global model. Each independent model can fully learn the specific patterns and rules of the corresponding sub-product, including its seasonal characteristics of calling volume changes, stability patterns of proportion value distribution, and sensitivity to external interference, etc. individualized features.
[0243] The construction process of the input feature matrix adopts a carefully designed feature engineering strategy. The gray period call volume feature is processed through logarithmic transformation and quantile standardization to ensure that extreme values do not have an excessive impact on model training. The first call volume proportion value feature is mapped to an unbounded space through a logical transformation, avoiding the limitations of probability value boundary constraints on model learning. The standardization process uses a robust standardization method that uses the median and interquartile range instead of the mean and standard deviation, improving resistance to outliers. This embodiment also monitors the skewness and kurtosis of the feature distribution. When the distribution deviates significantly from normality, the Box-Cox transformation or Yeo-Johnson transformation is automatically applied to correct the distribution.
[0244] The combination of kernel functions makes full use of the complementary characteristics of different kernel functions. The RBF kernel has the smoothness of being infinitely differentiable, which can capture the local similarity patterns in the input space, and is suitable for modeling continuous and smooth function relationships. The kernel family provides more expressive power by adjusting the smoothing parameter, especially And The kernel allows the function to have a finite order derivative while maintaining reasonable smoothness, which is more consistent with the non-fully smooth characteristics that may exist in actual systems. The kernel function combination adopts a weighted sum form, and the weight coefficients are automatically learned through marginal likelihood maximization. This embodiment adaptively adjusts the relative importance of each kernel function during model training.
[0245] The hyperparameter optimization process adopts a hierarchical Bayesian method, which introduces domain knowledge and regularization constraints by setting appropriate prior distributions for hyperparameters. The prior distribution of the length scale parameter is based on the typical scale of the feature space, and the prior of the signal variance parameter is determined according to the empirical variance of the target variable. The noise variance parameter adopts an inverse gamma prior, which reflects the preference for low-noise solutions. This embodiment performs posterior inference through Markov Chain Monte Carlo methods or variational inference techniques to obtain the complete posterior distribution of the hyperparameters rather than just point estimates, providing more information for the quantification of prediction uncertainty.
[0246] The model validation and diagnosis mechanism ensures the quality and reliability of the GPR model. This embodiment calculates the predictive log-likelihood and root mean square error of the model through leave-one-out cross-validation to evaluate the fitting quality and generalization ability of the model. Residual analysis identifies systematic bias and heteroscedasticity problems in the model by examining the distribution characteristics of the prediction residuals. When the model is detected to be insufficient, this embodiment automatically adjusts the kernel function type, increases the feature dimension, or modifies the data preprocessing strategy.
[0247] S4.A.2: determining a multi-objective optimization function, wherein the multi-objective optimization function comprises a difference rate detection model and a false alarm rate model constituted by a sharpening parameter vector comprising the sharpening coefficient and the sharpening coefficient, the multi-objective optimization function being used to indicate maximizing the difference rate detection model and minimizing the false alarm rate model.
[0248] In the present embodiment, the multi-objective optimization function design balances the two conflicting objectives of detection capability and false alarm control. The objective function of the difference rate detection model is defined as wherein, represents the true positive rate, represents the sharpening parameter vector. The objective function of the false alarm rate model is defined as wherein represents the false positive rate. The sharpening parameter vector contains the call volume sharpening coefficient and the proportion value sharpening coefficient, as well as their corresponding boundary parameters and weight factors. The challenge of multi-objective optimization lies in the trade-off between the two objectives, as improving detection capability often increases the risk of false alarms. The system uses the concept of Pareto frontier to handle this trade-off, seeking a solution set that cannot be further improved on both objectives.
[0249] The application of the Pareto frontier concept provides a theoretically rigorous and practically effective solution to the multi-objective optimization problem. The present embodiment first establishes a mathematical framework for multi-objective optimization, taking the difference rate detection model and the false alarm rate model as two competing objective functions. The objective of the difference rate detection model is to maximize the identification rate of true risk, which is quantified by calculating the proportion of high-risk intervals that can be correctly identified after sharpening. The objective of the false alarm rate model is to minimize the frequency of false alarms, which is evaluated by counting the proportion of normal intervals that are incorrectly labeled as high-risk.
[0250] The determination of Pareto dominance relationship adopts a strict mathematical definition and an efficient calculation algorithm. For any two solutions in the solution space, the present embodiment compares their performance on all objective functions. Only when one solution is strictly superior to the other solution on at least one objective, and not inferior to the other solution on all other objectives, is it considered to have a dominance relationship. The identification of non-dominant solutions is achieved by a fast non-dominant sorting algorithm, which can identify all Pareto optimal solutions in the current solution set at a relatively low computational complexity.
[0251] The maintenance and update of the Pareto front employ dynamic data structures and incremental computation techniques. The present embodiment maintains a set of Pareto front solutions. When a new candidate solution is generated, it is compared with the existing front solutions for dominance. If the new solution is dominated by an existing solution, it is discarded. If the new solution dominates some existing solutions, the dominated solutions are removed from the front and the new solution is added to the front. If the new solution is not dominated by any existing solution, it is directly added to the front. To control the number and diversity of front solutions, the present embodiment also implements a crowded distance computation and elitist reservation strategy.
[0252] The solution selection and decision support mechanism provides operational guidance for practical applications. When the Pareto front contains multiple non-dominated solutions, the present embodiment requires a final selection based on business requirements and risk preferences. The weighted method transforms the multi-objective problem into a single-objective problem for solving by assigning importance weights to different objectives. The ideal point method calculates the distance between each front solution and the ideal point, and selects the solution closest to the ideal point as the compromise solution. The interactive decision support system allows users to intuitively observe the trade-off relationship between different solutions through a graphical interface and make subjective choices according to actual needs.
[0253] The evaluation and improvement of front quality provide performance guarantees for the optimization process. The present embodiment evaluates the quality of the front by calculating indicators such as coverage, uniformity and convergence of the front. Coverage measures the distribution range of front solutions in the objective space, uniformity evaluates whether the distribution density between front solutions is uniform, and convergence checks whether the front is close to the true Pareto front. When the front quality does not meet the requirements, the present embodiment adjusts the search strategy, increases the computing resources or modifies the definition of the objective function to improve the optimization effect.
[0254] S4.A.3: Determine a trust region constraint for limiting the range of variation of the parameters in each optimization iteration.
[0255] In the present embodiment, the trust region constraint design ensures the stability and convergence of the optimization process. The radius of the trust region employs an adaptive adjustment strategy, and the initial radius is determined based on the characteristic scale of the parameter space. The radius adjustment rule is based on the comparison between model prediction accuracy and actual improvement effect: when the actual improvement effect is close to or exceeds the model prediction, the present embodiment expands the trust region; when the actual effect is significantly lower than the prediction, the present embodiment shrinks the trust region. This adaptive mechanism can ensure the stability of optimization while accelerating the convergence process.
[0256] S4.A.4: Use a preset Bayesian optimization algorithm to iteratively optimize the sharpening parameter vector based on the Gaussian process regression model and the multi-objective optimization function under the condition of the trust region constraint until convergence or a preset number of iterations is reached.
[0257] In this embodiment, the Bayesian optimization algorithm adopts an improved expected improvement acquisition function. The core idea of the algorithm is to use the predictive mean and variance information of the Gaussian process model to balance the exploration of unknown regions and the use of known optimal regions. In each iteration, search for the parameter point that maximizes the acquisition function value within the trust region constraint, then evaluate the real objective function value at that point and update the Gaussian process model. Multi-objective optimization is handled by the scalarization method, which dynamically adjusts the weight coefficients of each objective to explore different regions of the Pareto front. Convergence is based on the amplitude of parameter changes between consecutive iterations and the degree of improvement of the objective function. When the amplitude of change is less than the preset threshold and there is no significant improvement for several consecutive iterations, the optimization process terminates.
[0258] The improved design of the expected improvement acquisition function fully considers the complex requirements of multi-objective optimization and constraint handling. The traditional expected improvement function only considers the improvement degree of a single objective, while the improved version needs to handle both the difference rate detection and the false alarm rate control. This embodiment constructs a composite expected improvement function by weighted linear combination, and the weight coefficients are dynamically adjusted according to the distribution characteristics of the current Pareto front. When the current front has fewer solutions in a certain objective direction, the weight of the corresponding objective is increased to guide the search process to explore the under-sampled region.
[0259] The calculation process of the acquisition function utilizes the probabilistic properties of the Gaussian process model. For any candidate parameter point, the Gaussian process model can provide the predictive distribution of the objective function value, including the predictive mean and predictive variance. The calculation of expected improvement is based on the comparison between the current optimal value and the predictive distribution, and the probability and expected improvement amplitude exceeding the current optimal value are calculated by integration. The improved acquisition function also introduces an uncertainty reward mechanism, which gives additional exploration incentives to regions with large predictive variance, balancing the trade-off between exploring known excellent regions and exploring unknown regions.
[0260] The handling of trust region constraints adopts the classical method of constraint optimization. This embodiment converts the trust region constraint into a quadratic constraint optimization problem, which is solved by the Lagrange multiplier method or the sequential quadratic programming algorithm. The handling of constraints not only considers the geometric constraints of the parameter space, but also considers the soft constraints based on the model confidence. When the predictive uncertainty of the Gaussian process model in some regions is too high, this embodiment limits the search intensity in these regions through soft constraints to avoid making wrong decisions based on unreliable predictions.
[0261] The global optimization of the search process employs a multi-start parallel strategy and intelligent initialization technique. In this embodiment, multiple initial search points are generated within the trust region. The selection of these points is based on space-filling design and historical search experience. Latin hypercube sampling ensures the uniform distribution of initial points in the parameter space, while heuristic initialization based on gradient information biases the search starting point towards the direction with the largest expected improvement within the current trust region. Multiple search processes are executed in parallel, with real-time monitoring of the progress of each search thread. When a thread finds a significantly better solution, the other threads adjust their search strategies accordingly.
[0262] The model updating and adaptive learning mechanism ensures continuous improvement of the optimization process. After evaluating the objective function at a new parameter point, this embodiment adds the new observation data to the training set and updates the posterior distribution of the Gaussian process model. The incremental learning algorithm avoids the computational overhead of retraining the model from scratch, efficiently integrating new information through recursive updates. This embodiment also periodically re-evaluates the hyperparameter settings of the model. When there is enough accumulated new data, it triggers the re-optimization of hyperparameters, ensuring that the model always maintains optimal prediction performance.
[0263] S4.A.5: Data augmentation is performed on the sharpened parameter vector after iteration and the original difference rate data to optimize the difference rate data after call volume sharpening.
[0264] In this embodiment, the data augmentation process employs an intelligent sampling strategy based on model confidence. This embodiment uses the optimized sharpened parameter vector and the uncertainty information of the Gaussian process model to generate additional training samples based on the original difference rate data. The focus of data augmentation is on areas with high model prediction uncertainty, increasing sample density in these areas to improve the model's generalization ability. The augmentation process uses Conditional Variational Autoencoder (CVAE) technology, which can generate synthetic samples consistent with the original data distribution. The final call volume sharpened difference rate data not only contains the original calculation results, but also incorporates the improvement effect of the optimized parameters and the additional information generated by data augmentation, significantly improving the accuracy and robustness of subsequent risk identification.
[0265] The application of Conditional Variational Autoencoder technology provides strong generative modeling capability for data augmentation. The architecture of CVAE consists of three core components: encoder, decoder, and conditional input. The encoder network maps the original difference rate data to a low-dimensional latent representation space, learning the internal structure and patterns of the data through multiple layers of neural networks. The decoder network performs inverse mapping, reconstructing the original data from the latent representation and conditional information. The conditional input includes meta-feature information of the target sub-product, such as call volume level, historical stability indicators, business type, etc., ensuring that the generated synthetic samples have statistical characteristics matching the specific sub-product.
[0266] The design of latent space adopts the theoretical framework of variational inference, and ensures that the learned representation has good generative properties by introducing regularization terms. The encoder outputs the mean and variance parameters of the latent variable, which defines the posterior distribution of the latent variable. The KL divergence regularization term constrains the posterior distribution to be close to the standard normal prior distribution, ensuring the continuity and interpolability of the latent space. The reparameterization trick moves the random sampling process outside the network, so that the entire model can be trained end-to-end through backpropagation.
[0267] The encoding and integration of conditional information use multi-modal fusion technology. Different types of conditional features are processed by special encoding networks, numerical features are encoded by fully connected layers, and categorical features are converted into dense vector representations by embedding layers. The fusion of multiple conditional features uses an attention mechanism, which automatically learns the importance weights of different conditional features and adjusts the fusion strategy according to the specific needs of the generation task. Conditional information is injected at multiple levels of the decoder to ensure that the generation process can fully utilize the conditional constraints.
[0268] The quality control mechanism of the generation process ensures the authenticity and diversity of the synthetic samples. This embodiment introduces a discriminator network through the idea of adversarial training, whose task is to distinguish between real samples and generated samples, while the generator (decoder of CVAE) aims to generate samples that are realistic enough to deceive the discriminator. This adversarial training process improves the quality of the generated samples, making them closer to the distribution characteristics of the real data. Diversity is ensured by structured sampling in the latent space, and this embodiment samples different regions of the latent space to ensure that the generated samples cover various modes of the data distribution.
[0269] The optimization strategy for model training uses the idea of phased training and curriculum learning. In the initial stage, this embodiment focuses on reconstruction quality by minimizing reconstruction error to learn the basic patterns of the data. In the intermediate stage, regularization terms are introduced to balance the reconstruction quality and the regularity of the latent representation. In the final stage, conditional constraints and quality evaluation are added to ensure that the generated samples meet specific conditional requirements. The learning rate scheduling uses a cosine annealing strategy to dynamically adjust the learning rate during training to achieve better convergence results.
[0270] The verification and screening mechanism of the generated samples ensures the effectiveness of data augmentation. This embodiment verifies the distribution consistency of the generated samples with the original data through multiple statistical test methods, including Kolmogorov-Smirnov test, Anderson-Darling test, etc. The quality score of the generated samples is based on the comprehensive evaluation of reconstruction error, conditional consistency and distribution matching degree. Only the samples that pass the quality threshold will be used for subsequent model training. This embodiment also monitors the impact of the generated samples on the final model performance, and verifies the actual effect of data augmentation through A / B testing.
[0271] In some embodiments, the present application can also include the following steps S6.1 to S6.6.
[0272] S6.1: Identify implicit confounding factors in the gray environment, including user access pattern changes, network environment fluctuations and dependent service performance changes.
[0273] In the process of identifying implicit confounding factors in the gray environment, this embodiment adopts a method combining multi-dimensional monitoring and statistical testing. The identification of user access pattern changes is achieved by analyzing user behavior logs and monitoring key indicators such as user session duration distribution, page access path changes, user device type distribution, etc. This embodiment establishes a user behavior baseline model, and when it detects that the access pattern deviates from the historical baseline by more than a preset threshold, it will automatically be marked as a potential confounding factor. The monitoring of network environment fluctuations covers multiple aspects, including network delay distribution, packet loss rate changes, bandwidth utilization rate fluctuations, etc. Key network indicators. This embodiment integrates with the network monitoring platform interface to obtain network quality data in real time, and uses a sliding window statistical method to identify abnormal network environment changes.
[0274] The identification mechanism of dependent service performance changes is more complex, and this embodiment needs to monitor the health status of all upstream and downstream services. This includes database response time changes, cache hit rate fluctuations, third-party API service availability changes, etc. This embodiment establishes a service dependency graph and identifies all dependent services that may affect the target sub-product through graph traversal algorithms. When it detects significant changes in the performance indicators of dependent services, it calculates the potential impact on the target sub-product, and marks changes with an impact degree exceeding a threshold as confounding factors.
[0275] In addition to predefined confounding factor categories, this embodiment also implements an adaptive confounding factor discovery mechanism. Through principal component analysis and anomaly detection algorithms, this embodiment can automatically identify implicit confounding factors that may exist but have not been explicitly defined. This mechanism is particularly suitable for complex microservice architecture environments, where interactions between systems can produce unexpected confounding effects.
[0276] S6.2: A preset two-stage least squares algorithm is used to establish a causal inference model, wherein a first stage of the causal inference model is used to indicate that a gray scale state is predicted using a quasi-instrumental variable related to the implicit confounding factor, and a second stage of the causal inference model is used to indicate that a true causal effect on a return value distribution is estimated using a predicted value of the gray scale state.
[0277] It should be noted that the implementation of the two-stage least squares (2SLS) algorithm fully considers the particularity of the gray release environment. In the first stage, the embodiment needs to identify and construct an effective quasi-instrumental variable. The selection of the quasi-instrumental variable follows three basic criteria: correlation (strong correlation with the gray scale state), exogeneity (does not directly affect the return value distribution), and exclusivity (only affects the result through the gray scale state). Common quasi-instrumental variables include the random seed of the gray shunt algorithm, the routing weight configuration of the load balancer, and the historical release timestamp unrelated to the current gray scale.
[0278] The specific form of the first-stage regression model is:
[0279]
[0280] wherein GrayStatus represents the gray scale state (0 or 1), InstrumentalVar represents the quasi-instrumental variable vector, ControlVars represents the observable control variables such as request time, user type, etc., is a calculation parameter of the first-stage regression model. The system uses a robust standard error estimation method to handle possible heteroscedasticity and serial correlation problems.
[0281] The second-stage regression uses the predicted value of the first stage to estimate the true causal effect of the gray scale state on the return value distribution. The model form is:
[0282]
[0283] wherein PredictedGrayStatus is the gray scale state predicted value obtained by the first-stage regression, the coefficient represents the pure causal effect of the gray release on the return value distribution, excluding the interference of confounding factors, is a calculation parameter of the corresponding model.
[0284] In addition, the embodiment also implements a variety of robustness test methods, including weak instrumental variable test, over-identification test, etc., to ensure the reliability of the causal inference result. When it is detected that the strength of the instrumental variable is insufficient or there is an over-identification problem, the model setting is automatically adjusted or a more suitable instrumental variable is found.
[0285] S6.3: Calculate the confounding sensitivity index (CSI) of each target sub-product based on the raw difference ratio data and the adjusted difference ratio data.
[0286] The calculation of the confounding sensitivity index (CSI) reflects the value of causal inference in risk assessment. In this embodiment, the raw difference ratio data (without confounding adjustment) and the adjusted difference ratio data (adjusted by the causal inference model) are obtained through the aforementioned steps. In the generation process of the adjusted difference ratio data, the pure effect estimated by the causal inference model is used to correct the raw difference ratio, eliminating the influence of confounding factors.
[0287] The calculation formula of CSI is:
[0288]
[0289] where RawDiffRatio represents the raw difference ratio, AdjustedDiffRatio represents the adjusted difference ratio, and threshold is the minimum threshold set to avoid division by zero error. The larger the CSI value, the more susceptible the difference ratio of the sub-product interval to the confounding factors, and the lower the reliability of the risk assessment result.
[0290] Optionally, the embodiment also calculates the confidence interval of CSI, estimates the distribution characteristics of CSI by bootstrap resampling. This statistical method can quantify the uncertainty of CSI estimation, providing a more reliable basis for subsequent risk classification. When the confidence interval of CSI is wide, it indicates that the estimation of confounding sensitivity has a large uncertainty, and the corresponding warning information is given in the risk report.
[0291] S6.4: Calculate the causal weight based on the confounding sensitivity index.
[0292] In this embodiment, the calculation of causal weight considers multiple dimensions such as causal effect strength, statistical significance, and confounding sensitivity. The basic causal weight calculation formula is:
[0293]
[0294] where CausalWeight represents the causal weight, CausalEffect represents the causal effect size estimated by the causal inference model, CSI represents the confounding sensitivity index, and threshold is the minimum threshold set to avoid division by zero error. The larger the CSI value, the more susceptible the difference ratio of the sub-product interval to the confounding factors, and the lower the reliability of the risk assessment result. The statistical significance level representing the causal effect, CSI is the aforementioned confounding sensitivity index, and the Reliability Factor is a reliability adjustment factor based on the strength of the instrumental variable and model diagnostics. This multi-dimensional weight design ensures that the causal weight accurately reflects the strength and reliability of the causal relationship in each sub-product interval.
[0295] Optionally, the embodiment also implements a dynamic weight adjustment mechanism to adjust the current weight calculation based on the accuracy of historical causal inference. By maintaining a historical record of causal inference accuracy, it can identify better weight calculation strategies under certain conditions and perform corresponding parameter optimization.
[0296] S6.5: Perform causal enhancement sharpening on the causal weight and the sharpening difference rate data to form a causal enhancement risk assessment result.
[0297] In this embodiment, the causal enhancement sharpening process combines traditional statistical sharpening methods with causal inference results to form a more reliable risk assessment framework. The core formula of enhanced sharpening is:
[0298]
[0299] Where CausalEnhancedRatio represents the causal enhancement risk assessment result, StandardSharpedRatio represents the preset standard sharpening rate, and ConfidenceMultiplier represents the adjustment factor based on the confidence of causal inference. When the confidence interval of the causal effect is narrow and the statistical significance is high, the factor is close to 1; when there is a large uncertainty in the causal inference result, the factor will be reduced accordingly, so that a lower weight is given in the final risk assessment.
[0300] In addition, the causal enhancement sharpening process also includes time series consistency testing. This embodiment compares the current causal inference result with the causal pattern of the same type of gray release in history to identify abnormal changes in causal relationship. When a significant change in causal pattern is detected, an additional verification process is triggered to ensure the accuracy of risk assessment.
[0301] S6.6: Based on the causal enhancement risk assessment result, divide the identified risk points into high confidence causal risk, possible causal risk and correlation risk, and generate the high risk sub-product list and the corresponding risk prompt report.
[0302] In this embodiment, the risk stratification based on the causal enhancement risk assessment result adopts a multi-level classification standard. The determination standard of high-confidence causal risk includes: statistically significant causal effect (p < 0.01), causal weight exceeding a preset threshold (usually 0.7), low confounding sensitivity index (CSI < 0.3), and sufficient tool variable strength. The risk points meeting these conditions are considered as high-confidence risks directly caused by gray release.
[0303] The determination standard of possible causal risk is relatively loose, including the case of marginal significant causal effect (0.01 < p < 0.1) or medium-level causal weight (0.3 < CausalWeight < 0.7). Such risk points may have a real causal relationship, but the evidence strength is insufficient to meet the high-confidence standard.
[0304] Correlation risk refers to risk points that only have statistical correlation but lack sufficient causal evidence. The causal weight of these risk points is usually low (CausalWeight < 0.3), or the confounding sensitivity index is high (CSI > 0.7), indicating that the observed difference may be mainly caused by confounding factors.
[0305] The generation of the risk prompt report adopts interpretable AI technology, which not only provides risk classification results, but also details the basis for classification and the process of causal inference. The report contains causal path diagrams, counterfactual analysis results, confounding factor impact assessment, and other contents, helping engineers to deeply understand the nature and mechanism of risks. This embodiment also proposes specific problem solving solutions and preventive measures based on causal relationship analysis.
[0306] As shown in Figure 4 The present application also provides a system gray release based on product value distribution automatic testing device, which comprises:
[0307] The to-be-tested sub-product screening module 401 is configured to query the first calling amount data of each sub-product in the previous N days and the second calling amount data during the gray period based on the obtained preset calling amount threshold, and screen out sub-products whose first calling amount data and second calling amount data both exceed the corresponding calling amount threshold, to form a to-be-tested sub-product list, wherein the calling amount threshold includes a previous N-day calling amount threshold and a gray period calling amount threshold. ;
[0308] The value interval division module 402 is configured to perform value interval division on each target sub-product in the to-be-tested sub-product list based on the API calling return value of the target sub-product in the previous N days, according to the API calling return value, a preset central interval target calling amount proportion value, and a target interval number, to generate a value interval of each target sub-product.
[0309] The difference calculation module 403 is configured to calculate the first call amount proportion value and the second call amount proportion value in parallel through multi-threading, and calculate a difference rate of the call amount proportion value of each value interval in the two time periods based on the first call amount proportion value and the second call amount proportion value as original difference rate data, wherein the first call amount proportion value is used to indicate the percentage of the call amount of each value interval of the target sub-product in the total call amount of the target sub-product in the previous N days, and the second call amount proportion value is used to indicate the percentage of the call amount of each value interval of the target sub-product in the total call amount during the gray period.
[0310] The sharpening processing module 404 is configured to perform call amount sharpening processing on the original difference rate data based on the call amount of each value interval of each target sub-product during the gray period to obtain call amount sharpened difference rate data, and perform proportion value sharpening processing based on the call amount sharpened difference rate data and the first call amount proportion value to obtain sharpened difference rate data.
[0311] The risk identification module 405 is configured to calculate a group average sharpened difference rate of each target sub-product based on the sharpened difference rate data, identify a first a target sub-product in the order of the group average sharpened difference rate, and filter a first b value interval in the order of the sharpened difference rate data, and merge and remove the identified target sub-product and the target sub-product corresponding to the filtered value interval to generate a high-risk sub-product list and a corresponding risk prompt report, wherein the group average sharpened difference rate is used to indicate the average value of the sharpened difference rate data of all value intervals of a single sub-product. , .
[0312] The above is only a preferred embodiment of the present application, and is not a limitation on the form and essence of the present application. Those skilled in the art can make various changes and improvements to the technical solutions of the embodiment without departing from the concept and principles of the present application. The formed new technical solutions are all within the protection scope of the present application.
Claims
1. A method for automated testing based on product value distribution in system gray release, characterized in that, The method comprises the following steps: Based on the obtained preset calling quantity threshold, the first calling quantity data of each sub-product in the previous N days and the second calling quantity data during the gray period are queried, and the sub-products whose first calling quantity data and second calling quantity data both exceed the corresponding calling quantity threshold are screened out to form a list of sub-products to be tested, wherein the calling quantity threshold includes a calling quantity threshold in the previous N days and a calling quantity threshold during the gray period, ; Based on the API call return value of each target sub-product in the list of sub-products to be tested in the past N days, value interval division is performed according to the API call return value, a preset central interval target call quantity proportion value and a target interval number execution value, and the value interval of each target sub-product is generated. The first call quantity proportion value and the second call quantity proportion value are calculated in parallel through multi-threading, and the difference rate of the call quantity proportion value of each value interval in the two time periods is calculated based on the first call quantity proportion value and the second call quantity proportion value as the original difference rate data, wherein the first call quantity proportion value is used to indicate the percentage of the call quantity of the target sub-product in each value interval to the total call quantity of the target sub-product, and the second call quantity proportion value is used to indicate the percentage of the call quantity of the target sub-product in each value interval during the gray period to the total call quantity. Based on the gray period call quantity of each target sub-product in each value interval during the gray period, call quantity sharpening processing is performed on the original difference rate data to obtain call quantity sharpened difference rate data, and proportion value sharpening processing is performed based on the call quantity sharpened difference rate data and the first call quantity proportion value to obtain sharpened difference rate data. Based on the sharpening difference rate data, a group average sharpening difference rate of each target sub-product is calculated, a top a target sub-product in the group average sharpening difference rate is identified, and a top b value interval in the sharpening difference rate data is screened out, the identified target sub-product and the target sub-product corresponding to the screened value interval are combined and de-duplicated to generate a high-risk sub-product list and a corresponding risk prompt report, wherein the group average sharpening difference rate is used to indicate the average value of the sharpening difference rate data of all value intervals of a single sub-product, , .
2. The method of claim 1, wherein, The value interval of each target sub-product is generated based on the API call return value of each target sub-product in the list of sub-products to be tested in the past N days, value interval division is performed according to the API call return value, a preset central interval target call quantity proportion value and a target interval number execution value, and the value interval of each target sub-product is generated. The API call return value of each target sub-product in the list of sub-products to be tested in the past N days is queried, and the API call return value is arranged in ascending order to form a return value array; From the return value array, the possible interval satisfying the central interval target call quantity proportion value is selected, and the possible interval minimizing the return value range is selected as the central interval; According to the target proportion value and the target interval number, the target proportion value of each interval is determined; Taking the central interval as a reference, other intervals are determined according to the target proportion value to the left and right sides in turn, until the number of intervals reaches the target interval number, and the value interval of each target sub-product is obtained.
3. The method of claim 2, wherein, The first call quantity proportion value and the second call quantity proportion value are calculated in parallel through multi-threading, and the difference rate of the call quantity proportion value of each value interval in the two time periods is calculated based on the first call quantity proportion value and the second call quantity proportion value as the original difference rate data, wherein the first call quantity proportion value is used to indicate the percentage of the call quantity of the target sub-product in each value interval to the total call quantity of the target sub-product, and the second call quantity proportion value is used to indicate the percentage of the call quantity of the target sub-product in each value interval during the gray period to the total call quantity. A thread pool is created according to the available system resources, and an independent calculation thread is allocated to each target sub-product in the thread pool; In the calculation thread of each target sub-product, the historical call quantity of each value interval of the target sub-product in the past N days is queried, and the proportion of the historical call quantity of each value interval to the total call quantity is calculated as the first call quantity proportion value; In the calculation thread, the gray period call quantity of each value interval of the target sub-product during the gray period is queried, and the proportion of the gray period call quantity of each value interval to the total call quantity is calculated as the second call quantity proportion value; For each value interval of each target sub-product, a difference rate of interval call volume proportion values of the gray period and the previous N days is calculated according to the first call volume proportion value and the second call volume proportion value, and the original difference rate data is obtained by aggregating the calculation results of each calculation thread.
4. The method of claim 3, wherein, The original difference rate data is subjected to call volume sharpening processing based on the gray period call volume of each target sub-product in each value interval of the gray period, to obtain difference rate data after call volume sharpening, including: The gray period call volumes of all target sub-products are sorted in ascending order, and the gray period call volume at the median of the sorting is selected as a reference call volume; If the gray period call volume of the target sub-product is greater than the reference call volume, a first sharpening parameter calculation model is used to calculate the gray period call volume and the reference call volume, to obtain a first sharpening parameter; otherwise, a second sharpening parameter calculation model is used to calculate the gray period call volume and the reference call volume, to obtain a second sharpening parameter; wherein the second sharpening parameter is the inverse of the first sharpening parameter, and the sharpening parameter is one of the first sharpening parameter and the second sharpening parameter; The original difference rate data is subjected to call volume sharpening processing according to the sharpening parameter, to obtain difference rate data after call volume sharpening.
5. The method of claim 4, wherein, The first call volume proportion values of all value intervals of all target sub-products are sorted in ascending order, and the first call volume proportion value at the median of the sorting is taken as a reference proportion value; For each value interval of each target sub-product, the ratio between the first call volume proportion value and the reference proportion value is calculated, and a sharpening coefficient is calculated according to a configured proportion value sharpening percentage; For the value interval of the target sub-product whose first call volume proportion value is greater than the reference proportion value, a first sharpening coefficient calculation model is used to calculate the ratio and a preset proportion value sharpening percentage, to obtain a first sharpening coefficient; For the value interval of the target sub-product whose first call volume proportion value is not greater than the reference proportion value, a second sharpening coefficient calculation model is used to calculate the ratio and a preset proportion value sharpening percentage, to obtain a second sharpening coefficient, wherein the sharpening coefficient is one of the first sharpening coefficient and the second sharpening coefficient; The difference rate data after call volume sharpening is subjected to proportion value sharpening processing according to the sharpening coefficient, to obtain the sharpened difference rate data. The value intervals of each target sub-product in the list of sub-products to be tested are generated by performing value interval division according to the API call return value, a preset central interval target call volume proportion value, and a target interval number, in addition to the above-mentioned steps.
6. The method of claim 5, wherein, constructing the API call return values of the target sub-products in the past N days as a stream data graph, wherein each vertex in the stream data graph represents an API call return value, and the weight of an edge in the stream data graph represents a frequency difference between two adjacent API call return values; compressing and storing return value frequency information of the API call return values by using a counting sketch data structure to optimize the stream data graph, so that the spatial complexity of the optimized stream data graph is reduced from a linear level to a logarithmic level; constructing a path in a single data stream scan using a preset approximation factor, wherein the path represents a natural clustering interval of the API call return values, and the length of the path is determined by the approximation factor and the length of the longest path in the optimized stream data graph; from the constructed multiple paths, filtering out paths that meet the path requirements related to the target call volume proportion value of the center interval, and splitting the filtered paths according to the target interval quantity according to a preset splitting strategy, wherein the splitting strategy is used to indicate selecting a splitting point that minimizes the total difference between each interval and the target proportion value; fine-tuning the interval boundaries after splitting, so that the actual proportion value of each interval after splitting is less than a preset difference threshold from the preset target proportion value distribution, to obtain the value interval of each target sub-product.
7. The method of claim 6, wherein, The first call volume proportion value and the second call volume proportion value are calculated by multi-thread parallel computing, and the difference rate of the value interval call volume proportion values in the two time periods is calculated based on the first call volume proportion value and the second call volume proportion value as the original difference rate data, and the method further comprises: constructing a first graph structure based on the first call volume proportion value of each target sub-product, wherein a node in the first graph structure represents a value interval, and an edge in the first graph structure represents a relationship between first call volume proportion values corresponding to adjacent value intervals; constructing a second graph structure based on the second call volume proportion value of each target sub-product, wherein a node in the second graph structure represents a value interval, and an edge in the second graph structure represents a relationship between second call volume proportion values corresponding to adjacent value intervals; performing parallel processing on the first graph structure and the second graph structure corresponding to all target sub-products by using a preset semi-stream strategy, so as to find a target path with the largest difference between the first graph structure and the second graph structure, wherein the semi-stream strategy is used to indicate saving only key intermediate results; calculating an interval proportion value difference rate based on the target path, mapping the target path as a whole change of an interval sequence to identify an interval distribution change pattern; summarizing a path difference analysis result composed of the interval proportion value difference rate and the interval distribution change pattern to obtain the original difference rate data.
8. The method of claim 7, wherein, The call volume sharpening processing is performed on the original difference rate data based on the call volume of each value interval during the gray period of each target sub-product to obtain the difference rate data after call volume sharpening, and the method further comprises: establish a Gaussian process regression model for each target sub-product, wherein the input of the Gaussian process regression model comprises the gray period invocation quantity and the first invocation quantity proportion value, and the target variable of the Gaussian process regression model is the original difference rate data; determine a multi-objective optimization function, wherein the multi-objective optimization function comprises a difference rate detection model and a false positive rate model composed of a sharpening parameter vector, the sharpening parameter vector comprises the sharpening coefficient and the sharpening coefficient, and the multi-objective optimization function is used to indicate that the difference rate detection model is maximized and the false positive rate model is minimized; determine a trust region constraint for limiting the variation range of the parameters in each optimization iteration; using a preset Bayesian optimization algorithm, iteratively optimize the sharpening parameter vector under the condition of the trust region constraint based on the Gaussian process regression model and the multi-objective optimization function until convergence or a preset number of iterations is reached; perform data enhancement on the sharpening parameter vector and the original difference rate data after iteration to optimize the difference rate data after invocation sharpening.
9. The method of claim 8, wherein, The method further comprises: identify implicit confounding factors in the gray environment, including user access mode changes, network environment fluctuations, and dependent service performance changes; adopt a preset two-stage least squares algorithm to establish a causal inference model, wherein the first stage of the causal inference model is used to indicate that the gray state is predicted using quasi instrumental variables related to the implicit confounding factors, and the second stage of the causal inference model is used to indicate that the true causal effect on the return value distribution is estimated using the predicted value of the gray state; based on the original difference rate data and the difference rate adjustment data, calculate the confounding sensitivity index of each target sub-product, wherein the difference rate adjustment data is obtained by adjusting the original difference rate data using the causal inference model; based on the confounding sensitivity index, calculate the causal weight; perform causal enhancement sharpening processing on the causal weight and the sharpened difference rate data to form a causal enhancement risk assessment result; based on the causal enhancement risk assessment result, divide the identified risk points into high confidence causal risks, possible causal risks, and correlation risks, and generate the high-risk sub-product list and the corresponding risk prompt report.
10. A system for automated testing based on product value distribution in gray release, characterized in that, It includes: The to-be-tested sub-product screening module is configured to query first calling quantity data of each sub-product in the previous N days and second calling quantity data of each sub-product during the gray period based on the obtained preset calling quantity threshold, screen out sub-products whose first calling quantity data and second calling quantity data both exceed the corresponding calling quantity threshold, and form a to-be-tested sub-product list, wherein the calling quantity threshold includes a previous N-day calling quantity threshold and a gray-period calling quantity threshold. ; a value interval division module for performing value interval division based on the API call return value of each target sub-product in the to-be-tested sub-product list in the previous N days, according to the API call return value, a preset central interval target invocation quantity proportion value, and a target interval number, to generate a value interval for each target sub-product; The difference calculation module is configured to calculate the first call amount proportion value and the second call amount proportion value in parallel through multi-threading, and calculate a difference rate of the call amount proportion value of each value interval in the two time periods based on the first call amount proportion value and the second call amount proportion value as original difference rate data, wherein the first call amount proportion value is used to indicate a percentage of the call amount of each value interval of the target sub-product in the total call amount of the target sub-product in the previous N days, and the second call amount proportion value is used to indicate a percentage of the call amount of each value interval of the target sub-product in the total call amount during the gray period; The sharpening processing module is configured to perform call amount sharpening processing on the original difference rate data based on the call amount of each value interval of each target sub-product during the gray period to obtain call amount sharpened difference rate data, and perform proportion value sharpening processing based on the call amount sharpened difference rate data and the first call amount proportion value to obtain sharpened difference rate data. The risk identification module is configured to calculate a group average sharpening difference rate of each target sub-product based on the sharpening difference rate data, identify a first a target sub-product with a highest group average sharpening difference rate, and filter a first b value interval with a highest value in the sharpening difference rate data, and combine and remove duplicates of the identified target sub-product and a target sub-product corresponding to the filtered value interval to generate a high-risk sub-product list and a corresponding risk prompt report.
Citation Information
Patent Citations
Information system gray release migration method and system
CN119336550A
Micro-service full-link gray flow management system and method based on PaaS (Platform as Service)
CN119906701A