A method and system for set-top box automated test result generation and review

By generating automated test cases for set-top boxes using K-means clustering and defect prediction models, and combining multimodal data acquisition and anomaly detection, the problems of misjudgment and insufficient scenario coverage in set-top box testing are solved, achieving efficient and accurate defect detection and dynamic adaptability.

CN120916009BActive Publication Date: 2026-03-20海看网络科技(山东)股份有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511097608.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-06
Publication Date
2026-03-20
Estimated Expiration
2045-08-06

AI Technical Summary

Technical Problem

The existing automated testing framework for set-top boxes is incompatible with set-top box devices, resulting in misjudgments of test results, insufficient scenario coverage, delayed defect detection, and low efficiency.

Method used

By extracting behavioral patterns using the K-means clustering algorithm, a defect prediction model is constructed, generating core test cases and boundary test cases. Combined with multimodal data acquisition and anomaly detection, real-time feature extraction and review strategies are implemented, and test reports are dynamically generated.

Benefits of technology

It improves the relevance and coverage of test cases, enhances the accuracy and foresight of defect detection, optimizes testing efficiency, reduces false positives, and improves the dynamic adaptability and iterative capability of testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120916009B_ABST
    Figure CN120916009B_ABST
Patent Text Reader

Abstract

The application discloses a kind of set top box automation test result generation and review method and system, mainly related to set top box automation test technical field.It includes the following steps: dynamically generating core test cases and boundary test cases;Synchronous capture screen rendering picture, form multimodal test dataset;In combination with preset threshold and change amplitude value judge whether there is exception;Abnormal data and context information are pushed to review module, and according to the type of exception automatically match corresponding review strategy;Verify the integrity of protocol interaction;According to the analysis result, generate structured test report and automatically associate historical test data to carry out baseline comparison;Review result is fed back to defect prediction model to trigger code repair and regression test.The beneficial effects of the application are that it solves the problems of insufficient scene coverage, defect detection lag and low efficiency in existing set top box testing.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field, and particularly relates to a method and system for generating and reviewing automatic test results of a set top box. BACKGROUND

[0002] Due to the particularity of the set top box device and the limitation of the use scene, the test of the set top box device mainly depends on manual operation; the existing automatic test framework has been very mature in the application on mobile devices and web pages, but cannot be compatible with the set top box test. Even if some can be used by force, the test cannot be simultaneously performed on multiple devices. The main reasons for this problem are as follows: 1. the characteristics of the set top box device, the operation page is through a remote controller, and cannot be touched, clicked and slid like a mobile phone; 2. the configuration and performance of most IPTV set top boxes are general, and cannot support large automatic test; 3. due to the low configuration of most television set top boxes and the low system version, most of which are based on the Android 4.4 system, and combined with the customized development of various manufacturers, the framework is difficult to be compatible. In this way, the page content cannot be operated and judged through mainstream methods such as control Id or Xpath, even if the script can be executed through the ADB debugging bridge and the like, there is no particularly good solution to judge the result of the script execution, and the manual observation of the HDMI output is required to judge whether the picture is normal, and the execution needs to be re-performed in case of failure.

[0003] At present, when the set top box device is automatically tested, due to the fact that the mature framework cannot be used for assertion judgment, even if the devices can be controlled in batches, it can only be ensured that the devices can run, and as to whether the running is correct or not, and which step in the running has a problem, it cannot be traced back, which leads to the fact that the script execution and the result judgment cannot be well combined; in addition, the device may also have the following misjudgment cases:

[0004] 1. the error result is misjudged as passed, and when the judgment condition is not strict enough and the minimum similarity threshold is low, the error result may be passed;

[0005] 2. due to the fact that the condition is too strict, two pictures with the same content may be judged as not passed due to different execution devices, network loading, page display picture changes and the like.

[0006] Therefore, a method and system for generating and reviewing automatic test results of a set top box are required to solve the above problems. SUMMARY

[0007] The present application relates to the technical field, and particularly relates to a method and system for generating and reviewing automatic test results of a set top box.

[0008] The application is realized by the following technical solutions to achieve the above-mentioned purposes.

[0009] In one aspect, a method for generating and reviewing test results of a set-top box is provided, comprising the following steps:

[0010] Step S1: Based on historical test data and user behavior logs, behavior patterns are extracted by a K-means clustering algorithm, and a defect prediction model is constructed to dynamically generate core test cases and boundary test cases;

[0011] Step S2: Through the lightweight agent built-in the set-top box, current data, system logs, network interaction data during testing are collected in real time, and screen rendering pictures are captured synchronously to form a multi-modal test data set;

