Software defect positioning method and system based on mobile terminal technology development

By adopting deep learning models and improved decision tree algorithm methods in mobile technology, combined with the analysis of fault propagation graphs, the problems of inefficiency, limited coverage and difficult positioning in traditional testing methods are solved, and efficient and accurate defect positioning and repair are achieved.

CN119690843AInactive Publication Date: 2025-03-25JIANGSU GREENWAY NETWORK TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411876192.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-03-25
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional compatibility testing methods are inefficient, have limited coverage, and are difficult to locate defects, resulting in high testing costs and long repair cycles.

Method used

Using a software defect positioning method based on mobile technology, we collect system logs, interface layout and resource occupation information, build test benchmark data, and use pre-trained deep learning models to compare and analyze them with real-time test data to identify abnormal features. Combined with the improved decision tree algorithm, classify defect feature vectors, build fault propagation graphs, and locate the code snippet locations that lead to compatibility defects.

Benefits of technology

Improves defect positioning efficiency, accurately identify compatibility defects, and accurately locate defect code locations, reducing repair costs and cycles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119690843A_ABST
    Figure CN119690843A_ABST
Patent Text Reader

Abstract

The invention provides a software defect positioning method and system based on mobile terminal technology development, and relates to the technical field of software, and the method comprises the following steps: collecting system log information, interface layout information and resource occupation information in a process that a mobile terminal executes a preset test case, and constructing test benchmark data; and after the application version is updated, acquiring real-time test data by adopting the same test case. And comparing and analyzing the real-time test data and the reference data by using a long-short-term memory network model based on a dynamic memory updating mechanism, and identifying abnormal features. And classifying the abnormal features by adopting an improved decision tree algorithm, generating defect feature vectors, and constructing a fault propagation graph. And positioning the position of a code snippet causing compatibility defects by backtracking and analyzing the fault propagation graph. And comparing the positioned code snippets with a code version library, and outputting a defect positioning report. According to the method, the compatibility defect after the application version of the mobile terminal is updated can be effectively positioned, and the defect positioning efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to software technology, and in particular to a software defect locating method and system developed based on mobile terminal technology. Background Art

[0002] The rapid development of mobile Internet has spawned a large number of mobile applications, which need to run on a variety of mobile terminals, including different operating system versions, screen sizes, hardware configurations, etc. In order to ensure the quality of applications and user experience, developers need to conduct comprehensive compatibility testing on applications. Traditional compatibility testing methods mainly rely on manual testing, which requires testers to run applications on a large number of devices and manually check whether there are compatibility issues. This method is inefficient, costly, and difficult to cover all possible devices and scenarios.

[0003] The existing technology mainly has the following defects and shortcomings: 1. Low testing efficiency: Traditional compatibility testing methods require testers to manually execute test cases and repeat operations on different devices, which is time-consuming and labor-intensive, and has low testing efficiency.

[0004] 2. Limited test coverage: Due to the wide variety of mobile devices, it is difficult for testers to cover all possible devices and scenarios, resulting in limited test coverage and the possibility of missing some potential compatibility issues.

[0005] 3. Difficulty in defect location: When compatibility issues are discovered, traditional testing methods make it difficult to quickly and accurately locate the problematic code fragment, requiring developers to spend a lot of time troubleshooting, increasing the cost and cycle of defect repair. Summary of the invention

[0006] The embodiments of the present invention provide a software defect location method and system developed based on mobile terminal technology, which can solve the problems in the prior art.

[0007] According to a first aspect of the embodiments of the present invention, Provides software defect location methods based on mobile terminal technology development, including: According to a preset test case, the system log information, interface layout information and resource occupancy information of the mobile terminal during the execution of the test case are collected, wherein the system log information includes application program interface call information and operating system event information, the interface layout information includes interface control identification information and interface control attribute information, and the resource occupancy information includes central processing unit usage rate information, memory occupancy information and network traffic information; the system log information, the interface layout information and the resource occupancy information are constructed as test benchmark data; After the application version of the mobile terminal is updated, the test case is used to perform a test on the updated application to obtain real-time test data during the test, wherein the real-time test data includes real-time system log information, real-time interface layout information, and real-time resource occupancy information; based on a pre-trained deep learning model, the real-time test data is compared and analyzed with the test benchmark data, wherein the deep learning model uses a long short-term memory network architecture based on a dynamic memory update mechanism to identify abnormal features of the real-time test data relative to the test benchmark data; According to the identified abnormal features, an improved decision tree algorithm is used to classify the abnormal features and generate a defect feature vector, wherein the improved decision tree algorithm combines information gain and regularization terms to form an optimized splitting criterion to split the decision tree; a fault propagation graph is constructed based on the defect feature vector, and the position of the code fragment that causes the compatibility defect is located by backtracing the node association relationship in the fault propagation graph; the located code fragment position is compared with a pre-established code version library to determine the code submission record that introduces the compatibility defect, and output a defect location report.

[0008] Based on a pre-trained deep learning model, the real-time test data is compared and analyzed with the test benchmark data. The deep learning model adopts a long short-term memory network architecture based on a dynamic memory update mechanism to identify abnormal features of the real-time test data relative to the test benchmark data, including: Determine the standardized feature vector corresponding to the real-time test data, construct an external memory matrix, the external memory matrix includes a preset number of memory slots, and the dimension of each memory slot is the same as the dimension of the standardized feature vector; calculate the correlation between the standardized feature vector and the external memory matrix, and extract the historical memory information related to the current moment; A memory-aware gating unit is constructed based on the historical memory information, including a memory-aware forgetting gate, an enhanced input gate, and a memory fusion output gate; the memory-aware forgetting gate calculates a forgetting weight based on a hidden state at a previous moment, a current input, and the historical memory information; the enhanced input gate calculates an input weight based on a hidden state at a previous moment, a current input, and the historical memory information; the memory fusion output gate calculates an output weight based on a hidden state at a previous moment, a current input, and the historical memory information; Constructing a memory update gate, calculating an update weight based on the current hidden state and the historical memory information, and dynamically updating the external memory matrix according to the update weight; evaluating the importance of the updated memory, and removing the least important memory information when the number of memory slots exceeds a preset threshold; Calculate the state difference between the current hidden state vector and the reference hidden state vector, and the memory difference between the current external memory matrix and the reference external memory matrix; combine the state difference and the memory difference based on a preset weight factor to obtain a comprehensive difference score; The mean and variance are dynamically updated according to the historical comprehensive difference scores, and an adaptive threshold is calculated based on the mean, the variance and a preset sensitivity coefficient; the comprehensive difference score is compared with the adaptive threshold, and when the comprehensive difference score is greater than the adaptive threshold, it is determined that the real-time test data at the current moment has abnormal features.

