Method and system for generating and rechecking automatic test result of set top box
By using K-means clustering and machine learning techniques, targeted test cases are generated. Combined with multimodal data collection and anomaly detection, the problems of misjudgment and insufficient scenario coverage in set-top box automated testing are solved, improving testing efficiency and accuracy.
Patent Information
- Application Number
- CN202511097608.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-06
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2045-08-06
AI Technical Summary
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.
User behavior patterns are extracted using the K-means clustering algorithm to build a defect prediction model, generate core and boundary test cases, and combine multimodal data collection and anomaly detection to achieve real-time feature extraction and review processes. Machine learning and deep learning technologies are used for multi-dimensional analysis and report generation.
It improves the relevance and coverage of test cases, enhances the accuracy and foresight of defect detection, optimizes testing efficiency, reduces false positives, and achieves dynamic adaptability and iterative capability of test results.
Smart Images

Figure CN120916009A_ABST
Abstract
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, it cannot test multiple devices at the same time. The main reasons for this problem are as follows. First, 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. Second, the configuration and performance of most IPTV set top boxes are general, and cannot support large automatic test. Third, due to the low configuration of most television set top boxes, the system version is also low, and most of them are based on the Android 4.4 system, and the framework is difficult to be compatible due to the customized development of various manufacturers. In this way, the mainstream methods such as control Id or Xpath cannot be used to operate and judge the page content, even if the script can be executed by the ADB debugging bridge and the like, there is no good solution to judge the result of the script execution, and the manual observation of the HDMI output is needed to judge whether the picture is normal, and the execution needs to be re-executed after the 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 it is impossible to trace back whether the running is correct or not and which step in the running has a problem, which leads to the fact that the script execution and the result judgment cannot be well combined. In addition, the device may also have a misjudgment condition. 1. The error result is misjudged as passing, and when the judgment condition is not strict enough and the minimum similarity threshold is low, the error result may be passed. 2. Due to the fact that the condition is too strict, two pictures with the same content may be judged as not passing due to different execution devices, network loading and page display picture changes.
[0004] Therefore, a method and system for generating and reviewing automatic test results of a set top box are needed to solve the above problems. SUMMARY
[0005] 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.
[0006] In order to achieve the above-mentioned purpose, the following technical solutions are used. In one aspect, a method for generating and reviewing test results of a set-top box is provided, comprising the following steps: Step S1: Based on historical test data and user behavior logs, behavior patterns are extracted through a K-means clustering algorithm, and a defect prediction model is constructed to dynamically generate core test cases and boundary test cases; 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; Step S3: The collected current data is normalized, and a corrosion and expansion structural element is constructed through a gray-scale morphological algorithm to extract real-time features of the test data, and a preset threshold and change amplitude value are combined to determine whether there is an anomaly; Step S4: If an anomaly is detected, an automatic review process is triggered, and 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: The test results are analyzed in multiple dimensions, including analyzing error descriptions in log text through natural language processing technology, verifying the correctness of screen rendering using image recognition technology, and verifying the integrity of protocol interaction using network packet capture data; Step S6: A structured test report is generated based on the analysis results, including test coverage, defect distribution heat map, performance index trend curve, and automatic association of historical test data for baseline comparison; 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.
[0007] Preferably, in step S1, the dynamically generated core test cases and boundary test cases further comprise: Combined with the set-top box model, software version, network environment metadata, high-risk test scenarios are filtered out through a decision tree algorithm to generate targeted test cases; The execution order of the test cases is optimized using a genetic algorithm to minimize test time and maximize defect discovery rate.
[0008] Preferably, step S3 further comprises: Performing Fourier transform on the current data to extract frequency domain features, combining long short-term memory network to predict current fluctuation trend, and warning potential anomalies in advance; The voting method is used to integrate the gray-scale morphological detection results and the LSTM prediction results.
[0009] Preferably, in step S4, the review strategy comprises: For incidental anomalies, automatically re-execute test case 3 times, if the anomaly recurs, trigger deep log analysis; For high-frequency anomalies, automatically associate solutions in the knowledge base, generate repair suggestions and push to the development team; For complex anomalies, connect the test engineer's terminal in real time through WebSocket, and push an interactive debugging interface.
[0010] Preferably, step S5 further comprises: Using a convolutional neural network to perform semantic segmentation on screenshots to verify the correctness and rendering integrity of UI elements; Performing sentiment analysis on test logs through natural language processing techniques and quantifying user experience risks.
[0011] On the other hand, a system for generating and reviewing automated test results for a set-top box is provided, based on a method for generating and reviewing automated test results for a set-top box as described above, comprising: Dynamic test case generation module: based on big data analysis and machine learning algorithms, dynamically generate test cases and optimize execution order; 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; Intelligent anomaly detection module: combines grayscale morphological algorithms and LSTM networks to perform real-time anomaly detection and trend prediction on test data; Adaptive review module: automatically matches review strategies according to anomaly types, supporting three modes of automated retry, deep analysis, and human intervention; 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; Continuous optimization module: updates test case libraries and anomaly detection rules through a feedback mechanism to realize closed-loop optimization of test strategies.
[0012] Preferably, the dynamic test case generation module comprises: Behavior pattern extraction unit: based on K-means clustering algorithm, analyzes historical test data and user behavior logs to extract typical behavior patterns; Defect prediction model training unit: uses random forest algorithm to build a defect prediction model to predict the defect discovery probability of test cases; Test case generation optimization unit: uses genetic algorithm to optimize the execution order and parameter combination of test cases.
[0013] Preferably, the multi-modal data acquisition module comprises: Current data acquisition submodule: Collect current fluctuation data of the set-top box in operation through high-precision current sensors, with a sampling frequency not less than 1 kHz; Screen capture submodule: Real-time capture of the set-top box output picture by using hardware-accelerated screen recording technology, supporting resolution adaptation; Network packet capture submodule: Real-time capture and protocol analysis of network feature packets based on the libpcap library.
[0014] Preferably, the intelligent anomaly detection module comprises: Feature engineering unit: Time-domain and frequency-domain feature extraction of current data, and generation of feature vectors; Anomaly detection model unit: Construction of a current fluctuation prediction model using an LSTM network, combined with threshold judgment and a voting mechanism to output anomaly detection results; Early warning push unit: Pushing of anomaly early warning information to the review module and the operation and maintenance terminal through a message queue.
[0015] Preferably, the multi-dimensional analysis and reporting module comprises: Image analysis unit: UI element recognition and rendering quality assessment of screenshots based on a CNN model; Log analysis unit: Semantic analysis of test logs using a BERT model to extract error types and impact ranges; Report generation unit: Dynamic generation of HTML reports containing interactive charts and defect traceability links, and support for one-click export to PDF or integration into the Confluence platform.
[0016] Compared with the prior art, the present application has the following advantages: 1. Improved test case targeting and coverage: The K-means clustering algorithm extracts user behavior patterns and typical features from historical test data, accurately identifies high-frequency scenarios and high-risk operation sequences in set-top box testing, and generates core test cases in combination with a defect prediction model to ensure coverage of key scenarios where defects are most likely to occur. 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 test blind area.
[0017] 2. Improved accuracy and forward-looking of defect detection: The defect prediction model is based on a logistic regression algorithm and is trained using historical defect data to quantitatively evaluate the probability of defects occurring in different test scenarios, allowing for early identification of high-risk test points and avoiding the problem of "blindly executing test cases and missing critical defects" in traditional testing. The Euclidean distance calculation and cluster center iteration optimization make the behavior pattern classification more accurate, providing reliable feature input for defect prediction and further improving detection accuracy.
[0018] 3. Optimize test efficiency and resource allocation: By K-means clustering, the test scenarios can be classified, which can reduce repeated test cases and reduce redundant execution cost. At the same time, the defect prediction model can prioritize the test of high-risk scenarios, which can prioritize the verification of key functions under limited resources, solve the problem of "test process solidification and low efficiency", and improve the overall test efficiency.
[0019] 4. Enhance the dynamic adaptability and iteration ability of the test: 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 "difficult to adjust once generated", and making the test scheme have continuous optimization ability.
[0020] 5. Provide accurate basis for review and reduce misjudgment: The generation process of core test cases and boundary test cases is deeply related to the defect prediction model, and the test results can be directly traced back to specific behavior patterns and risk probabilities, providing clear judgment basis for subsequent review, reducing the subjectivity of manual review, and the coverage of boundary cases for extreme scenarios also reduces the misjudgment caused by incomplete test scenarios. BRIEF DESCRIPTION OF DRAWINGS
[0021] Figure 1 is a method flowchart of the present application; Figure 2 is a data preprocessing flowchart of the present application. DETAILED DESCRIPTION
[0022] 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 after reading the content taught by the present application, those skilled in the art can make various modifications or modifications to the present application, and these equivalent forms also fall within the scope defined by the present application.
[0023] 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 structure relationship of the components or elements of the present application, and cannot be understood as a limitation of the present application.
[0024] Embodiment: As Figure 1As shown, the embodiment provides a method for generating and reviewing the test results of a set-top box automatically, comprising: 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, wherein the dynamic generation of core test cases and boundary test cases further comprises: combining set-top box models, software versions, and network environment metadata, high-risk test scenarios are screened out by a decision tree algorithm to generate targeted test cases; the execution order of the test cases is optimized by a genetic algorithm to minimize test time and maximize defect discovery rate, and the specific implementation of the K-means clustering algorithm for extracting behavior patterns in the above process comprises: In this embodiment, 1000 user behavior logs are collected, and 3 features are extracted from each log, denoted as: 、 、 wherein, represents the number of remote control operations (such as channel switching and volume adjustment) within a single session, represents the average page dwell time (in seconds), represents the number of network request failures (reflecting the impact of network fluctuations), and the above features are mapped to interval to eliminate the dimension effect: ; wherein, is the standardized value, 、 are the minimum and maximum values of the feature respectively; The number of clusters is set to 3 in this embodiment, including "regular browsing", "high-frequency operation", and "abnormal network", 3 initial cluster centers 、 、 are randomly selected, and the Euclidean distance of each sample to the cluster center is calculated: ; The sample is assigned to the nearest cluster, and the cluster center is recalculated (taking the mean of the samples in the cluster): ; wherein, is the number of samples in cluster ; The process of calculating the Euclidean distance of each sample to the cluster center and recalculating the cluster center is repeated until the cluster center changes by less than the threshold value 0.01, and finally 3 types of behavior patterns are obtained; The specific implementation of building a defect prediction model and generating test cases includes: Using pattern features obtained through K-means clustering and historical defect data as feature inputs, the model's formula is expressed as follows: ; in, For a given feature The probability of time defects occurring, This indicates that a defect has occurred in this mode. The intercept is... These are the feature weights (obtained through training with historical data). Core test cases: Generate test cases to verify basic functions (such as page rendering and response speed) for typical behaviors corresponding to cluster centers (such as "normal browsing mode": few operations, long dwell time, and stable network). Boundary test cases: For cluster edges or outliers (such as "high-frequency operation + network fluctuation": more than 20 operations / minute, more than 3 network failures), generate test cases to verify extreme scenarios (such as lag and crashes when switching channels continuously). The specific implementation of using the decision tree algorithm to filter out high-risk test scenarios includes: The selected features include "Network type (wired / wireless)", "Operation type (navigation / playback)" and "Device model (high-end / mid-range / low-end)". Calculate the initial information entropy (defect label: 1 for defective, 0 for defect-free): ; in, The percentage of defective samples. ; If the "network type is wireless", it is further divided according to the "device model". When the "device model is low-end" and the "operation type is playback", the defect rate reaches 70% and is marked as a high-risk scenario. For high-risk scenarios such as "wireless network + low-end device + playback operation", test cases are generated to verify issues such as "screen tearing and buffering timeout when loading 4K video". The specific implementation of optimizing the execution order of test cases using genetic algorithms includes: Define population size (This represents the execution order of 20 different test cases); Define chromosomes as the order of use case numbers (e.g.) Indicated by use case (Execution in sequence) Define the fitness function (comprehensive time and defect rate): ; in, the number of defects found for the sequence, the maximum possible number of defects, the execution time, the longest time, denotes the defect rate weight; The execution optimization process comprises the following steps: 1. Initialize the population: randomly generate 20 chromosomes; 2. Selection: sort by fitness, keep the top 10 (roulette wheel selection method); 3. Crossover: crossover the selected chromosomes two by two; 4. Mutation: randomly exchange the positions of two use cases in the chromosome; 5. Iteration: repeat steps 2-4 until the fitness converges.
[0025] 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 time stamp, the four types of data including current data, system log data, network interaction data and screen rendering picture data, and the specific implementation is: 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; 2. System log data collection: real-time capture of set-top box OS layer logs, in this embodiment, the OS layer logs include 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; 3. Network interaction data collection: capture TCP / UDP data packets through the built-in network packet capture module, and parse to obtain network features , where is the data transmission volume per unit time, is the average delay, and is the packet loss rate; 4. Screen rendering picture data collection: every Intercepting the output screen of the set-top box and encoding it into Base64 format image data , the resolution of the current output of the adaptive set-top box; Preprocessing and aligning the collected data: Normalizing the current data: , where , are the minimum and maximum values of the current during the execution of the test case, ; All data is aligned by a unified timestamp , ensuring the association of multi-dimensional data at the same time; Finally, the data set is integrated: Each record is stored in the form of a tuple: , where 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 associated with the behavior pattern.
[0026] Step S3: Normalizing the collected current data, constructing an erosion and dilation structure element through gray-scale morphological algorithm, performing real-time feature extraction on the test data, and combining with the preset threshold and change amplitude value to determine whether there is an anomaly, also including: performing Fourier transform on the current data to extract frequency domain features, combining with the long short-term memory network to predict the current fluctuation trend, and giving early warning of potential anomalies; using the voting method to integrate the gray-scale morphological detection results and the LSTM prediction results, the specific implementation includes: 1. Smoothing the current sequence collected in step S2 to eliminate noise: ; where, is the size of the sliding window, is the timestamp; 2. Construct a 3x3 matrix element B for erosion / dilation operation: ; Perform erosion operation on the data after smoothing, that is, extract the local minimum value: ; Perform dilation operation, that is, extract the local maximum value: ; Calculate the morphological gradient to reflect the mutation characteristics of the current: ; 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. Building upon the above process, frequency domain analysis and trend prediction are added to improve the accuracy of anomaly detection. Specifically, this includes: 1. The preprocessed current sequence Perform a Fast Fourier Transform: ; 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; 2. Perform LSTM trend prediction: Input is before Current value at each moment ; The output is: predicted current value. The following results were obtained through training with an LSTM network: ; If the prediction error ( If the preset error threshold is used, it is marked as a potential anomaly; 3. Use voting to make a comprehensive judgment: 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). like It was ultimately determined to be an abnormal event. .
[0027] 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: 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. The triggering process for intelligent review includes: 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 ); 2. Based on the monitoring results of step S3, identify the abnormal events. Divided into three categories: Occasional anomalies: The number of occurrences in the past 24 hours is less than or equal to 2; High-frequency anomalies: more than 5 occurrences in the past 24 hours; Complex anomalies: Conflicts between grayscale morphological detection and LSTM prediction results ( ); 3. Strategy matching and triggering: Based on the type, the corresponding review strategy is called from the preset strategy library, and the exception information is pushed to the review module through the message queue to start the review process; The above review strategies are further refined according to the type of anomaly: 1. Handling occasional anomalies: Automatic retry: Re-execute the corresponding test case. Record the result each time. , , (1 indicates reproduction, 0 indicates non-reproduction); Reproducibility criterion: If the number of reproducibility times is... This triggers deep log analysis (extracting system call logs from the abnormal period and using regular expressions to locate error codes); if Marked as transient interference, the review is terminated; 2. High-frequency anomaly handling: Knowledge base matching: Calculate the current anomaly feature vector (from step S2) mean (CPU peak performance composition) and historical knowledge base vector Cosine similarity: ; in For vector dot product, for The L2 norm; Solution recommendation: If the maximum similarity ( If the similarity score is greater than a pre-defined threshold (e.g., 0.8), push the corresponding historical solution to the development team; otherwise, mark it as a new exception and trigger an alert. 3. Complex exception handling: Manual intervention: Establish a real-time connection with the engineer's terminal through WebSocket, push an interactive interface containing the current waveform, log time series, and screenshot comparison. Result update: Record the engineer's manual judgment result, store the new feature vector and solution in the knowledge base, and update the strategy library.
[0028] 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 through image recognition technology, and verification of protocol interaction integrity through network packet capture data. Multi-modal result analysis also includes: Semantic segmentation of screenshots using Convolutional Neural Networks (CNN) to verify the correctness and rendering integrity of UI elements. Sentiment analysis of test logs through natural language processing technology to quantify user experience risks. The implementation of the above process specifically includes: 1. Log text analysis: Perform word segmentation on the system logs collected in step S2, extract keywords (e.g., "error" "timeout"), and construct a text vector (the dimension is the size of the vocabulary, and the value is the word frequency). Calculate the cosine similarity between the vector and the pre-set error template library vector : ; If , determine that it matches the known error type. 2. Screen rendering verification: Compare the of step S2 with the standard UI template image , extract feature points through SIFT algorithm, and calculate the ratio of matching pairs to total feature points: ; If , determine that there is a rendering exception (e.g., missing or misplaced UI elements). 3. Network protocol verification: Parse the of step S2, extract features such as TCP handshake times and HTTP response codes, and compare them with protocol specification thresholds (e.g., HTTP 5xx response ratio greater than 5%). Based on the above steps, increase the depth analysis means, mainly including: 1. CNN image semantic segmentation: Input the image of step S2 , output the semantic segmentation map through the pre-trained U-Net model, identify the pixel area of UI elements (such as buttons, text boxes) ; Calculate the intersection over union with the standard area : ; If there is element, mark as rendering quality does not meet the standard; 2. NLP log sentiment analysis: Sentiment polarity scoring (using VADER model) is performed on the log text of step S2, and the sentiment value (-1 for negative, 1 for positive) is output; Calculate the average sentiment value in the sliding window: ; Where is the window size, if , quantified as high user experience risk; 3. Multi-dimensional weight fusion: Assign weights to log matching degree , image matching rate , network anomaly rate , , , , calculate the comprehensive score: ; If , determine that the overall test fails.
[0029] Step S6: Dynamic report generation: generate a structured test report according to the analysis results, including test coverage, defect distribution heat map, performance indicator trend curve, and automatically associate historical test data for baseline comparison, while supporting multiple formats such as HTML, PDF, interactive Web, etc.
[0030] 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 dynamic optimization of the test strategy, and synchronize the test results to the development process through the continuous integration interface, trigger code repair and regression test.
[0031] As shown in Figure 2 , the embodiment also provides a system for generating and reviewing the test results of a set-top box, comprising: Dynamic test case generation module: based on big data analysis and machine learning algorithms, dynamically generate test cases and optimize execution order; Multi-modal data acquisition module: integrated current sensor, screen capture unit, network packet capture tool, realize real-time acquisition and synchronous storage of multi-dimensional data; Intelligent anomaly detection module: fusion of gray morphology algorithm and LSTM network, real-time anomaly detection and trend prediction on test data; Adaptive review module: automatically match review strategy according to exception type, support three modes of automatic retry, deep analysis and manual intervention; Multi-dimensional analysis and reporting module: use CNN, NLP and other technologies to analyze test results in multiple modes, generate dynamic test report and support multiple format output; Continuous optimization module: update test case library and anomaly detection rules through feedback mechanism, realize closed-loop optimization of test strategy.
[0032] Dynamic test case generation module includes: Behavior pattern extraction unit: based on K-means clustering algorithm to analyze historical test data and user behavior logs, extract typical behavior patterns; Defect prediction model training unit: use random forest algorithm to build defect prediction model, predict defect discovery probability of test cases; Test case generation optimization unit: use genetic algorithm to optimize the execution order and parameter combination of test cases.
[0033] Multi-modal data acquisition module includes: Current data acquisition submodule: through high-precision current sensor to collect the current fluctuation data of set-top box running, sampling frequency not less than 1kHz; Screen capture submodule: use hardware accelerated screen recording technology, real-time capture set-top box output picture, support resolution adaptive; Network packet capture submodule: based on libpcap library to realize real-time capture and protocol analysis of network feature packet.
[0034] Intelligent anomaly detection module includes: Feature engineering unit: time domain and frequency domain feature extraction on current data, and generate feature vector; Anomaly detection model unit: use LSTM network to build current fluctuation prediction model, combine threshold judgment and voting mechanism to output anomaly detection result; Early warning push unit: push anomaly warning information to review module and operation terminal through message queue.
[0035] Multi-dimensional analysis and reporting module includes: Image analysis unit: UI element recognition and rendering quality assessment on screenshots based on CNN model; Log analysis unit: semantic parsing of test logs using BERT model, extracting error types and impact scope; Report generation unit: dynamically generating HTML reports containing interactive charts, defect traceability links, and supporting one-click export to PDF or integration into Confluence platform.
[0036] 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 within the scope defined by the claims of the present application.
Claims
1. A method for set-top box automated test result generation and review, the method comprising: The method comprises the following steps: 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; 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; Step S3: The collected current data is normalized, a corrosion and expansion structural element is constructed by gray-scale morphological algorithm, real-time feature extraction is performed on the test data, and whether there is an anomaly is judged in combination with a preset threshold and a change amplitude value; Step S4: If an anomaly is detected, a review process is automatically triggered, the anomaly 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: 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; 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 baseline comparison is automatically performed on historical test data; 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.
2. The method for generating and reviewing test results of a set-top box automatically according to claim 1, wherein, In step S1, the dynamic generation of core test cases and boundary test cases further comprises: Combined with the model number, software version, and network environment metadata of the set-top box, high-risk test scenarios are filtered out by decision tree algorithm to generate targeted test cases; The execution order of the test cases is optimized by genetic algorithm to minimize test time and maximize defect discovery rate.
3. The method for generating and reviewing test results of a set-top box automatically according to claim 1, wherein, Step S3 further comprises: Performing Fourier transform on the current data to extract frequency domain features, predicting current fluctuation trends by long short-term memory network, and warning potential anomalies in advance; The voting method is used to integrate the detection results of gray-scale morphological algorithm and the prediction results of LSTM.
4. The method for generating and reviewing test results of a set-top box automatically according to claim 1, wherein, In step S4, the review strategy comprises: For sporadic anomalies, automatically re-execute test cases 3 times, and trigger deep log analysis if the anomaly recurs; For high-frequency anomalies, automatically associate solutions in the knowledge base to generate repair suggestions and push them to the development team; For complex anomalies, an interactive debugging interface is pushed to the test engineer's terminal through WebSocket real-time connection.
5. The method for generating and reviewing test results of a set-top box automatically according to claim 1, wherein, Step S5 further comprises: Semantic segmentation of screenshots is performed by convolutional neural network to verify the correctness and rendering integrity of UI elements; Emotion analysis of test logs is performed by natural language processing technology, and user experience risks are quantified.
6. A system for generating and reviewing results of automated testing of set-top boxes, based on a method for generating and reviewing results of automated testing of set-top boxes according to any one of claims 1-5, characterized in that, Comprise: Dynamic test case generation module: based on big data analysis and machine learning algorithm, dynamically generate test cases and optimize execution order; Multi-modal data acquisition module: integrate current sensor, screen capture unit, network packet capture tool to realize real-time acquisition and synchronous storage of multi-dimensional data; Intelligent anomaly detection module: combines gray-scale morphology algorithm and LSTM network for real-time anomaly detection and trend prediction on test data; Adaptive review module: automatically matches review strategies based on anomaly types, supporting three modes of automatic retry, deep analysis, and manual intervention; Multi-dimensional analysis and reporting module: uses CNN, NLP, and other technologies for multi-modal analysis of test results, generates dynamic test reports, and supports multi-format output; Continuous optimization module: updates test case library and anomaly detection rules through feedback mechanism to realize closed-loop optimization of test strategy.
7. The system for automated test result generation and review of set-top boxes according to claim 6, wherein, Dynamic test case generation module includes: Behavior pattern extraction unit: analyzes historical test data and user behavior logs based on K-means clustering algorithm to extract typical behavior patterns; Defect prediction model training unit: uses random forest algorithm to build defect prediction model to predict defect discovery probability of test cases; Test case generation optimization unit: uses genetic algorithm to optimize execution order and parameter combination of test cases.
8. The system for automated test result generation and review of set-top boxes according to claim 6, wherein, The multi-modal data acquisition module includes: Current data acquisition submodule: collects current fluctuation data of set-top box operation through high-precision current sensor with sampling frequency not less than 1kHz; Screen capture submodule: uses hardware-accelerated screen recording technology to capture set-top box output picture in real time, supporting resolution adaptation; Network packet capture submodule: realizes real-time capture and protocol analysis of network feature packets based on libpcap library.
9. The system for automated test result generation and review of set-top boxes according to claim 6, wherein, 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: uses LSTM network to build current fluctuation prediction model, combines threshold judgment and voting mechanism to output anomaly detection results; Early warning push unit: pushes anomaly warning information to review module and operation terminal through message queue.
10. The system for automated test result generation and review of set-top boxes according to claim 6, wherein, The multi-dimensional analysis and reporting module includes: Image analysis unit: uses CNN model to identify UI elements and evaluate rendering quality of screenshots; Log analysis unit: uses BERT model to perform semantic analysis on test logs, extracts error types and impact scope; Report generation unit: dynamically generates HTML report containing interactive charts and defect traceability links, and supports one-click export to PDF or integration into 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
Method and system for generating and auditing automatic test result of set top box
CN119520772A
Set top box automatic testing method and system based on big data
CN119854576A
State evaluation method and device of set top box, medium and equipment
CN119893178A