[0012] Step S3: The collected current data is normalized, a corrosion and expansion structural element is constructed by a gray-scale morphology algorithm, real-time feature extraction is performed on the test data, and whether there is an anomaly is determined in combination with a preset threshold and a change amplitude value;

[0013] Step S4: If an anomaly is detected, a review process is automatically triggered, the anomaly data and context information are pushed to a review module, and a corresponding review strategy is automatically matched according to the anomaly type;

[0014] Step S5: The test results are analyzed in multiple dimensions, including analyzing error descriptions in log texts by natural language processing technology, verifying the correctness of screen rendering by image recognition technology, and verifying the integrity of protocol interaction by network packet capture data;

[0015] Step S6: A structured test report is generated according to the analysis results, including test coverage, defect distribution heat map, performance index trend curve, and automatically associating historical test data for baseline comparison;

[0016] Step S7: The review results are fed back to the defect prediction model, the test case library and anomaly detection rules are updated, and the test results are synchronized to the development process through a continuous integration interface to trigger code repair and regression testing.

[0017] Preferably, in step S1, the dynamically generated core test cases and boundary test cases further comprise:

[0018] In combination with the set-top box model, software version, and network environment metadata, high-risk test scenarios are filtered out by a decision tree algorithm to generate targeted test cases;

[0019] The execution order of the test cases is optimized by a genetic algorithm to minimize test time and maximize defect discovery rate.

[0020] Preferably, step S3 further comprises:

[0021] The current data is subjected to Fourier transform to extract frequency domain features, and a long short-term memory network is used to predict current fluctuation trends to provide early warning of potential abnormalities.

[0022] The voting method is used to integrate the gray scale morphology detection result and the LSTM prediction result.

[0023] Preferably, in step S4, the review strategy comprises:

[0024] For sporadic abnormalities, the test case is automatically re-executed three times, and if the abnormality recurs, deep log analysis is triggered.

[0025] For high-frequency abnormalities, solutions in the knowledge base are automatically associated to generate repair suggestions and push them to the development team.

[0026] For complex abnormalities, an interactive debugging interface is pushed to the test engineer terminal through WebSocket real-time connection.

[0027] Preferably, step S5 further comprises:

[0028] The convolutional neural network is used for semantic segmentation of screenshots to verify the correctness and rendering integrity of UI elements.

[0029] The natural language processing technology is used for sentiment analysis of test logs and quantification of user experience risks.

[0030] On the other hand, a system for generating and reviewing the test results of a set-top box is provided, based on the method for generating and reviewing the test results of a set-top box as described above, comprising:

[0031] Dynamic test case generation module: based on big data analysis and machine learning algorithms, dynamically generates test cases and optimizes the execution order;

[0032] Multi-modal data acquisition module: integrates current sensors, screen capture units, and network packet capture tools to realize real-time acquisition and synchronous storage of multi-dimensional data;

[0033] Intelligent anomaly detection module: combines gray scale morphology algorithm and LSTM network to perform real-time anomaly detection and trend prediction on test data;

[0034] Adaptive review module: automatically matches review strategies according to abnormal types, supporting three modes of automatic retry, deep analysis, and manual intervention;

[0035] Multi-dimensional analysis and reporting module: uses CNN, NLP, and other technologies to perform multi-modal analysis on test results, generates dynamic test reports, and supports multi-format output;

[0036] Continuous optimization module: update test case library and exception detection rules through feedback mechanism, realize closed-loop optimization of test strategy.

[0037] Preferably, the dynamic test case generation module comprises:

[0038] Behavior pattern extraction unit: based on K-means clustering algorithm, analyze historical test data and user behavior log, extract typical behavior pattern;

[0039] Defect prediction model training unit: adopt random forest algorithm to construct defect prediction model, predict defect discovery probability of test case;

[0040] Test case generation optimization unit: use genetic algorithm to optimize execution order and parameter combination of test case.

[0041] Preferably, the multi-modal data acquisition module comprises:

[0042] Current data acquisition submodule: through high-precision current sensor, acquire current fluctuation data of set-top box running, sampling frequency is not less than 1kHz;

[0043] Screen capture submodule: adopt hardware accelerated screen recording technology, capture set-top box output picture in real time, support resolution adaptation;

[0044] Network packet capture submodule: based on libpcap library, realize real-time capture and protocol analysis of network feature packet.

[0045] Preferably, the intelligent exception detection module comprises:

[0046] Feature engineering unit: extract time domain and frequency domain features from current data, and generate feature vector;