[0009] Calculating the state difference between the current hidden state vector and the reference hidden state vector, and the memory difference between the current external memory matrix and the reference external memory matrix; combining the state difference and the memory difference based on a preset weight factor to obtain a comprehensive difference score includes: Performing L2 norm normalization processing on the current hidden state vector and the reference hidden state vector respectively to obtain a normalized current hidden state vector and a normalized reference hidden state vector; calculating the Euclidean distance, cosine similarity and Mahalanobis distance based on the normalized current hidden state vector and the normalized reference hidden state vector, and performing weighted combination of the Euclidean distance, the cosine similarity and the Mahalanobis distance according to a preset distance weight coefficient to obtain a state difference measurement value; Calculate the similarity between each memory slot in the current external memory matrix and all memory slots in the reference external memory matrix, and align the memory slots of the current external memory matrix and the reference external memory matrix based on the similarity; calculate the aligned memory slot distance and memory matrix distribution difference, and perform weighted combination of the memory slot distance and the memory matrix distribution difference based on a preset memory weight factor to obtain a memory difference measurement value; A state weight is calculated based on the state difference metric value and its standard deviation, a memory weight is calculated based on the memory difference metric value and its standard deviation, and a product of the state weight and the state difference metric value and a product of the memory weight and the memory difference metric value are added to obtain a comprehensive difference score.

[0010] According to the identified abnormal features, the improved decision tree algorithm is used to classify the abnormal features and generate defect feature vectors including: Inputting the abnormal feature into a decision tree model, combining the information gain with the regularization term to form an optimized splitting criterion when splitting a node, and selecting an optimal splitting feature based on the optimized splitting criterion; Calculating a maximum depth threshold based on the number of training samples and the mean of the abnormal features, and limiting the depth of the tree within the maximum depth threshold during the growth of the decision tree to obtain an initial decision tree; Calculating the classification error rate and the number of leaf nodes of the initial decision tree, taking the weighted sum of the classification error rate and the number of leaf nodes as the cost complexity, and pruning the initial decision tree by minimizing the cost complexity to obtain an optimized decision tree; Extracting a classification rule set from the optimized decision tree, and calculating a weighted product of accuracy, support and confidence for each rule in the classification rule set as a rule weight; Input the sample to be classified into the optimized decision tree, vote based on the rule weight to obtain the defect category of the sample, calculate the voting weight ratio as the classification confidence, and determine the defect category according to the classification confidence; The average Euclidean distance between the normalized feature vectors corresponding to the samples in the same defect category is calculated to obtain the intra-class aggregation degree, and the minimum Euclidean distance between the normalized feature vectors of different defect categories is calculated to obtain the inter-class separation degree; The ratio of the mean and standard deviation of the normalized feature vector is used as a feature stability measure, the ratio of the inter-class separation degree to the intra-class aggregation degree is used as a feature discriminability measure, the weighted sum of the feature stability measure and the feature discriminability measure is used as a quality score of the feature vector, and the defect feature vector is determined according to the quality score.

[0011] Constructing a fault propagation graph based on the defect feature vector, and locating the code fragment causing the compatibility defect by backtracking and analyzing the node association relationship in the fault propagation graph includes: Constructing a graph structure node based on the defect feature vector, each of the graph structure nodes includes a feature vector, a defect type and a node weight attribute, calculating the cosine similarity between adjacent graph structure nodes, and taking the weighted product of the cosine similarity and the node weight as the propagation probability between the nodes; Calculate the direct influence and cumulative influence of each graph structure node in the fault propagation graph, wherein the direct influence is the weighted sum of the weight of the node's adjacent edges and the target node's weight, and the cumulative influence is the recursive weighted sum of the direct influence and the cumulative influence of the adjacent nodes; Constructing a mapping relationship between code block features and the graph structure nodes, calculating a suspicion score for each code block based on the cumulative influence, and weighted optimizing the suspicion score in combination with the context relevance of the code block to obtain a final score for the code block; The code blocks are sorted in descending order based on their final scores, and the positions of the code blocks that are ranked higher are used as the suspicious code positions that cause compatibility defects.

[0012] The method further comprises: Based on the propagation probability, an edge relationship of a fault propagation graph is constructed, a propagation probability greater than a preset propagation threshold is used as an edge weight, the fault propagation graph is sparsely processed, and the first K maximum edge weights of each graph structure node are retained to obtain an optimized fault propagation graph; Calculating the path strength of all propagation paths in the optimized fault propagation graph, the path strength being the continuous product of all edge weights on the path, performing attenuation processing based on the path length on the path strength to obtain a corrected path strength; The path importance score is calculated based on the corrected path strength and the node weights on the path, and a propagation path that is higher than the sum of the importance mean and the standard deviation is determined as a key propagation path.

[0013] A second aspect of an embodiment of the present invention provides a software defect location system developed based on mobile terminal technology, including: The first unit is used to collect system log information, interface layout information and resource occupancy information of the mobile terminal in the process of executing the test case according to a preset test case, wherein the system log information includes application program interface call information and operating system event information, the interface layout information includes interface control identification information and interface control attribute information, and the resource occupancy information includes central processing unit usage rate information, memory occupancy information and network traffic information; the system log information, the interface layout information and the resource occupancy information are constructed as test benchmark data; The second unit is used to use the test case to perform a test on the updated application after the application version of the mobile terminal is updated, and obtain real-time test data during the test process, wherein the real-time test data includes real-time system log information, real-time interface layout information, and real-time resource occupancy information; based on a pre-trained deep learning model, the real-time test data is compared and analyzed with the test benchmark data, and the deep learning model adopts a long short-term memory network architecture based on a dynamic memory update mechanism to identify abnormal features of the real-time test data relative to the test benchmark data; The third unit is used to classify the abnormal features according to the identified abnormal features by adopting an improved decision tree algorithm to generate a defect feature vector, wherein the improved decision tree algorithm combines information gain with a regularization term to form an optimized splitting criterion to split the decision tree; construct a fault propagation graph based on the defect feature vector, locate the position of the code fragment that causes the compatibility defect by backtracing the node association relationship in the fault propagation graph; compare the located code fragment position with a pre-established code version library, determine the code submission record that introduces the compatibility defect, and output a defect location report.

[0014] A third aspect of the embodiments of the present invention An electronic device is provided, comprising: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the aforementioned method.

[0015] A fourth aspect of the embodiments of the present invention is: A computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the aforementioned method is implemented.

[0016] The beneficial effects of this application are as follows: 1. Improve the efficiency of defect location: Use deep learning models to automatically identify abnormal features and combine them with improved decision tree algorithms for classification, avoiding the large amount of time cost of manual analysis, thereby improving the efficiency of defect location.

[0017] 2. Accurately identify compatibility defects: By comparing real-time test data with benchmark test data, it is possible to accurately identify compatibility defects introduced by application version updates, including changes in interface layout, abnormal resource usage, and system event errors.

[0018] 3. Accurately locate the defective code: Based on the backtracking analysis of the fault propagation graph, the code fragment that causes the compatibility defect can be accurately located. Combined with the code version library information, the code submission record that introduced the defect can be determined, providing developers with a more direct basis for modification. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 A flowchart of a software defect location method developed based on mobile terminal technology according to an embodiment of the present invention; Figure 2 This is a structural diagram of a software defect location system developed based on mobile terminal technology according to an embodiment of the present invention. DETAILED DESCRIPTION

[0020] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0021] The technical solution of the present invention is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0022] Figure 1 FIG. 1 is a flow chart of a software defect location method developed based on mobile terminal technology according to an embodiment of the present invention. Figure 1 As shown, the method includes: S101. According to a preset test case, collect system log information, interface layout information and resource occupancy information of the mobile terminal during the execution of the test case, wherein the system log information includes application program interface call information and operating system event information, the interface layout information includes interface control identification information and interface control attribute information, and the resource occupancy information includes central processing unit usage rate information, memory occupancy information and network traffic information; construct the system log information, the interface layout information and the resource occupancy information as test benchmark data; S102. After the application version of the mobile terminal is updated, the test case is used to perform a test on the updated application to obtain real-time test data during the test, wherein the real-time test data includes real-time system log information, real-time interface layout information, and real-time resource occupancy information; based on a pre-trained deep learning model, the real-time test data is compared and analyzed with the test benchmark data, wherein the deep learning model uses a long short-term memory network architecture based on a dynamic memory update mechanism to identify abnormal features of the real-time test data relative to the test benchmark data; S103. Based on the identified abnormal features, an improved decision tree algorithm is used to classify the abnormal features and generate a defect feature vector, wherein the improved decision tree algorithm combines information gain and regularization terms to form an optimized splitting criterion to split the decision tree; a fault propagation graph is constructed based on the defect feature vector, and the position of the code fragment that causes the compatibility defect is located by backtracing the node association relationship in the fault propagation graph; the located code fragment position is compared with a pre-established code version library to determine the code submission record that introduces the compatibility defect, and a defect location report is output.

[0023] In an optional implementation, the real-time test data is compared and analyzed with the test benchmark data based on a pre-trained deep learning model, wherein the deep learning model adopts a long short-term memory network architecture based on a dynamic memory update mechanism, and is used to identify abnormal features of the real-time test data relative to the test benchmark data, including: Determine the standardized feature vector corresponding to the real-time test data, construct an external memory matrix, the external memory matrix includes a preset number of memory slots, and the dimension of each memory slot is the same as the dimension of the standardized feature vector; calculate the correlation between the standardized feature vector and the external memory matrix, and extract the historical memory information related to the current moment; A memory-aware gating unit is constructed based on the historical memory information, including a memory-aware forgetting gate, an enhanced input gate, and a memory fusion output gate; the memory-aware forgetting gate calculates a forgetting weight based on a hidden state at a previous moment, a current input, and the historical memory information; the enhanced input gate calculates an input weight based on a hidden state at a previous moment, a current input, and the historical memory information; the memory fusion output gate calculates an output weight based on a hidden state at a previous moment, a current input, and the historical memory information; Constructing a memory update gate, calculating an update weight based on the current hidden state and the historical memory information, and dynamically updating the external memory matrix according to the update weight; evaluating the importance of the updated memory, and removing the least important memory information when the number of memory slots exceeds a preset threshold; Calculate the state difference between the current hidden state vector and the reference hidden state vector, and the memory difference between the current external memory matrix and the reference external memory matrix; combine the state difference and the memory difference based on a preset weight factor to obtain a comprehensive difference score; The mean and variance are dynamically updated according to the historical comprehensive difference scores, and an adaptive threshold is calculated based on the mean, the variance and a preset sensitivity coefficient; the comprehensive difference score is compared with the adaptive threshold, and when the comprehensive difference score is greater than the adaptive threshold, it is determined that the real-time test data at the current moment has abnormal features.

[0024] In order to identify the abnormal features of real-time test data relative to benchmark data, a comparative analysis method based on a pre-trained deep learning model is proposed. The model adopts a long short-term memory network (LSTM) architecture with a dynamic memory update mechanism.

[0025] First, the real-time test data is preprocessed, such as data cleaning, missing value filling, etc., and the processed data is converted into a feature vector. Then, the feature vector is standardized using the pre-trained deep learning model to obtain a standardized feature vector. Assume that a standardized feature vector is [0.2, 0.5, 0.8, 0.1].

[0026] Next, construct an external memory matrix. This matrix contains a preset number of memory slots, and the dimension of each memory slot is the same as the dimension of the normalized feature vector. For example, if the number of memory slots is set to 10 and the dimension of each memory slot is 4, then the external memory matrix is ​​a 10x4 matrix. Assume that each row of the initialized memory matrix is ​​[0.1, 0.2, 0.3, 0.4].

[0027] Calculate the correlation between the normalized feature vector and each memory slot in the external memory matrix. The correlation can be calculated using methods such as cosine similarity. Extract the historical memory information related to the current moment. For example, calculate the cosine similarity between [0.2, 0.5, 0.8, 0.1] and [0.1, 0.2, 0.3, 0.4] in each row, and select the contents of the memory slots with the highest similarity as the historical memory information. Assuming that the first three memory slots are selected, the historical memory information is three [0.1, 0.2, 0.3, 0.4].

[0028] Based on the extracted historical memory information, a memory-aware gating unit is constructed, which includes a memory-aware forgetting gate, an enhanced input gate, and a memory fusion output gate. The memory-aware forgetting gate calculates the forgetting weight based on the previous hidden state, current input, and historical memory information to decide which historical information to forget. The enhanced input gate calculates the input weight based on the previous hidden state, current input, and historical memory information to decide which new information needs to be remembered. The memory fusion output gate calculates the output weight based on the previous hidden state, current input, and historical memory information to control which information is output. Assume that the previous hidden state is [0.3, 0.6, 0.2, 0.9] and the current input is [0.2, 0.5, 0.8,0.1]. By combining this information with the historical memory information, the weights of the three gates are calculated.