[0047] Abnormal detection model unit: adopt LSTM network to construct current fluctuation prediction model, combine threshold judgment and voting mechanism to output exception detection result;

[0048] Early warning pushing unit: push abnormal early warning information to review module and operation and maintenance terminal through message queue.

[0049] Preferably, the multi-dimensional analysis and reporting module comprises:

[0050] Image analysis unit: based on CNN model, perform UI element recognition and rendering quality evaluation on screenshot;

[0051] Log analysis unit: adopt BERT model to perform semantic analysis on test log, extract error type and influence range;

[0052] Report generation unit: dynamically generate HTML reports containing interactive charts, defect trace links, and support one-key export to PDF or integrate into the Confluence platform.

[0053] Compared with the prior art, the present application has the following advantages:

[0054] 1. Improve the pertinence and coverage of test cases:

[0055] By extracting user behavior patterns and typical features in historical test data through the K-means clustering algorithm, high-frequency scenarios and high-risk operation sequences in set-top box testing can be accurately identified, and core test cases can be generated in combination with a defect prediction model to ensure that key scenarios where defects are most likely to occur are covered. At the same time, boundary test cases are generated for boundary samples between clusters and outliers, which makes up for the lack of coverage of non-typical scenarios in traditional fixed script testing and reduces the testing blind area.

[0056] 2. Improve the accuracy and forward-looking nature of defect detection:

[0057] The defect prediction model is based on the logistic regression algorithm and is trained through historical defect data, which can quantitatively evaluate the defect occurrence probability of different test scenarios and lock in high-risk test points in advance, avoiding the problem of "blindly executing test cases and missing key defects" in traditional testing. Combined with Euclidean distance calculation and cluster center iteration optimization, the behavior pattern classification is more accurate, providing reliable feature input for defect prediction and further improving detection accuracy.

[0058] 3. Optimize test efficiency and resource allocation:

[0059] By classifying test scenarios through K-means clustering, redundant test cases can be reduced and redundant execution costs can be reduced. At the same time, the defect prediction model prioritizes the testing of high-risk scenarios, which can prioritize the verification of key functions under limited resources, solving the problem of "fixed testing process and low efficiency" and improving overall testing efficiency.

[0060] 4. Enhance the dynamic adaptability and iteration capability of testing:

[0061] The generation of test cases is based on real-time updated user behavior logs and historical defect data, and through cluster center iteration and model parameter optimization, it can dynamically adapt to new scenarios such as set-top box software version iteration and user operation habit changes, avoiding the limitations of traditional test cases that are difficult to adjust once generated, and enabling the testing scheme to have continuous optimization capability.

[0062] 5. Provide accurate basis for review and reduce misjudgment:

[0063] The generation process of the core test case and the boundary test case is deeply related to the defect prediction model, the test result can be directly traced back to specific behavior patterns and risk probabilities, which provides clear judgment basis for subsequent review, reduces the subjectivity of manual review, and the coverage of the boundary test case on the extreme scene also reduces the misjudgment caused by incomplete test scene. BRIEF DESCRIPTION OF DRAWINGS

[0064] Figure 1 is a method flowchart of the present application;

[0065] Figure 2 is a data preprocessing flowchart of the present application. DETAILED DESCRIPTION

[0066] The present application will be further described below in conjunction with specific embodiments. It should be understood that these embodiments are only used to illustrate the present application and not to limit the scope of the present application. In addition, it should be understood that those skilled in the art can make various modifications or changes to the present application after reading the content taught by the present application, and these equivalent forms also fall within the scope defined by the present application.

[0067] In the present application, the terms such as "upper", "lower", "left", "right", "front", "back", "vertical", "horizontal", "side", "bottom" and the like indicate the orientation or positional relationship shown in the drawings, which is only a relationship word determined for the convenience of describing the structural relationship of the components or elements of the present application, and cannot be understood as a limitation on the present application.

[0068] Embodiment:

[0069] As shown in Figure 1 , the present embodiment provides a method for generating and reviewing automatic test results of a set-top box, comprising:

[0070] Step S1: based on historical test data and user behavior logs, behavior patterns are extracted by K-means clustering algorithm, and a defect prediction model is constructed to dynamically generate core test cases and boundary test cases, wherein the dynamic generation of core test cases and boundary test cases further comprises: combining set-top box models, software versions, network environment metadata, high-risk test scenarios are screened out by decision tree algorithm to generate targeted test cases; the execution order of the test cases is optimized by genetic algorithm to minimize the test time and maximize the defect discovery rate, and the specific implementation of the K-means clustering algorithm for extracting behavior patterns in the above process comprises:

[0071] In the present embodiment, 1000 user behavior logs are collected, and 3 features are extracted from each log, respectively denoted as: 、 、 , wherein, This indicates the number of remote control operations (such as channel switching and volume adjustment) within a single session. This indicates the average time spent on the page (in seconds). This represents the number of failed network requests (reflecting the impact of network fluctuations), and maps the above characteristics to... Intervals are used to eliminate the influence of dimensions:

[0072] ;

[0073] in, The standardized value. , Features The minimum and maximum values;

[0074] Set the number of clusters In this embodiment, The data includes three modes: "regular browsing," "high-frequency operation," and "abnormal network." Three initial cluster centers are randomly selected. , , Calculate the Euclidean distance from each sample to the cluster center:

[0075] ;

[0076] The samples are assigned to the nearest cluster, and the cluster center is recalculated (using the mean of samples within the cluster):

[0077] ;

[0078] in, For clusters The number of samples;

[0079] Repeat the process of calculating the Euclidean distance from each sample to the cluster center and recalculating the cluster center until the cluster center changes. If the value is less than the threshold of 0.01, three behavioral patterns are ultimately obtained.

[0080] The specific implementation of building a defect prediction model and generating test cases includes:

[0081] Using pattern features obtained through K-means clustering and historical defect data as feature inputs, the model's formula is expressed as follows:

[0082] ;

[0083] in, For a given feature The probability of time defects occurring, This indicates that a defect has occurred in this mode. The intercept is... Feature weight (trained by historical data);

[0084] Core test cases: For typical behaviors corresponding to cluster centers (such as "regular browsing mode": less operation times, long stay time, stable network), generate test cases to verify basic functions (such as page rendering, response speed);

[0085] Boundary test cases: For cluster edges or outliers (such as "high-frequency operation + network fluctuation": more than 20 operations per minute, more than 3 network failures), generate test cases to verify extreme scenarios (such as stuttering and crashing when continuously switching channels);

[0086] High-risk test scenarios are selected by decision tree algorithm, including:

[0087] Selected features include "network type (wired / wireless)", "operation type (navigation / play)", and "device model (high-end / medium-end / low-end)";

[0088] Calculate the initial information entropy (defect label: 1 for defective, 0 for non-defective):

[0089] ;

[0090] Where, is the proportion of defective samples, ;

[0091] If "network type is wireless", further divide by "device model", when "device model is low-end" and "operation type is play", the defect rate reaches 70% and is marked as a high-risk scenario;

[0092] For high-risk scenario "wireless network + low-end device + play operation", generate test cases to verify "4K video loading screen, buffer timeout" and other issues;

[0093] Optimize the execution order of test cases using genetic algorithm, including:

[0094] Define population size (representing 20 different execution orders of test cases);

[0095] Define chromosome as the order of test cases (such as representing execution in the order of test cases );

[0096] Define fitness function (comprehensive time and defect rate):

[0097] ;

[0098] Where, the number of defects found for the sequence, the maximum possible number of defects, the execution time, the longest time, representing the defect rate weight;

[0099] The execution optimization process comprises the following steps:

[0100] 1. Initialize the population: randomly generate 20 chromosomes;

[0101] 2. Selection: sort by fitness, keep the top 10 (roulette wheel selection method);

[0102] 3. Crossover: crossover the selected chromosomes two by two;

[0103] 4. Mutation: randomly exchange the positions of two use cases in the chromosome;

[0104] 5. Iteration: repeat steps 2-4 until the fitness converges.

[0105] Step S2: Real-time collection of current data, system logs, network interaction data during the test process through the lightweight agent built-in the set-top box, and synchronous capture of screen rendering pictures to form a multi-modal test data set, specifically: based on the dynamic test cases generated in step S1 (corresponding to the behavior patterns obtained by K-means clustering), when each test case is executed, four types of data are synchronously collected through the lightweight agent built-in the set-top box, and are aligned and integrated according to the timestamp, the four types of data including current data, system log data, network interaction data and screen rendering picture data, and the specific implementation is:

[0106] 1. Current data collection: through the current sensor integrated in the power module of the set-top box, the current fluctuation during movement is collected at a sampling frequency of , to obtain the current sequence , where is the current value of the th sampling point, and is the sampling time;

[0107] 2. System log data collection: real-time capture of the set-top box OS layer log, in this embodiment, the OS layer log includes CPU usage, memory occupation, process state, key indicators are extracted at intervals, and are structured , where is the CPU usage, is the memory occupation rate, and is the number of active processes;