[0029] Construct a memory update gate, calculate the update weight based on the current hidden state and historical memory information, and dynamically update the external memory matrix according to the update weight. For example, modify the values ​​of certain memory slots in the external memory matrix according to the calculated update weight. Evaluate the importance of the updated memory, and when the number of memory slots exceeds the preset threshold, remove the memory information with the lowest importance. For example, use a method to calculate the importance of each memory slot, and when the number of memory slots exceeds 10, remove the memory slot with the lowest importance.

[0030] Calculate the state difference between the current hidden state vector and the baseline hidden state vector, and the memory difference between the current external memory matrix and the baseline external memory matrix. Assume that the baseline hidden state vector is [0.4, 0.7, 0.3, 0.8], and each row of the baseline external memory matrix is ​​[0.2, 0.3, 0.4, 0.5]. Calculate the state difference and memory difference by comparing the current state and memory matrix with the baseline state and memory matrix.

[0031] The state difference and memory difference are combined based on a preset weight factor to get a comprehensive difference score. For example, assuming the state difference is 0.2, the memory difference is 0.3, and the weight factor is 0.5, the comprehensive difference score is 0.5 * 0.2 + 0.5 * 0.3 = 0.25.

[0032] The mean and variance are dynamically updated based on the historical comprehensive difference score, and the adaptive threshold is calculated based on the mean, variance and preset sensitivity coefficient. For example, if the mean is 0.2, the variance is 0.01, and the sensitivity coefficient is 1.5 based on the historical comprehensive difference score, the adaptive threshold is 0.2 + 1.5 * sqrt(0.01) = 0.35.

[0033] The comprehensive difference score is compared with the adaptive threshold. When the comprehensive difference score is greater than the adaptive threshold, it is determined that the real-time test data at the current moment has abnormal features. For example, if the comprehensive difference score of 0.25 is less than the adaptive threshold of 0.35, it is determined that the real-time test data at the current moment does not have abnormal features.

[0034] The beneficial effects of this method can be summarized in the following three aspects: 1. Improve the accuracy of anomaly detection: By introducing a dynamic memory update mechanism, the model can better capture the temporal dependencies and dynamic changes in real-time test data, thereby improving the accuracy of anomaly detection.

[0035] 2. Enhance the adaptability of the model: The setting of adaptive threshold enables the model to dynamically adjust the threshold according to changes in historical data, thereby enhancing the adaptability of the model to different data distributions.

[0036] 3. Reduce the false alarm rate: By comprehensively considering the state difference and memory difference, and combining it with the adaptive threshold for judgment, the false alarm rate can be effectively reduced and the reliability of anomaly detection can be improved.

[0037] In an optional implementation, calculating the state difference between the current hidden state vector and the reference hidden state vector, and the memory difference between the current external memory matrix and the reference external memory matrix; and combining the state difference and the memory difference based on a preset weight factor to obtain a comprehensive difference score includes: Performing L2 norm normalization processing on the current hidden state vector and the reference hidden state vector respectively to obtain a normalized current hidden state vector and a normalized reference hidden state vector; calculating the Euclidean distance, cosine similarity and Mahalanobis distance based on the normalized current hidden state vector and the normalized reference hidden state vector, and performing weighted combination of the Euclidean distance, the cosine similarity and the Mahalanobis distance according to a preset distance weight coefficient to obtain a state difference measurement value; Calculate the similarity between each memory slot in the current external memory matrix and all memory slots in the reference external memory matrix, and align the memory slots of the current external memory matrix and the reference external memory matrix based on the similarity; calculate the aligned memory slot distance and memory matrix distribution difference, and perform weighted combination of the memory slot distance and the memory matrix distribution difference based on a preset memory weight factor to obtain a memory difference measurement value; A state weight is calculated based on the state difference metric value and its standard deviation, a memory weight is calculated based on the memory difference metric value and its standard deviation, and a product of the state weight and the state difference metric value and a product of the memory weight and the memory difference metric value are added to obtain a comprehensive difference score.

[0038] In order to calculate the comprehensive difference between the current system state and the baseline state, this method comprehensively considers the differences in the system's internal state and external memory.

[0039] First, prepare the current hidden state vector and the reference hidden state vector, as well as the current external memory matrix and the reference external memory matrix. Assume that the hidden state vector is a 128-dimensional vector and the memory matrix is ​​a 64-row 128-column matrix. For example, the current hidden state vector can be [0.1, 0.2, ..., -0.5] and the reference hidden state vector can be [0.2, 0.1, ..., -0.4]. The current and reference memory matrices can be randomly generated 64x128 numerical matrices.

[0040] Next, the hidden state vector is normalized. Divide each element of the current and reference hidden state vectors by the length of the vector to get the normalized vector. For example, if the length of a vector is 2, then divide each element in the vector by 2.

[0041] Then, the state difference metric is calculated. The Euclidean distance, cosine similarity, and Mahalanobis distance of the normalized current hidden state vector and the normalized reference hidden state vector are calculated respectively. The Euclidean distance represents the straight-line distance between two vectors in space, the cosine similarity represents the cosine value of the angle between the two vector directions, and the Mahalanobis distance takes into account the correlation between the various dimensions of the data. Assume that the Euclidean distance is 0.5, the cosine similarity is 0.8, and the Mahalanobis distance is 0.3. The preset distance weight coefficients are 0.4, 0.3, and 0.3, respectively. Then the state difference metric is 0.4 * 0.5 + 0.3 * 0.8 + 0.3 * 0.3 = 0.53.

[0042] Next, calculate the memory difference metric. First, calculate the cosine similarity between each memory slot in the current external memory matrix and all memory slots in the benchmark external memory matrix. Then, find the most similar memory slot pair based on the similarity and align them. Calculate the Euclidean distance between the aligned memory slots as the memory slot distance. At the same time, calculate the distribution difference between the current memory matrix and the benchmark memory matrix. For example, you can calculate the Euclidean distance between the mean vectors of the two matrices. Assume that the memory slot distance is 0.6 and the memory matrix distribution difference is 0.4. The preset memory weight factors are 0.7 and 0.3 respectively. Then the memory difference metric is 0.7 * 0.6 + 0.3 * 0.4 = 0.54.

[0043] Then, calculate the state weight and memory weight. Calculate the standard deviation of the state difference metric and the memory difference metric on their historical values ​​respectively. Divide the state difference metric by its standard deviation to get the state weight, and divide the memory difference metric by its standard deviation to get the memory weight. Assume that the standard deviation of the state difference metric is 0.1 and the standard deviation of the memory difference metric is 0.2. Then the state weight is 0.53 / 0.1 = 5.3, and the memory weight is 0.54 / 0.2 = 2.7.