[0108] 3. Network interaction data collection: capture TCP / UDP data packets through the built-in network packet capture module, and parse to obtain network features wherein is the data transmission amount per unit time, is the average delay, is the packet loss rate;

[0109] 4. Screen rendering picture data collection: every stopping the output picture of the set-top box, encoding it into Base64 format image data , and the resolution is adaptive to the current output of the set-top box;

[0110] Pretreatment and alignment of the collected data:

[0111] Normalization of current data: wherein , are the minimum and maximum values of the current during the execution of the test case, ;

[0112] All data are aligned according to the unified timestamp to ensure the correlation of multi-dimensional data at the same time;

[0113] Finally, the data set is integrated:

[0114] Each record is stored in the form of a tuple: wherein is the test case number, is the behavior pattern label obtained by K-means clustering in step S1, forming a multi-modal test data set of associated behavior patterns.

[0115] Step S3: Normalization of the collected current data, construction of erosion and expansion structural elements through gray-scale morphological algorithm, real-time feature extraction of test data, combination of preset threshold and change amplitude value to determine whether there is an anomaly, also including: Fourier transform of current data, extraction of frequency domain features, combination of long short-term memory network to predict current fluctuation trend, and early warning of potential anomalies; using voting method to integrate the results of gray-scale morphological detection and LSTM prediction, the specific implementation includes:

[0116] 1. Smoothing processing of the current sequence collected in step S2 to eliminate noise:

[0117] ;

[0118] wherein, is the size of the sliding window, is the timestamp;

[0119] 2. Construct a 3x3 matrix element B for erosion / dilation operation: ​

[0120] ;

[0121] Data after smoothing Performing an erosion operation involves extracting the local minimum value.

[0122] ;

[0123] Performing dilation is equivalent to extracting local maxima:

[0124] ;

[0125] Calculating morphological gradients to reflect abrupt changes in current characteristics:

[0126] ;

[0127] 3. Based on the behavior pattern in step S1, the preset normal gradient threshold is: ,like and duration If so, it is determined to be an abnormal current.

[0128] Building upon the above process, frequency domain analysis and trend prediction are added to improve the accuracy of anomaly detection. Specifically, this includes:

[0129] 1. The preprocessed current sequence Perform a Fast Fourier Transform:

[0130] ;

[0131] in For frequency, The number of sampling points. Represents frequency Extract the main frequency components from the corresponding amplitude. That is, the frequency with the largest amplitude, if If the fluctuations exceed the normal range, they are marked as potential anomalies;

[0132] 2. Perform LSTM trend prediction:

[0133] Input is before Current value at each moment ;

[0134] The output is: predicted current value. The following results were obtained through training with an LSTM network:

[0135] ;