[0044] Finally, the product of the state weight and the state difference metric is added together with the product of the memory weight and the memory difference metric to get the comprehensive difference score. The comprehensive difference score is 5.3 * 0.53 + 2.7 * 0.54 = 4.269.

[0045] Beneficial effects of this method: Improved accuracy of difference measurement: This method comprehensively considers the internal state of the system and external memory information, and performs weighted combination of different types of differences, which can reflect changes in the system state more comprehensively and accurately.

[0046] Enhanced robustness of difference metric: By normalizing the hidden state vector and using methods such as Mahalanobis distance, the impact of data dimension and noise on the difference metric is reduced, thereby improving robustness.

[0047] Improved the adaptability of difference metrics: By calculating the standard deviation based on historical data and dynamically adjusting the state weight and memory weight, the difference metric can be adaptively adjusted to different scenarios and time periods, thus improving adaptability.

[0048] In an optional implementation, based on the identified abnormal features, an improved decision tree algorithm is used to classify the abnormal features, and generating a defect feature vector includes: Inputting the abnormal feature into a decision tree model, combining the information gain with the regularization term to form an optimized splitting criterion when splitting a node, and selecting an optimal splitting feature based on the optimized splitting criterion; Calculating a maximum depth threshold based on the number of training samples and the mean of the abnormal features, and limiting the depth of the tree within the maximum depth threshold during the growth of the decision tree to obtain an initial decision tree; Calculating the classification error rate and the number of leaf nodes of the initial decision tree, taking the weighted sum of the classification error rate and the number of leaf nodes as the cost complexity, and pruning the initial decision tree by minimizing the cost complexity to obtain an optimized decision tree; Extracting a classification rule set from the optimized decision tree, and calculating a weighted product of accuracy, support and confidence for each rule in the classification rule set as a rule weight; Input the sample to be classified into the optimized decision tree, vote based on the rule weight to obtain the defect category of the sample, calculate the voting weight ratio as the classification confidence, and determine the defect category according to the classification confidence; The average Euclidean distance between the normalized feature vectors corresponding to the samples in the same defect category is calculated to obtain the intra-class aggregation degree, and the minimum Euclidean distance between the normalized feature vectors of different defect categories is calculated to obtain the inter-class separation degree; The ratio of the mean and standard deviation of the normalized feature vector is used as a feature stability measure, the ratio of the inter-class separation degree to the intra-class aggregation degree is used as a feature discriminability measure, the weighted sum of the feature stability measure and the feature discriminability measure is used as a quality score of the feature vector, and the defect feature vector is determined according to the quality score.

[0049] The defect detection method is specifically implemented as follows: First, the collected raw data is preprocessed. The preprocessing steps include data cleaning, normalization and feature selection. Data cleaning is used to remove noise data and missing data. Normalization converts feature data of different dimensions into the same dimension to avoid some features having too much influence on the classification results due to their large values. Feature selection is used to screen key features related to defects, reduce computational complexity and improve classification accuracy. For example, the size data of a batch of products is collected, which includes features such as length, width, height, weight, and color. Through analysis, it is found that the color feature is not related to the defect, so it is eliminated in the feature selection stage. The remaining feature data is normalized to unify the value range to between 0 and 1.

[0050] Next, an improved decision tree model is constructed. In the process of node splitting, information gain combined with regularization term is used as the splitting criterion. Information gain is used to measure the contribution of features to sample classification, and regularization term is used to control the complexity of the decision tree to prevent overfitting. For example, when selecting splitting features, not only the size of information gain should be considered, but also the value range and sample number of the feature, to avoid selecting features with too small value range or too few samples. Assuming that through calculation, the information gain of the feature "length" is 0.8, the regularization term is 0.1, the information gain of the feature "width" is 0.7, and the regularization term is 0.05, then the feature "length" is selected as the splitting feature.

[0051] Then, the decision tree is pruned and optimized. The maximum depth threshold is determined according to the number of training samples and the mean of abnormal features to limit the growth depth of the decision tree. For example, if the number of training samples is 1000 and the mean of abnormal features is 0.5, the maximum depth threshold can be set to 10. After the decision tree grows to the maximum depth, its classification error rate and the number of leaf nodes are calculated. The weighted sum of the classification error rate and the number of leaf nodes is used as the cost complexity, and the decision tree is pruned by minimizing the cost complexity. For example, assuming that the classification error rate of a subtree is 0.2, the number of leaf nodes is 5, and the weighted coefficients are 0.7 and 0.3 respectively, the cost complexity of the subtree is 0.2 * 0.7 + 5 * 0.3 = 1.64. By comparing the cost complexity of different pruning schemes, the scheme with the smallest cost complexity is selected.

[0052] Defect classification of new samples. Input the sample to be classified into the optimized decision tree, and vote according to each matching rule and its weight to obtain the defect category of the sample. For example, suppose a new sample matches two rules, the weight of rule 1 is 0.8, and the defect category is A; the weight of rule 2 is 0.6, and the defect category is B. Then the defect category of the sample is A, and the voting weight is 0.8 / (0.8 + 0.6) = 0.57. Determine the final defect category based on the classification confidence.

[0053] Calculate the quality score of the feature vector. Calculate the average Euclidean distance between the normalized feature vectors corresponding to the samples in the same defect category to obtain the intra-class aggregation. Calculate the minimum Euclidean distance between the normalized feature vectors of different defect categories to obtain the inter-class separation. Use the ratio of the mean and standard deviation of the normalized feature vector as the feature stability measure. Use the ratio of the inter-class separation to the intra-class aggregation as the feature distinguishability measure. Use the weighted sum of the feature stability measure and the feature distinguishability measure as the quality score of the feature vector.

[0054] The beneficial effects of this method are reflected in three aspects: First, the accuracy of defect classification is improved. By combining information gain and regularization terms, the splitting criteria of the decision tree are optimized, which effectively avoids overfitting and improves the generalization ability of the model. The classification accuracy is further improved through pruning optimization and rule weight voting.

[0055] Second, the interpretability of defect classification is enhanced. The set of classification rules extracted based on the decision tree model is clear and easy to understand, making it easier to understand and analyze the causes of defects.

[0056] Third, the quality of defect feature vectors is improved. Feature vectors are evaluated and screened by calculating indicators such as intra-class aggregation, inter-class separation, and feature stability, ensuring the effectiveness and stability of feature vectors.

[0057] In an optional implementation, constructing a fault propagation graph based on the defect feature vector, and locating the code fragment causing the compatibility defect by backtracking and analyzing the node association relationship in the fault propagation graph includes: Constructing a graph structure node based on the defect feature vector, each of the graph structure nodes includes a feature vector, a defect type and a node weight attribute, calculating the cosine similarity between adjacent graph structure nodes, and taking the weighted product of the cosine similarity and the node weight as the propagation probability between the nodes; Calculate the direct influence and cumulative influence of each graph structure node in the fault propagation graph, wherein the direct influence is the weighted sum of the weight of the node's adjacent edges and the target node's weight, and the cumulative influence is the recursive weighted sum of the direct influence and the cumulative influence of the adjacent nodes; Constructing a mapping relationship between code block features and the graph structure nodes, calculating a suspicion score for each code block based on the cumulative influence, and weighted optimizing the suspicion score in combination with the context relevance of the code block to obtain a final score for the code block; The code blocks are sorted in descending order based on their final scores, and the positions of the code blocks that are ranked higher are used as the suspicious code positions that cause compatibility defects.

[0058] The compatibility defect location method aims to quickly and accurately locate the code fragments that cause software compatibility issues. The core idea of ​​this method is to build a fault propagation graph based on the defect feature vector, and trace back to locate the suspicious code position by analyzing the association relationship of the nodes in the graph.

[0059] First, extract defect features from defect reports and related logs, such as error type, occurrence time, involved modules, etc. Convert these features into numerical vectors to form defect feature vectors. For example, a defect feature vector can be represented as: [error type = memory leak, occurrence time = 2024-10-27 10:00:00, involved module = network module], which is numerically represented as [1, 1701283200, 5], where each value represents the encoding of the corresponding feature. Then, create graph structure nodes based on these defect feature vectors. Each node contains three attributes: feature vector, defect type, and node weight. The node weight can be set according to the severity of the defect or other related factors, for example, the weight of a serious defect is set to 0.9 and the weight of a general defect is set to 0.5.

[0060] Next, calculate the similarity between adjacent graph structure nodes. Use the similarity measurement method of feature vectors, such as cosine similarity, to calculate the similarity between nodes. The product of the calculated similarity and the node weight is used as the propagation probability between nodes. For example, the cosine similarity between node A and node B is 0.8, the weight of node A is 0.9, and the weight of node B is 0.5, then the propagation probability from node A to node B is 0.8 * 0.9 * 0.5 = 0.36. In this way, a fault propagation graph is constructed, in which nodes represent defect features and edges represent the possibility of defect propagation.

[0061] Then, the influence of each node in the fault propagation graph is calculated. The direct influence of a node is the sum of the product of the propagation probability of its neighboring nodes and the weight of the target node. The cumulative influence of a node is the weighted sum of its direct influence and the cumulative influence of its neighboring nodes, which is calculated recursively. For example, the propagation probabilities of node A's neighboring nodes B and C are 0.36 and 0.2 respectively, the weight of node A is 0.9, and the cumulative influences of nodes B and C are 0.6 and 0.4 respectively. Then the direct influence of node A is (0.36 * 0.9) + (0.2 * 0.9) = 0.504, and the cumulative influence of node A is 0.504 + (0.36 *0.6) + (0.2 * 0.4) = 0.8004.

[0062] After that, a mapping relationship between code block features and graph structure nodes is established. By analyzing the features of the code block, such as function calls and variable types in the code block, it is matched with the feature vectors of the graph structure nodes. The suspicious score of each code block is calculated based on the cumulative influence. For example, the feature vector similarities between code block A and nodes A and B are 0.8 and 0.6 respectively, and the cumulative influences of nodes A and B are 0.8004 and 0.6 respectively. The suspicious score of code block A is (0.8 *0.8004) + (0.6 * 0.6) = 1.00032. Considering the contextual relevance between code blocks, such as call relationships and data dependencies, the suspicious score is weighted and optimized to obtain the final score of the code block. For example, if code block A calls code block B, the final score of code block B will be improved to a certain extent based on the final score of code block A.

[0063] Finally, the code blocks are sorted in descending order according to their final scores, and the code blocks with the highest ranking are taken as the suspected code positions that cause compatibility defects.

[0064] The beneficial effects of this method can be summarized in the following three aspects: 1. Improve the accuracy of compatibility defect location: By constructing a fault propagation graph and combining code block features and context relevance, the code fragments that cause compatibility defects can be identified more accurately.

[0065] 2. Reduce the cost of locating compatibility defects: By automatically analyzing defect characteristics and code block information, the workload of manual troubleshooting can be reduced, thereby reducing the cost of defect location.

[0066] 3. Improve software compatibility: By quickly locating and repairing compatibility defects, you can improve software compatibility and enhance user experience.

[0067] In an optional embodiment, the method further includes: Based on the propagation probability, an edge relationship of a fault propagation graph is constructed, a propagation probability greater than a preset propagation threshold is used as an edge weight, the fault propagation graph is sparsely processed, and the first K maximum edge weights of each graph structure node are retained to obtain an optimized fault propagation graph; Calculating the path strength of all propagation paths in the optimized fault propagation graph, the path strength being the continuous product of all edge weights on the path, performing attenuation processing based on the path length on the path strength to obtain a corrected path strength; The path importance score is calculated based on the corrected path strength and the node weights on the path, and a propagation path that is higher than the sum of the importance mean and the standard deviation is determined as a key propagation path.

[0068] Fault diagnosis methods for identifying critical propagation paths in complex systems.

[0069] First, obtain the historical fault data of each component in the system and the connection relationship between components. For example, in an electric power system, the components include generators, transformers, transmission lines, etc. The historical data records the time and type of failure of each component in the past, and the connection relationship describes the physical connection or dependency between components.

[0070] Next, based on historical fault data, the probability of fault propagation between components is calculated. For example, the number of times transformer B fails after generator A fails is statistically analyzed and divided by the total number of generator A failures to obtain the fault propagation probability from generator A to transformer B. The value of the propagation probability is between 0 and 1, and the larger the value, the higher the possibility of propagation.

[0071] Then, a fault propagation graph is constructed based on the propagation probability. Each component in the system is represented as a node in the graph, and the propagation probability greater than the preset propagation threshold is used as the edge weight to connect the corresponding two component nodes to form the edge relationship of the graph. Assuming the preset propagation threshold is 0.05, if the propagation probability from generator A to transformer B is 0.1, then add an edge from generator A to transformer B in the graph with an edge weight of 0.1. In order to simplify the fault propagation graph, the graph is sparsely processed. The first K largest edge weights of each node are retained and the other edges are removed. Assuming K=2, if generator A is connected to three components with edge weights of 0.1, 0.08 and 0.06 respectively, then the two edges with weights of 0.1 and 0.08 are retained, and the edge with weight 0.06 is removed.