[0136] If the prediction error ( If the preset error threshold is used, it is marked as a potential anomaly;

[0137] 3. Use voting to make a comprehensive judgment:

[0138] Gray-scale morphological detection results ( (0 indicates abnormal, 0 indicates normal) Frequency domain feature detection results ( 0 indicates abnormality, 0 indicates normality), LSTM prediction results ( (0 indicates abnormal, 0 indicates normal).

[0139] like It was ultimately determined to be an abnormal event. .

[0140] Step S4: If an anomaly is detected, the review process is automatically triggered. The anomaly data and context information (including test cases, execution time, and environment parameters) are pushed to the review module, and the corresponding review strategy (such as re-executing the test, deep log analysis, or manual intervention) is automatically matched according to the anomaly type. The review strategies include:

[0141] For occasional exceptions, test cases are automatically re-executed 3 times. If the exception is reproduced, in-depth log analysis is triggered.

[0142] For high-frequency anomalies, the system automatically associates solutions from the knowledge base, generates repair suggestions, and pushes them to the development team.

[0143] For complex exceptions, a WebSocket connection is used to connect to the test engineer's terminal in real time and push an interactive debugging interface.

[0144] The triggering process for intelligent review includes:

[0145] 1. Abnormal Information Aggregation: Automatically extracts abnormal events. Context data, including the test case number generated in step S1. Multimodal data segments during abnormal periods in step S2 ( Abnormal events Duration );

[0146] 2. Based on the monitoring results of step S3, identify the abnormal events. Divided into three categories:

[0147] Occasional anomalies: The number of occurrences in the past 24 hours is less than or equal to 2;

[0148] High-frequency anomalies: more than 5 occurrences in the past 24 hours;

[0149] Complex anomalies: Conflicts between grayscale morphological detection and LSTM prediction results ( );

[0150] 3. Policy matching and triggering: Call the corresponding review policy from the preset policy library according to the type, push the abnormal information to the review module through the message queue, and start the review process;

[0151] For the above review policy, refine it according to the exception type:

[0152] 1. Occasional exception handling:

[0153] Automatic retry: Re-execute the corresponding test case Record the result each time 、 、 (1 for reproduction, 0 for non-reproduction);

[0154] Reproduction judgment: If the number of reproductions Trigger deep log analysis (extract system call logs at the time of exception, and use regular matching to locate error codes); if Marked as transient interference, terminate review;

[0155] 2. High-frequency exception handling:

[0156] Knowledge base matching: Calculate the cosine similarity between the current exception feature vector (constituted by the average value of Step S2 CPU peak value) and the historical knowledge base vector :

[0157] ;

[0158] Where is the inner product of the vector, is the L2 norm of ;

[0159] Scheme pushing: If the maximum similarity ( is the matching threshold), push the corresponding historical solution to the development team; otherwise, mark it as a new exception and trigger an alarm;

[0160] 3. Complex exception handling:

[0161] Manual intervention: Establish real-time connection with the engineer's terminal through WebSocket, push the interactive interface containing the abnormal period current waveform, log timing diagram, and screenshot comparison;

[0162] Result update: Record the engineer's manual judgment result, store the new feature vector and the solution into the knowledge base, and update the policy library.

[0163] Step S5: Multi-dimensional analysis of test results, including error description analysis in log text through natural language processing technology, verification of screen rendering correctness using image recognition technology, verification of protocol interaction integrity combined with network packet capture data, multi-modal result analysis also includes:

[0164] Semantic segmentation of screenshots using convolutional neural networks (CNN) to verify the correctness and rendering integrity of UI elements;

[0165] Sentiment analysis of test logs through natural language processing technology to quantify user experience risks;

[0166] The implementation of the above process specifically includes:

[0167] 1. Log text analysis: Perform word segmentation on the system logs collected in step S2 Extract keywords (such as "error" "timeout"), and construct a text vector (Dimension: size of the vocabulary, value: word frequency);

[0168] Calculate the cosine similarity of the vector with the preset error template library:

[0169] ;

[0170] If , it is determined that it matches the known error type;

[0171] 2. Screen rendering verification: For of step S2 , extract feature points through SIFT algorithm, calculate the ratio of matching pairs to total feature points :

[0172] ;

[0173] If , it is determined that the rendering is abnormal (such as missing or mispositioned UI elements);

[0174] 3. Network protocol verification:

[0175] Parse of step S2, extract TCP handshake times, HTTP response codes, etc. Compare with protocol specification thresholds (such as HTTP 5xx response ratio greater than 5%);

[0176] Based on the above steps, add deep analysis methods, mainly including:

[0177] 1. CNN image semantic segmentation:

[0178] Input of step S2 , output semantic segmentation map through pre-trained U-Net model, identify pixel area of UI elements (such as buttons, text boxes) ;

[0179] Calculate the intersection over union with the standard area :

[0180] ;

[0181] If there are elements, mark as rendering quality not up to standard;

[0182] 2, NLP log sentiment analysis:

[0183] Sentiment polarity scoring on log text of step S2 (using VADER model), output sentiment value (-1 for negative, 1 for positive);

[0184] Calculate the average sentiment value in the sliding window:

[0185] ;

[0186] Where is the window size, if , quantified as high user experience risk;

[0187] 3, multi-dimensional weight fusion:

[0188] Assign weights to log matching degree , image matching rate , network anomaly rate , , , , calculate the comprehensive score:

[0189] ;

[0190] If , determine that the overall test fails.

[0191] Step S6: Dynamic report generation: generate structured test report according to analysis results, including test coverage, defect distribution heat map, performance index trend curve, and automatically associate historical test data for baseline comparison, while supporting multiple formats such as HTML, PDF, interactive Web, etc.

[0192] Step S7: Closed-loop verification and optimization: feedback the review results to the defect prediction model, update the test case library and anomaly detection rules, realize the dynamic optimization of the test strategy, and synchronize the test results to the development process through the continuous integration interface to trigger code repair and regression testing.

[0193] As shown in Figure 2 the embodiment also provides a system for generating and reviewing the test results of a set-top box, comprising:

[0194] A dynamic test case generation module: based on big data analysis and machine learning algorithms, dynamically generates test cases and optimizes the execution order;

[0195] A multi-modal data acquisition module: integrates current sensors, screen capture units, and network packet capture tools to realize real-time acquisition and synchronous storage of multi-dimensional data;

[0196] An intelligent anomaly detection module: combines gray morphology algorithms and LSTM networks to perform real-time anomaly detection and trend prediction on test data;

[0197] An adaptive review module: automatically matches review strategies according to anomaly types, supporting three modes of automatic retry, deep analysis, and manual intervention;

[0198] A multi-dimensional analysis and reporting module: uses CNN, NLP, and other technologies to perform multi-modal analysis on test results, generates dynamic test reports, and supports multi-format output;

[0199] A continuous optimization module: updates the test case library and anomaly detection rules through a feedback mechanism to realize closed-loop optimization of the test strategy.

[0200] The dynamic test case generation module comprises:

[0201] A behavior pattern extraction unit: based on the K-means clustering algorithm, analyzes historical test data and user behavior logs to extract typical behavior patterns;

[0202] A defect prediction model training unit: uses a random forest algorithm to build a defect prediction model to predict the defect discovery probability of test cases;

[0203] A test case generation optimization unit: uses a genetic algorithm to optimize the execution order and parameter combinations of test cases.

[0204] The multi-modal data acquisition module comprises:

[0205] A current data acquisition submodule: uses high-precision current sensors to acquire current fluctuation data during set-top box operation, with a sampling frequency not less than 1 kHz;

[0206] Screen capture submodule: Real-time capture of set-top box output screen using hardware-accelerated screen recording technology, supporting adaptive resolution;

[0207] Network packet capture submodule: Real-time capture and protocol analysis of network feature packets based on libpcap library.

[0208] Intelligent anomaly detection module includes:

[0209] Feature engineering unit: Time-domain and frequency-domain feature extraction on current data, generating feature vectors;

[0210] Anomaly detection model unit: Construct current fluctuation prediction model using LSTM network, combine threshold judgment and voting mechanism to output anomaly detection results;

[0211] Early warning push unit: Push anomaly warning information to review module and operation and maintenance terminal through message queue.

[0212] Multi-dimensional analysis and reporting module includes:

[0213] Image analysis unit: UI element recognition and rendering quality evaluation on screenshots based on CNN model;

[0214] Log analysis unit: Semantic analysis of test logs using BERT model, extracting error types and impact scope;

[0215] Report generation unit: Dynamically generate HTML reports containing interactive charts and defect traceability links, and support one-key export to PDF or integration into Confluence platform.

[0216] The above is a specific description of the preferred implementation of the present application, but the present application is not limited to the described embodiments, those skilled in the art can make various equivalent modifications or replacements without departing from the spirit of the present application, these equivalent modifications or replacements are all included in the scope defined by the claims of the present application.

Claims

1. A method for generating and reviewing automated test results for set-top boxes, characterized in that, Includes the following steps: Step S1: Based on historical test data and user behavior logs, extract behavior patterns using the K-means clustering algorithm, construct a defect prediction model, and dynamically generate core test cases and boundary test cases; Step S2: Collect current data, system logs, and network interaction data in real time during the test using the lightweight agent built into the set-top box, and simultaneously capture the screen rendering to form a multimodal test dataset; Step S3: Normalize the collected current data, construct corrosion expansion structural elements through grayscale morphology algorithm, extract real-time features from the test data, and determine whether there are any anomalies by combining preset thresholds and change amplitude values. Step S4: If an anomaly is detected, the review process is automatically triggered, the abnormal data and context information are pushed to the review module, and the corresponding review strategy is automatically matched according to the anomaly type. Step S5: Perform multi-dimensional analysis of the test results, including parsing error descriptions in log text using natural language processing technology, verifying the correctness of screen rendering using image recognition technology, and verifying the integrity of protocol interaction by combining network packet capture data. Step S6: Generate a structured test report based on the analysis results, including test coverage, defect distribution heatmap, performance index trend curves, and automatically link historical test data for baseline comparison; Step S7: Feed back the review results to the defect prediction model, update the test case library and anomaly detection rules, and synchronize the test results to the development process through the continuous integration interface to trigger code fixes and regression tests; In step S1, the dynamic generation of core test cases and boundary test cases further includes: By combining set-top box model, software version, and network environment metadata, high-risk test scenarios are selected through decision tree algorithm, and targeted test cases are generated. The execution order of test cases is optimized using a genetic algorithm to minimize testing time and maximize defect detection rate. Specifically, this optimization involves: Define population size This indicates the execution order of 20 different test cases; Define chromosomes as the order of use case numbers, specifically: Define Indicated by use case Execution in sequence; Define a fitness function to represent the relationship between synthesis time and defect rate: ; in, The number of defects found in this order. The maximum possible number of defects. For execution time, For the longest time, Indicates the defect rate weight; The optimization process includes the following steps: Population initialization: Randomly generate 20 chromosomes; Selection: Sort by fitness and use roulette wheel selection to retain the top 10; Crossover: Crosses the selected chromosomes pairwise; Mutation: Randomly swap the positions of two test cases in the chromosome; Iteration: Repeat the selection to mutation steps until the fitness converges; Step S3 also includes: Perform Fourier transform on the current data to extract frequency domain features, and combine it with a long short-time memory network to predict the current fluctuation trend and provide early warning of potential anomalies; A voting method was used to combine the grayscale morphological detection results and the LSTM prediction results. In step S4, the review strategy includes: For occasional exceptions, test cases are automatically re-executed 3 times. If the exception is reproduced, in-depth log analysis is triggered. For high-frequency anomalies, the system automatically associates solutions from the knowledge base, generates repair suggestions, and pushes them to the development team. For complex exceptions, a WebSocket connection is used to connect to the test engineer's terminal in real time and push an interactive debugging interface. Step S5 also includes: Using convolutional neural networks to perform semantic segmentation on screenshots, we can verify the correctness of UI elements and the integrity of rendering. Sentiment analysis of test logs was performed using natural language processing technology to quantify user experience risks.

2. A system for generating and reviewing automated test results for set-top boxes, based on the method for generating and reviewing automated test results for set-top boxes as described in claim 1, characterized in that, include: Dynamic test case generation module: Based on big data analysis and machine learning algorithms, it dynamically generates test cases and optimizes the execution order; Multimodal data acquisition module: integrates current sensor, screen capture unit, and network packet capture tool to realize real-time acquisition and synchronous storage of multi-dimensional data; Intelligent anomaly detection module: integrates grayscale morphology algorithm and LSTM network to perform real-time anomaly detection and trend prediction on test data; Adaptive review module: Automatically matches review strategies based on anomaly type, supporting three modes: automated retry, in-depth analysis, and manual intervention; Multi-dimensional analysis and reporting module: Employs CNN or NLP technology to perform multi-modal analysis of test results, generate dynamic test reports, and support multi-format output; Continuous optimization module: Updates the test case library and anomaly detection rules through a feedback mechanism to achieve closed-loop optimization of the testing strategy.

3. The system for generating and reviewing automated test results for set-top boxes according to claim 2, characterized in that, The dynamic test case generation module includes: Behavioral pattern extraction unit: Based on the K-means clustering algorithm, analyze historical test data and user behavior logs to extract typical behavioral patterns; Defect prediction model training unit: The defect prediction model is constructed using the random forest algorithm to predict the probability of defect discovery in test cases; Test case generation optimization unit: Utilizes a genetic algorithm to optimize the execution order and parameter combinations of test cases.

4. The system for generating and reviewing automated test results for set-top boxes according to claim 2, characterized in that, The multimodal data acquisition module includes: Current data acquisition submodule: Acquires current fluctuation data during set-top box operation through a high-precision current sensor, with a sampling frequency of not less than 1kHz; Screen capture submodule: Employs hardware-accelerated screen recording technology to capture the set-top box output screen in real time, supporting resolution adaptation; Network packet capture module: Based on the libpcap library, it implements real-time capture and protocol parsing of network signature packets.

5. The system for generating and reviewing automated test results for set-top boxes according to claim 2, characterized in that, The intelligent anomaly detection module includes: Feature engineering unit: Extracts time-domain and frequency-domain features from current data and generates feature vectors; Anomaly detection model unit: An LSTM network is used to construct a current fluctuation prediction model, and the anomaly detection results are output by combining threshold judgment and voting mechanism; Early warning push unit: Pushes abnormal early warning information to the review module and operation and maintenance terminal through message queue.

6. The system for generating and reviewing automated test results for set-top boxes according to claim 2, characterized in that, The multi-dimensional analysis and reporting module includes: Image Analysis Unit: Based on a CNN model, this unit performs UI element recognition and rendering quality assessment on screenshots. Log analysis unit: Uses the BERT model to perform semantic parsing on test logs to extract error types and their impact scope; Report generation unit: Dynamically generates HTML reports containing interactive charts and defect tracing links, and supports one-click export to PDF or integration into the Confluence platform.

Citation Information

Patent Citations

  • Set top box front end automatic test method and system integrated with artificial intelligence

    CN115037924A

  • Method and device for testing AI SOC modular unit of set top box

    CN119342257A