[0072] Next, the path strength of all propagation paths in the optimized fault propagation graph is calculated. The path strength is defined as the product of all edge weights on the path. For example, for a path from generator A to transformer B and then to transmission line C, if the edge weights are 0.1 and 0.08 respectively, the path strength is 0.1 times 0.08, which is 0.008. In order to consider the impact of path length, the path strength is attenuated based on the path length. For example, if the path length is 2 and the attenuation coefficient is set to 0.9, the corrected path strength is 0.008 times 0.9 squared.

[0073] The path importance score is then calculated based on the corrected path strength and the weights of the nodes on the path. The node weights can be set based on the importance of the components, for example, the weight of the generator is set to 10, the weight of the transformer is set to 8, and the weight of the transmission line is set to 6. The path importance score can be calculated by multiplying the sum of the weights of all nodes on the path by the corrected path strength. For example, a path contains a generator, a transformer, and a transmission line, and the corrected path strength is 0.0072, then the path importance score is (10+8+6) multiplied by 0.0072, which is 0.1728.

[0074] Finally, the propagation paths with a value higher than the sum of the importance mean and standard deviation are determined as key propagation paths. For example, the mean and standard deviation of the importance scores of all paths are calculated. Assuming the mean is 0.1 and the standard deviation is 0.05, the threshold is 0.15, and the paths with a value higher than 0.15 are determined as key propagation paths.

[0075] Beneficial effects:

[0076] 1. Accurately identify critical paths: This method can more accurately identify critical propagation paths in complex systems, avoid missing important risk factors, and thus improve the accuracy of fault diagnosis.

[0077] 2. Improve efficiency: Through graph sparse processing and path strength attenuation, the computational complexity is reduced and the efficiency of fault diagnosis is improved, which is especially suitable for large-scale complex systems.

[0078] 3. Strong interpretability: The method is based on clear logic and calculation process, and the results are easy to understand and explain, which is convenient for guiding troubleshooting and the formulation of preventive measures.

[0079] Figure 2 FIG. 1 is a schematic diagram of the structure of a software defect location system developed based on mobile terminal technology according to an embodiment of the present invention. Figure 2 As shown, the system comprises: The first unit is used to collect system log information, interface layout information and resource occupancy information of the mobile terminal in the process of executing the test case according to a preset test case, wherein the system log information includes application program interface call information and operating system event information, the interface layout information includes interface control identification information and interface control attribute information, and the resource occupancy information includes central processing unit usage rate information, memory occupancy information and network traffic information; the system log information, the interface layout information and the resource occupancy information are constructed as test benchmark data; The second unit is used to use the test case to perform a test on the updated application after the application version of the mobile terminal is updated, and obtain real-time test data during the test process, wherein the real-time test data includes real-time system log information, real-time interface layout information, and real-time resource occupancy information; based on a pre-trained deep learning model, the real-time test data is compared and analyzed with the test benchmark data, and the deep learning model adopts a long short-term memory network architecture based on a dynamic memory update mechanism to identify abnormal features of the real-time test data relative to the test benchmark data; The third unit is used to classify the abnormal features according to the identified abnormal features by adopting an improved decision tree algorithm to generate a defect feature vector, wherein the improved decision tree algorithm combines information gain with a regularization term to form an optimized splitting criterion to split the decision tree; construct a fault propagation graph based on the defect feature vector, locate the position of the code fragment that causes the compatibility defect by backtracing the node association relationship in the fault propagation graph; compare the located code fragment position with a pre-established code version library, determine the code submission record that introduces the compatibility defect, and output a defect location report.

[0080] According to a third aspect of the embodiments of the present invention, An electronic device is provided, comprising: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the aforementioned method.

[0081] A fourth aspect of the embodiments of the present invention is: A computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the aforementioned method is implemented.

[0082] The present invention may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present invention.

[0083] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A software defect location method developed based on mobile terminal technology, characterized in that: include: According to a preset test case, the system log information, interface layout information and resource occupancy information of the mobile terminal during the execution of the test case are collected, wherein the system log information includes application program interface call information and operating system event information, the interface layout information includes interface control identification information and interface control attribute information, and the resource occupancy information includes central processing unit usage rate information, memory occupancy information and network traffic information; the system log information, the interface layout information and the resource occupancy information are constructed as test benchmark data; After the application version of the mobile terminal is updated, the test case is used to perform a test on the updated application to obtain real-time test data during the test, wherein the real-time test data includes real-time system log information, real-time interface layout information, and real-time resource occupancy information; based on a pre-trained deep learning model, the real-time test data is compared and analyzed with the test benchmark data, wherein the deep learning model uses a long short-term memory network architecture based on a dynamic memory update mechanism to identify abnormal features of the real-time test data relative to the test benchmark data; According to the identified abnormal features, an improved decision tree algorithm is used to classify the abnormal features and generate a defect feature vector, wherein the improved decision tree algorithm combines information gain and regularization terms to form an optimized splitting criterion to split the decision tree; a fault propagation graph is constructed based on the defect feature vector, and the position of the code fragment that causes the compatibility defect is located by backtracing the node association relationship in the fault propagation graph; the located code fragment position is compared with a pre-established code version library to determine the code submission record that introduces the compatibility defect, and output a defect location report.

2. The method according to claim 1, characterized in that Based on a pre-trained deep learning model, the real-time test data is compared and analyzed with the test benchmark data. The deep learning model adopts a long short-term memory network architecture based on a dynamic memory update mechanism to identify abnormal features of the real-time test data relative to the test benchmark data, including: Determine the standardized feature vector corresponding to the real-time test data, construct an external memory matrix, the external memory matrix includes a preset number of memory slots, and the dimension of each memory slot is the same as the dimension of the standardized feature vector; calculate the correlation between the standardized feature vector and the external memory matrix, and extract the historical memory information related to the current moment; A memory-aware gating unit is constructed based on the historical memory information, including a memory-aware forgetting gate, an enhanced input gate, and a memory fusion output gate; the memory-aware forgetting gate calculates a forgetting weight based on a hidden state at a previous moment, a current input, and the historical memory information; the enhanced input gate calculates an input weight based on a hidden state at a previous moment, a current input, and the historical memory information; the memory fusion output gate calculates an output weight based on a hidden state at a previous moment, a current input, and the historical memory information; Constructing a memory update gate, calculating an update weight based on the current hidden state and the historical memory information, and dynamically updating the external memory matrix according to the update weight; evaluating the importance of the updated memory, and removing the least important memory information when the number of memory slots exceeds a preset threshold; Calculate the state difference between the current hidden state vector and the reference hidden state vector, and the memory difference between the current external memory matrix and the reference external memory matrix; combine the state difference and the memory difference based on a preset weight factor to obtain a comprehensive difference score; The mean and variance are dynamically updated according to the historical comprehensive difference scores, and an adaptive threshold is calculated based on the mean, the variance and a preset sensitivity coefficient; the comprehensive difference score is compared with the adaptive threshold, and when the comprehensive difference score is greater than the adaptive threshold, it is determined that the real-time test data at the current moment has abnormal features.

3. The method according to claim 2, characterized in that Calculate the state difference between the current hidden state vector and the reference hidden state vector, and the memory difference between the current external memory matrix and the reference external memory matrix; Combining the state difference and the memory difference based on a preset weight factor to obtain a comprehensive difference score includes: Performing L2 norm normalization processing on the current hidden state vector and the reference hidden state vector respectively to obtain a normalized current hidden state vector and a normalized reference hidden state vector; calculating the Euclidean distance, cosine similarity and Mahalanobis distance based on the normalized current hidden state vector and the normalized reference hidden state vector, and performing weighted combination of the Euclidean distance, the cosine similarity and the Mahalanobis distance according to a preset distance weight coefficient to obtain a state difference measurement value; Calculate the similarity between each memory slot in the current external memory matrix and all memory slots in the reference external memory matrix, and align the memory slots of the current external memory matrix and the reference external memory matrix based on the similarity; calculate the aligned memory slot distance and memory matrix distribution difference, and perform weighted combination of the memory slot distance and the memory matrix distribution difference based on a preset memory weight factor to obtain a memory difference measurement value; A state weight is calculated based on the state difference metric value and its standard deviation, a memory weight is calculated based on the memory difference metric value and its standard deviation, and a product of the state weight and the state difference metric value and a product of the memory weight and the memory difference metric value are added to obtain a comprehensive difference score.

4. The method according to claim 1, characterized in that: According to the identified abnormal features, the improved decision tree algorithm is used to classify the abnormal features and generate defect feature vectors including: Inputting the abnormal feature into a decision tree model, combining the information gain with the regularization term to form an optimized splitting criterion when splitting a node, and selecting an optimal splitting feature based on the optimized splitting criterion; Calculating a maximum depth threshold based on the number of training samples and the mean of the abnormal features, and limiting the depth of the tree within the maximum depth threshold during the growth of the decision tree to obtain an initial decision tree; Calculating the classification error rate and the number of leaf nodes of the initial decision tree, taking the weighted sum of the classification error rate and the number of leaf nodes as the cost complexity, and pruning the initial decision tree by minimizing the cost complexity to obtain an optimized decision tree; Extracting a classification rule set from the optimized decision tree, and calculating a weighted product of accuracy, support and confidence for each rule in the classification rule set as a rule weight; Input the sample to be classified into the optimized decision tree, vote based on the rule weight to obtain the defect category of the sample, calculate the voting weight ratio as the classification confidence, and determine the defect category according to the classification confidence; The average Euclidean distance between the normalized feature vectors corresponding to the samples in the same defect category is calculated to obtain the intra-class aggregation degree, and the minimum Euclidean distance between the normalized feature vectors of different defect categories is calculated to obtain the inter-class separation degree; The ratio of the mean and standard deviation of the normalized feature vector is used as a feature stability measure, the ratio of the inter-class separation degree to the intra-class aggregation degree is used as a feature discriminability measure, the weighted sum of the feature stability measure and the feature discriminability measure is used as a quality score of the feature vector, and the defect feature vector is determined according to the quality score.

5. The method according to claim 1, characterized in that Constructing a fault propagation graph based on the defect feature vector, and locating the code fragment causing the compatibility defect by backtracking and analyzing the node association relationship in the fault propagation graph includes: Constructing a graph structure node based on the defect feature vector, each of the graph structure nodes includes a feature vector, a defect type and a node weight attribute, calculating the cosine similarity between adjacent graph structure nodes, and taking the weighted product of the cosine similarity and the node weight as the propagation probability between the nodes; Calculate the direct influence and cumulative influence of each graph structure node in the fault propagation graph, wherein the direct influence is the weighted sum of the weight of the node's adjacent edges and the target node's weight, and the cumulative influence is the recursive weighted sum of the direct influence and the cumulative influence of the adjacent nodes; Constructing a mapping relationship between code block features and the graph structure nodes, calculating a suspicion score for each code block based on the cumulative influence, and weighted optimizing the suspicion score in combination with the context relevance of the code block to obtain a final score for the code block; The code blocks are sorted in descending order based on their final scores, and the positions of the code blocks that are ranked higher are used as the suspicious code positions that cause compatibility defects.

6. The method according to claim 5, characterized in that The method further comprises: Based on the propagation probability, an edge relationship of a fault propagation graph is constructed, a propagation probability greater than a preset propagation threshold is used as an edge weight, the fault propagation graph is sparsely processed, and the first K maximum edge weights of each graph structure node are retained to obtain an optimized fault propagation graph; Calculating the path strength of all propagation paths in the optimized fault propagation graph, the path strength being the continuous product of all edge weights on the path, performing attenuation processing based on the path length on the path strength to obtain a corrected path strength; The path importance score is calculated based on the corrected path strength and the node weights on the path, and a propagation path that is higher than the sum of the importance mean and the standard deviation is determined as a key propagation path.

7. A software defect location system developed based on mobile terminal technology, used to implement the method as described in any one of claims 1 to 6, characterized in that: include: The first unit is used to collect system log information, interface layout information and resource occupancy information of the mobile terminal in the process of executing the test case according to a preset test case, wherein the system log information includes application program interface call information and operating system event information, the interface layout information includes interface control identification information and interface control attribute information, and the resource occupancy information includes central processing unit usage rate information, memory occupancy information and network traffic information; the system log information, the interface layout information and the resource occupancy information are constructed as test benchmark data; The second unit is used to use the test case to perform a test on the updated application after the application version of the mobile terminal is updated, and obtain real-time test data during the test process, wherein the real-time test data includes real-time system log information, real-time interface layout information, and real-time resource occupancy information; based on a pre-trained deep learning model, the real-time test data is compared and analyzed with the test benchmark data, and the deep learning model adopts a long short-term memory network architecture based on a dynamic memory update mechanism to identify abnormal features of the real-time test data relative to the test benchmark data; The third unit is used to classify the abnormal features according to the identified abnormal features by adopting an improved decision tree algorithm to generate a defect feature vector, wherein the improved decision tree algorithm combines information gain with a regularization term to form an optimized splitting criterion to split the decision tree; construct a fault propagation graph based on the defect feature vector, locate the position of the code fragment that causes the compatibility defect by backtracing the node association relationship in the fault propagation graph; compare the located code fragment position with a pre-established code version library, determine the code submission record that introduces the compatibility defect, and output a defect location report.

8. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.