Detection model construction and updating method and device, equipment, storage medium and product

By constructing and updating defect detection models based on feature extraction and principal component analysis, the problem of insufficient software performance defect detection capabilities is solved, automated and efficient software performance detection is realized, and the detection efficiency and accuracy of the software R&D life cycle is improved. Enhanced software maintainability and stability.

CN119201715APending Publication Date: 2024-12-27CHINA MERCHANTS BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411270659.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2024-12-27

Smart Images

  • Figure CN119201715A_ABST
    Figure CN119201715A_ABST
Patent Text Reader

Abstract

The invention discloses a detection model construction and updating method and device, equipment, a storage medium and a product, and relates to the technical field of defect detection.The method comprises the steps that an initial defect data set is constructed according to performance defect cases obtained in advance; performing feature vector extraction and principal component analysis on the basis of the initial defect data set to construct a defect detection model; and in response to a model iteration updating trigger event, updating the defect detection model according to the event type of the model iteration updating trigger event to obtain a defect detection updating model, and constructing and iteratively updating a defect detection model based on feature extraction and principal component analysis through the process. According to the invention, automatic, high-efficiency and high-accuracy software performance defect detection can be realized, so that the efficiency and the accuracy of problem detection in a software research and development life cycle are improved, and the maintainability and the stability of software are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of defect detection technology, and in particular to a detection model construction and update method, device, equipment, storage medium and product. Background Art

[0002] With the development of the Internet and digital technology, the application scenarios of software systems are becoming increasingly broad, the complexity of system architecture has increased significantly, the business pressure that needs to be borne has risen rapidly, and the performance requirements for software systems have become higher and higher. However, in the actual R&D process, software performance defects often occur. If they can be discovered and resolved in time before production, the impact will not be significant. Otherwise, customer use will inevitably be affected. Therefore, the identification, location, and resolution of software system performance defects are important links in improving system quality.

[0003] Traditional performance defect location and repair mainly rely on R&D personnel to manually analyze the code based on known problems to find the root cause and solve the verification. This method is closely related to individual capabilities, the cost is uncontrollable, and it is not universal. In addition, the premise of this solution is that the risk is known. If it cannot be identified, the defect will inevitably be left to production. It can be found that the traditional defect location and solution lack forward-looking capabilities. Automated detection tools such as SonarQube have powerful code review functions and support multiple programming languages. They can effectively detect code vulnerabilities, code duplication and other problems, but the ability to identify program logic errors and performance problems is very limited, and manpower is still required to review the code. Therefore, it is difficult for existing technologies to simultaneously achieve early problem detection, continuous integration, and automated testing in the software development life cycle, which affects the software delivery quality and customer experience, as well as the maintainability and stability of the software.

[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of this application is to provide a detection model construction and update method, device, equipment, storage medium and computer program product, aiming to improve the efficiency and accuracy of problem detection in the software development life cycle, thereby improving software maintainability and stability.

[0006] To achieve the above objectives, the present application proposes a detection model construction and updating method, the method comprising:

[0007] Construct an initial defect dataset based on pre-acquired performance defect cases;

[0008] Performing feature vector extraction and principal component analysis based on the initial defect data set to build a defect detection model;

[0009] In response to a model iteration update triggering event, the defect detection model is updated according to the event type of the model iteration update triggering event to obtain a defect detection update model.

[0010] In one embodiment, the step of constructing an initial defect data set based on pre-acquired performance defect cases includes:

[0011] Obtain pre-collected performance defect cases;

[0012] Distribute the performance defect cases to the target user group according to the preset distribution scale for defect root cause calibration referendum;

[0013] According to the result of the defect root cause calibration referendum, a multi-level label of defect root cause classification of the performance defect case is determined by a preset root cause calibration strategy to obtain an initial defect data set.

[0014] In one embodiment, the step of determining the defect root cause classification multi-level labels of the performance defect case according to the result of the defect root cause calibration referendum using a preset root cause calibration strategy to obtain an initial defect data set includes:

[0015] Determine the referendum probabilities of each label corresponding to the performance defect case in the result of the defect root cause calibration referendum;

[0016] If the classification label corresponding to the maximum value of the referendum probabilities of each label is not unique, the preset distribution scale is expanded by the preset growth value and then the following steps are performed:

[0017] Distribute the performance defect cases to the target user group according to the preset distribution scale for defect root cause calibration referendum;

[0018] If the classification label corresponding to the maximum value among the referendum probabilities of each label is unique, the classification label is determined as the defect root cause classification multi-level label of the performance defect case.

[0019] In one embodiment, the step of performing feature vector extraction and principal component analysis based on the initial defect data set to construct a defect detection model includes:

[0020] Extracting key performance characteristics of defect cases in the initial defect data set;

[0021] Based on the key performance characteristics of the defect case, generating a complete feature vector corresponding to the defect case;

[0022] Based on the complete feature vector and a preset radial basis kernel function RBF, a defect primary classification model is trained to obtain a primary classification feature vector;

[0023] Performing feature differentiation dimensionality reduction processing on the first-level classification feature vector through principal component analysis to obtain a second-level classification feature vector;

[0024] A defect secondary classification model is trained based on the secondary classification feature vector and a preset linear kernel function to obtain a defect detection model.

[0025] In one embodiment, the model iteration update triggering event includes a manual sample addition event, and the step of updating the defect detection model in response to the model iteration update triggering event according to the event type of the model iteration update triggering event to obtain the defect detection update model includes:

[0026] In response to a manual sample adding event, obtaining a defect case sample input by a user;

[0027] Analyze the sample characteristics and defect root cause classification multi-level labels of the defect case samples, wherein the defect root cause classification multi-level labels include a primary defect category label and a secondary defect category label;

[0028] The defect detection model is iteratively trained through the first-level defect major category labels, the second-level defect minor category labels and the sample features to obtain a defect detection update model.

[0029] In one embodiment, the model iteration update triggering event includes a defect recognition detection event, and the step of updating the defect detection model in response to the model iteration update triggering event according to the event type of the model iteration update triggering event to obtain the defect detection update model includes:

[0030] In response to a defect identification detection event, obtaining case information to be detected, wherein the case information to be detected includes a primary defect category label and a secondary defect category label;

[0031] Identify the detection case information through the defect detection model to obtain a classification recognition result, wherein the classification recognition result includes a primary defect recognition label and a secondary defect recognition label;

[0032] Quantifying a first error between the primary defect category label and the primary defect identification label, and a second error between the secondary defect category label and the secondary defect identification label based on a preset loss function;

[0033] Model parameters of the defect detection model are adjusted based on the first error and the second error respectively to obtain an updated defect detection model.

[0034] In addition, to achieve the above-mentioned purpose, the present application also proposes a detection model construction and update device, the detection model construction and update device comprising:

[0035] The first building module is used to build an initial defect data set based on pre-acquired performance defect cases;

[0036] A second building module is used to perform feature vector extraction and principal component analysis based on the initial defect data set to build a defect detection model;

[0037] The updating module is used to respond to the model iteration update triggering event and update the defect detection model according to the event type of the model iteration update triggering event to obtain the defect detection update model.

[0038] In addition, to achieve the above-mentioned objectives, the present application also proposes a detection model construction and update device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the detection model construction and update method as described above.

[0039] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the detection model construction and update method described above are implemented.

[0040] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the detection model construction and update method described above.

[0041] One or more technical solutions proposed in the present application construct an initial defect data set based on pre-acquired performance defect cases; perform feature vector extraction and principal component analysis based on the initial defect data set to construct a defect detection model; in response to a model iteration update trigger event, update the defect detection model according to the event type of the model iteration update trigger event to obtain a defect detection update model. By constructing and iteratively updating a defect detection model based on feature extraction and principal component analysis through the above process, automated, efficient and accurate software performance defect detection can be achieved, thereby improving the efficiency and accuracy of problem detection in the software development life cycle, thereby improving software maintainability and stability. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0043] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0044] Figure 1 A flowchart of the first embodiment of the method for constructing and updating a detection model of the present application is provided;

[0045] Figure 2 This is a user operation diagram of the detection model construction and update method for this application;

[0046] Figure 3 Schematic diagram of the labeling of the performance defect dataset for the detection model construction and update method of this application;

[0047] Figure 4 A flow chart of the second embodiment of the method for constructing and updating a detection model of the present application;

[0048] Figure 5 A schematic diagram of feature vector training for the detection model construction and update method of this application;

[0049] Figure 6 Schematic diagram of principal component analysis for the construction and update method of the detection model for this application;

[0050] Figure 7 Schematic diagram of performance defect identification and defect classification for the construction and update method of the detection model for this application;

[0051] Figure 8 A brief flowchart of the detection model construction and update method provided in Example 2 of the present application;

[0052] Fig. 9 A schematic diagram of the module structure of the detection model construction and update device according to the embodiment of the present application;

[0053] Fig.10 Schematic diagram of the device structure of the hardware operating environment involved in the detection model construction and update method in the embodiment of the present application.

[0054] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0055] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0056] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0057] The main solution of the embodiment of the present application is: to address the problem of insufficient software performance defect identification capabilities, the method of the present invention aims to improve the efficiency of identifying and repairing software system performance defects, build a classification model based on common software performance defects, embed the model into a dedicated software platform, and build a supervised classification model in combination with existing sample data sets. Users only need to submit the code segment to be detected to the system to call the classification model to automatically perform performance defect detection.

[0058] In order to address the problem that software performance defects present diversity, dynamism, randomness and other characteristics as software development progresses, which leads to reduced accuracy of performance defect classification models, the present invention supports dynamic sample insertion and updating. Users can add defect samples on the platform to enrich the number of samples, thereby improving the accuracy of model detection.

[0059] In order to solve the problem of excessive manpower investment in performance defect location, the model proposed in this invention automatically detects code to identify performance risks, classifies the detected performance defects, and points out the direction of problem solving for R&D personnel, thereby improving work efficiency. It helps testers with low technical reserves to quickly discover performance defects and ensure high-quality delivery of software.

[0060] This application provides a solution and proposes a model idea for performance defect detection, which helps R&D and testing personnel identify program risks from a performance perspective, embeds the model into a dedicated platform to make a tool for users, and the tool-based detection method greatly reduces the learning and usage costs.

[0061] The defect case samples are sorted and classified and labeled. A two-stage coarse-grained and fine-grained tightly coupled supervised training method is adopted. The first-level classification is completed by pre-screening effective case samples at the coarse-grained level. The results are used as the input of the second-level classification to guide the construction of the fine-grained decision tree model, thereby realizing the initial construction of the performance defect detection classification model.

[0062] Strengthen training and use the dynamic loss weight method when using the model to detect code to enhance the self-learning ability of the decision tree model. That is, reward and consolidate correct judgments and punish and correct incorrect judgments to gradually improve the accuracy of defect sample classification.

[0063] It should be noted that the execution subject of this embodiment can be a computing service device with detection model construction and update, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a detection model construction and update system, etc. The following takes the detection model construction and update system as an example to illustrate this embodiment and the following embodiments.

[0064] Based on this, the present application embodiment provides a detection model construction and update method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the detection model construction and update method of the present application.

[0065] In this embodiment, the detection model construction and update method includes steps S1000 to S3000:

[0066] Step S1000: constructing an initial defect data set according to pre-acquired performance defect cases;

[0067] It should be noted that building the initial defect data set is the basis for defect detection model training. The system first needs to collect and organize performance defect cases that have been identified and classified in history. These cases contain rich defect information, such as defect type, location, impact, etc., which are the key to building a high-quality data set. The system analyzes these cases and extracts useful information to provide data support for subsequent feature extraction and model training. The purpose of this step is to enable the system to learn the patterns of historical defects so that it can more accurately identify new defects in the future.

[0068] Since the programming languages, frameworks, and coding rules used by various software systems are different, the causes of performance problems may come from multiple aspects, such as network delays, unreasonable program design, and poor database query efficiency. Therefore, in order to improve the accuracy of the performance defect detection model, it is necessary to continuously add new samples to train and update the model. The use of a visual software platform not only provides convenience for user operation, but also attracts more users to try it out. The more samples are used, the richer the model will be, and the model can be further trained and optimized, and its detection accuracy will inevitably be higher.

[0069] Therefore, the present invention first constructs a visual software platform (which can be completed in programming languages ​​such as Java, Python, Go, etc.), the main components of which are front-end pages, back-end services, and databases. The trained defect detection model is embedded in the platform, supporting multiple users to log in to perform defect case filling and performance defect detection operations, forming a complete set of trainable, self-detecting, and self-correcting systems. The user operation on the software platform is shown in the figure below. Figure 2 As shown in the figure, the premise of "inputting the code module to be tested" is that the performance problem of the input module is known, and then the defect category detection is performed to verify the accuracy of the model. The role of "manual correction" is to mark the correct classification label for the sample before it is put into storage. For example, if the real classification label of the sample is M, and the classification model identifies the sample defect type as N, then when entering the warehouse, the sample needs to be manually classified into category N to ensure the authenticity of the input sample classification.

[0070] For example, in a specific implementation, the system may import 1,000 known performance defect cases from a historical project database, which cover a variety of different software systems and application scenarios, and use these cases as raw materials for building an initial defect dataset.

[0071] Step S2000: performing feature vector extraction and principal component analysis based on the initial defect data set to construct a defect detection model;

[0072] It should be noted that feature vector extraction is the process of converting defect cases into numerical forms that can be understood by the model. In this embodiment, the system will analyze each case in the initial defect data set and extract key information that reflects the performance characteristics of the case, such as code complexity, execution time, resource consumption, etc. This information is encoded as feature vectors, one vector for each case. Subsequently, the system uses principal component analysis (PCA) technology to reduce the dimensionality of the feature vectors to reduce the complexity of the data and highlight the most important features. PCA helps the system identify the most influential features, thereby improving the classification accuracy of the model.

[0073] In addition, it should be noted that after the dimensionality reduction through principal component analysis, the system will use these refined feature vectors to train the defect detection model. During the training process, the system may use machine learning algorithms, such as support vector machines (SVM), to learn how to identify different performance defects based on feature vectors. The purpose of this step is to build a model that can accurately classify performance defects to support software quality assurance.

[0074] In addition, it should be noted that the purpose of principal component analysis based on the initial defect data set is to convert qualitative performance defect cases into quantitative feature representations, and then build an effective defect detection model. In this step, the system first extracts the key performance features of each defect case, which may include but are not limited to code complexity, execution time, resource consumption, etc. Then, the system generates a complete feature vector for each case, which is a collection of all key performance features of the case.

[0075] In addition, it should be noted that the system will use the preset radial basis kernel function to process the complete feature vector to train the defect primary classification model. This process aims to classify defect cases into several large categories. Subsequently, the system performs dimensionality reduction processing on the primary classification feature vector through principal component analysis to extract the most discriminating features and form a secondary classification feature vector. Finally, the system trains the defect secondary classification model based on the secondary classification feature vector and the preset linear kernel function, thereby obtaining a detection model that can accurately identify different performance defect categories.

[0076] For example, in a specific implementation, the system may extract key performance features such as "number of cycles" and "number of database connections" from the initial defect data set and generate feature vectors based on these features. The system then uses these vectors to train a support vector machine model that can identify whether the case belongs to a defect category such as "memory leak" or "inefficient execution".

[0077] Step S3000: In response to a model iteration update triggering event, the defect detection model is updated according to the event type of the model iteration update triggering event to obtain a defect detection update model.

[0078] It should be noted that the purpose of updating the defect detection model in response to the model iteration update trigger event is to ensure that the model can adapt to new defect cases and changing software environments. In this step, the system monitors various model iteration update trigger events, such as users manually adding new defect samples or the system identifying defect cases that are not covered by the existing model in actual detection. Once these events are detected, the system will obtain relevant defect case samples and parse their features and defect root cause classification multi-level labels.

[0079] In addition, it should be noted that the system will use the newly acquired samples and labels to iteratively train the defect detection model. This may involve re-evaluating model parameters, adding new training data, or adjusting the model structure. In this way, the system can continuously optimize the performance of the model and improve its recognition accuracy for new defects.

[0080] For example, in a specific implementation, the system may receive a new defect case submitted by a user through a user interface. The system will analyze the characteristics of this case, such as specific patterns in the code or abnormal information in the system log, and compare it with known defect categories. The system will then include this new case in the training set and retrain the model using the updated training set so that the model can recognize this new type of defect. Through this iterative update mechanism, the system can continuously improve its defect detection capabilities and adapt to the ever-changing software quality detection needs.

[0081] In a feasible implementation manner, step S1000 may include steps S1100 to S1300:

[0082] Step S1100: Acquire pre-collected performance defect cases;

[0083] Step S1200: Distribute the performance defect case to the target user group for defect root cause identification referendum according to a preset distribution scale;

[0084] Step S1300: According to the result of the defect root cause calibration referendum, a multi-level label of defect root cause classification of the performance defect case is determined using a preset root cause calibration strategy to obtain an initial defect data set.

[0085] In a feasible implementation manner, step S1300 may include steps S1310 to S1340:

[0086] Step S1310: determining the referendum probabilities of each label corresponding to the performance defect case in the result of the defect root cause calibration referendum;

[0087] Step S1320: If the classification label corresponding to the maximum value of the referendum probabilities of each label is not unique, then the preset distribution scale is expanded according to the preset growth value and then the following steps are performed:

[0088] Step S1330: Distribute the performance defect case to the target user group for defect root cause identification referendum according to a preset distribution scale;

[0089] Step S1340: If the classification label corresponding to the maximum value among the label referendum probabilities is unique, the classification label is determined as the defect root cause classification multi-level label of the performance defect case.

[0090] It should be noted that building an initial defect dataset is the first key step in implementing an effective performance defect detection model. In this embodiment, the system first obtains pre-collected performance defect cases, which are defect instances that have been identified and recorded in historical projects and may come from automated testing, user reports, or code reviews. These cases contain rich defect information, such as the manifestation of the defect, the scope of impact, and the difficulty of repair, and are an important resource for building a dataset.

[0091] In order to improve the accuracy and diversity of defect classification, the system distributes these performance defect cases to the target user group according to the preset distribution scale for defect root cause calibration referendum. By allowing users with different backgrounds and experiences to vote on the defect cause of each case, the accuracy and diversity of the classification results are increased. The user group can include software developers, test engineers, and project managers, whose expertise and experience help improve the quality of defect classification.

[0092] After collecting the referendum results, the system determines the multi-level labels for the defect root cause classification of the performance defect cases according to the preset root cause calibration strategy. The multi-level labels here refer to assigning at least two levels of labels to each case. For example, the first-level label may represent a high-level classification of the defect, such as "performance bottleneck" or "resource leakage", while the second-level label provides a more specific classification, such as "improper database indexing" or "memory management error". This hierarchical labeling system makes the data set richer and more detailed, which is helpful for subsequent feature extraction and model training.

[0093] Through the above process, the system is able to build a high-quality initial defect dataset, laying a solid foundation for subsequent feature vector extraction and model training. This dataset not only contains detailed information about the defect cases, but also provides a deep understanding of the defects through a multi-level labeling system, enabling the model to learn and identify various performance defects more accurately.

[0094] For example, in a feasible implementation, the calibration of the original data set is performed by multi-person soft voting. For example, for defect sample A, multi-person voting is used for both the first and second level classifications, and the probability of belonging to each category is expressed by a probability value. Finally, the judgment results of all people are added and averaged to obtain the probability of belonging to each category, and the one with the largest value wins. The following formula represents the probability of sample A being judged to belong to the jth category after being scored by n people, where Pi represents the probability that the i-th person judges that sample A belongs to the jth category, and P i ∈[0,100%].

[0095]

[0096] After obtaining the probability of sample A being judged as each category, the one with the largest probability value is taken as the classification label of sample A. If the probability of sample A belonging to the jth and j+1th categories is the same and both are the maximum values, then the number of voters is doubled to initiate the next round of voting, and the voting calculation is repeated until the final classification result is obtained. The number of voters in each round can be selected according to the defect characteristics. In the first-level classification, the characteristics are relatively easy to identify. For example, the high CPU overhead of the server is likely to be related to the application, and the high CPU overhead of the database is definitely a database defect, so the number of people can be smaller in the first-level classification voting. In the second-level classification, the features are refined, and the similarity between the features is greater, so more people can participate in the voting to obtain the most accurate classification label.

[0097] Performance defect dataset label classification Figure 3 As shown in the figure, after the defect classification is completed, the category label of sample A can be indicated by P_p1, indicating that the first-level root cause of the defect sample A is P, and the second-level root cause is p1. When calibrating the data set, the first-level and second-level root cause classification is divided according to the actual characteristics of the defect. Different coding languages ​​can set different first-level root causes, and multiple second-level root causes can be divided under different first-level root causes of the same coding language.

[0098] This embodiment provides a detection model construction and update method, which constructs an initial defect data set based on pre-acquired performance defect cases; performs feature vector extraction and principal component analysis based on the initial defect data set to construct a defect detection model; in response to a model iteration update trigger event, the defect detection model is updated according to the event type of the model iteration update trigger event to obtain a defect detection update model. By constructing and iteratively updating a defect detection model based on feature extraction and principal component analysis through the above process, automated, efficient and accurate software performance defect detection can be achieved, thereby improving the efficiency and accuracy of problem detection in the software development life cycle, thereby improving software maintainability and stability.

[0099] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 4 The step S2000 of the detection model construction and updating method further includes steps S2100 to S2500:

[0100] Step S2100: extracting key performance characteristics of defect cases in the initial defect data set;

[0101] Step S2200: generating a complete feature vector corresponding to the defect case based on the key performance characteristics of the defect case;

[0102] It should be noted that extracting the key performance features of defect cases in the initial defect data set is the basis for building a defect detection model. Key performance features refer to those attributes that can significantly affect software performance, such as response time, memory usage, CPU occupancy, etc. These features can reflect the problems that may occur during the operation of the software and are key clues for identifying performance defects. In this embodiment, the system identifies and extracts these key features from defect cases through automated tools or manual analysis to provide necessary data for subsequent feature vector generation.

[0103] In addition, it should be noted that the purpose of generating a complete feature vector based on the key performance characteristics of the defect case is to convert qualitative performance issues into quantitative data representations, where the complete feature vector is a vector composed of all features, also known as a feature tensor, which facilitates the processing of the machine learning model. In this embodiment, all key performance characteristics of each defect case are integrated into a complete feature vector, which is mathematically a point in a multidimensional space, where each dimension corresponds to a key performance characteristic. This representation method enables the model to identify patterns of performance defects by learning these vectors.

[0104] In this embodiment, although the functions implemented by different coding languages ​​are different, their logical characteristics are common. Regarding code feature extraction, features with important influence can be extracted according to the functional characteristics of the code, such as semantic analysis, keyword statistical analysis, visualization and other means, and features can be generated through aggregation, combination, derivation and other methods, and key content can be selected to form a feature vector. The following Table 1 is an example of feature extraction of a certain section of code. After the code feature extraction, a multi-dimensional feature vector matrix is ​​formed for subsequent training.

[0105] Table 1 An example of a code feature extraction result

[0106]

[0107] Step S2300: training a defect primary classification model based on the complete feature vector and a preset radial basis kernel function to obtain a primary classification feature vector;

[0108] It should be noted that the use of radial basis kernel function for defect primary classification model training is to preliminarily classify defect cases into several major categories. The radial basis kernel function is a commonly used kernel function that can map data into a high-dimensional space, making the originally linearly inseparable data linearly separable. In this embodiment, the system uses the feature vector extracted from the initial defect data set to train a classifier through the radial basis kernel function, which can identify different major categories of performance defects.

[0109] Specifically, after the classification and calibration of the performance defect data set is completed, the system can then use the data set for iterative training. Although the performance defect features are diverse, there are still similar relationships between different types of defects. It is difficult to completely isolate different defect features with a straight line. Therefore, defect classification belongs to a linear inseparable problem. For linear inseparable problems, the data can be mapped to a high-dimensional space with the help of a nonlinear model to make it linearly separable. In this embodiment, the defect data set is first extracted with the above-mentioned feature extraction method to extract feature vectors, and then the training of the first-level classification model of performance defects is implemented using the radial basis kernel function RBF (Radial Basis Function). It is assumed that the major categories of performance defects are represented by a set F = {F1, F2, ... F m}, the function expression of using the model to judge the performance defect classification is:

[0110]

[0111] Where Nsv represents the number of support vectors, ai is the weight factor, K is the selected kernel function, z is the input vector, si is the i-th support vector obtained after training, and b is the fixed bias. sign represents the symbol operation, and the expression y=sign(x) is as follows. The calculation result is 1, which means it belongs to this type of defect, and 0, which means it does not belong to this type of defect.

[0112]

[0113] During the initial training, the complete feature vector (i.e., feature tensor) of each code is input, and the corresponding first-level classification feature vector (i.e., the feature vector in the figure) is extracted through the RBF kernel function. The process is shown in the figure. Figure 5 shown.

[0114] Step S2400: performing feature differentiation dimensionality reduction processing on the first-level classification feature vector through principal component analysis to obtain a second-level classification feature vector;

[0115] In this embodiment, there are differences in the feature dimensions of different defects (the richer the features, the higher the dimension). Directly using the first-level classification features for further training may lead to excessive model complexity, affecting the final classification effect. In view of this problem, the principal component analysis (PCA) is introduced in this embodiment to extract and reduce the dimensions of the major category features. For example, the feature vector of the original major category is A. The redundant information is removed by PCA, and only the irrelevant principal component feature vector A' that can mark the class is retained to strengthen the difference feature. The schematic diagram of the principal component analysis is shown in Figure 6. Taking the application as an example of the first-level classification, interface errors caused by application performance problems will occur in many scenarios (assuming that the interface return is composed of "{RtnCod+BODY}"). The effect of further positioning based on the error RtnCod may not be significant. At this time, if the error feature is further processed to extract the error prompt information in BODY, the efficiency of finding the cause according to the prompt will inevitably increase. Therefore, before the secondary classification, the common part of the feature such as RtnCod is removed, and the differentiated part such as BODY is retained. The more obvious the difference, the more accurate the secondary classification result.

[0116] Step S2500: training a defect secondary classification model based on the secondary classification feature vector and a preset linear kernel function to obtain a defect detection model.

[0117] It should be noted that the purpose of training the defect secondary classification model based on the secondary classification feature vector and the preset linear kernel function is to classify the defects more finely. In this step, the system uses the linear kernel function to further train the classification model on the feature vector after dimensionality reduction. The linear kernel function is a simple kernel function that is suitable for data that is basically linearly separable in the original space. Through this step, the model can more accurately identify the type of specific defects.

[0118] After the principal component analysis, the remaining features are very different and almost linearly separable. At this time, the linear kernel function is used for secondary classification. The expression is as follows, where x and y are both n-dimensional vectors, b is the offset, and x is transposed and multiplied by y, and then the offset is added to get the final secondary classification result:

[0119] k(x,y)=x T *y+b

[0120] For example, in one specific implementation, the system first identifies key performance features from the initial defect data set, such as "too long response time" or "high abnormal frequency". The system then generates a complete feature vector for each defect case, which contains the values ​​of these key performance indicators. Next, the system processes these vectors using the radial basis kernel function and trains a first-level classification model that can roughly classify defect cases into "performance issues" or "stability issues". After that, the system reduces the dimension of the first-level classification feature vector through principal component analysis, extracts the most important features, and uses a linear kernel function to train a second-level classification model that can subdivide defect cases into more specific categories such as "memory leaks" and "thread deadlocks". Through this series of steps, the system builds a detection model that can accurately identify and classify software performance defects.

[0121] In a feasible implementation manner, the model iteration update triggering event includes a manual sample adding event, and step S3000 may further include steps A3100 to A3300:

[0122] Step A3100: In response to a manual sample adding event, obtaining a defect case sample input by a user;

[0123] Step A3200: parsing the sample features and defect root cause classification multi-level labels of the defect case sample, wherein the defect root cause classification multi-level labels include a primary defect major category label and a secondary defect minor category label;

[0124] Step A3300: Iteratively train the defect detection model using the primary defect major category labels, the secondary defect minor category labels, and the sample features to obtain an updated defect detection model.

[0125] It should be noted that model iteration and update are crucial steps to ensure that the software performance defect detection model is continuously effective and accurate. In this embodiment, the system starts the update process by listening to model iteration and update trigger events, such as manually adding sample events. Manually adding sample events means that users can actively provide new defect cases to the system. These cases may come from the latest software testing or user feedback, which provide a fresh data source for the model.

[0126] When a manually added sample event occurs, the system first responds to the event and obtains the defect case samples entered by the user. These samples contain specific information about the defect, such as the environment in which the defect occurs, the behavior exhibited, and potential code problems. The system then parses the features of these samples and classifies the defect root causes into multi-level labels. The multi-level labels provide a detailed classification for each defect. The first-level label may indicate the main category of the defect, such as "performance bottleneck", while the second-level label describes the defect more specifically, such as "database connection timeout".

[0127] After parsing, the system uses these primary and secondary labels and sample features to iteratively train the defect detection model. In this way, the system continuously learns from new data and updates the model's predictive capabilities to adapt to new trends and changes in software performance defects. This iterative training process is key to the model's self-optimization and improved adaptability, ensuring the model's relevance and effectiveness in real-world applications.

[0128] In addition, it should be noted that another important aspect of model iteration is that it can improve the generalization and accuracy of the model. By continuously incorporating new samples and feedback, the model can identify a wider range of defect patterns and reduce false positives and negatives. In addition, the system can further adjust and optimize model parameters by analyzing the performance of the model in actual inspections, using loss functions to quantify prediction errors, and adjusting the model accordingly to minimize these errors.

[0129] For example, in a feasible implementation, the system may have acquired the ability to identify specific types of software defects through preliminary training. As the software project progresses and user feedback accumulates, new defect cases are continuously added to the system. By analyzing these new cases, the system updates its defect detection model, enabling it to identify previously unknown defect types or more accurately classify existing defects. In this way, the system can not only keep pace with software development, but also provide more accurate and reliable performance defect detection services, thereby significantly improving software quality and user satisfaction.

[0130] In a feasible implementation manner, the model iteration update triggering event includes a defect recognition detection event, and step S3000 may further include steps B3100 to B3400:

[0131] B3100: In response to a defect identification detection event, obtaining case information to be detected, wherein the case information to be detected includes a primary defect category label and a secondary defect category label;

[0132] B3200: Identify the detection case information by using the defect detection model to obtain a classification recognition result, wherein the classification recognition result includes a primary defect recognition label and a secondary defect recognition label;

[0133] B3300: quantifying a first error between the primary defect category label and the primary defect identification label, and a second error between the secondary defect category label and the secondary defect identification label based on a preset loss function;

[0134] B3400: Based on the first error and the second error, respectively adjust the model parameters of the defect detection model to obtain an updated defect detection model.

[0135] It should be noted that, in this embodiment, when a defect recognition detection event occurs, the system first responds to this event and obtains the case information to be detected. This information includes the first-level defect category label and the second-level defect category label, which provides a basis for subsequent recognition and error analysis.

[0136] The system uses the trained defect detection model to identify the acquired case information and obtains classification and recognition results, which include primary defect recognition labels and secondary defect recognition labels. These recognition labels are the output of the model to classify cases based on the learned features, and they are a direct reflection of the model performance.

[0137] To further improve the accuracy of the model, the system quantifies the first error between the primary defect category label and the primary defect identification label, and the second error between the secondary defect category label and the secondary defect identification label based on a preset loss function. The loss function is a mechanism for evaluating the difference between the model prediction and the actual results. By quantifying these errors, the system can clearly identify where the model is deficient.

[0138] The system then adjusts the model parameters of the defect detection model based on these errors in order to reduce future prediction errors. This process involves back propagation and gradient descent algorithms in machine learning, through which the system can gradually optimize the model parameters and improve the model's prediction accuracy.

[0139] In addition, it should be noted that through this iterative update process, the system can not only correct the deficiencies of the existing model, but also adapt to new defect patterns and changes, thereby maintaining the timeliness and accuracy of the model. This continuous self-optimization and adjustment mechanism is the key to ensuring the long-term effectiveness of the model.

[0140] Specifically, this embodiment performs iterative model updates in two ways. One is to manually add samples and enrich the data set. The user logs in to the platform and selects the corresponding classification label to enter the defect case. The more defect samples there are, the higher the feature richness is, and the classification accuracy of the model obtained by iterative training will be correspondingly higher. The second is to introduce a loss function during detection and recognition to improve the iterative optimization model. The user logs in to the platform, enters the code to be detected into the system for defect detection to obtain the classification result, and then uses the loss function to quantify the error. The initial value of the loss function weight of each defect classification is customized, and the guided learning ability of the loss function is subsequently used to provide the target direction for the training process, that is, to tell the model which predictions are wrong and how to adjust the weights and parameters. The parameters of the model are adjusted through optimization algorithms such as back propagation and gradient descent to minimize the loss function, thereby improving the prediction accuracy of the model. For the detection and classification of performance defects, the first-level classification label is the direction, and the second-level classification label is the crux point. Therefore, when the initial value of the loss function weight is defined, the weight of the first-level label is greater than the second-level label by default.

[0141] More specifically, in this embodiment, referring to Figure 7 ,When the model is trained to a certain level of recognition accuracy, the model can be ,encapsulated and directly introduced into the project to detect whether there are ,performance risks in the project.

[0142] In this embodiment, by extracting the key performance characteristics of the defect cases in the initial defect data set; generating a complete feature vector corresponding to the defect case based on the key performance characteristics of the defect case; training a first-level defect classification model based on the complete feature vector and a preset radial basis kernel function to obtain a first-level classification feature vector; performing feature differentiation dimensionality reduction processing on the first-level classification feature vector through principal component analysis to obtain a second-level classification feature vector; training a second-level defect classification model based on the second-level classification feature vector and a preset linear kernel function to obtain a defect detection model, through the above process, the constructed defect detection model is more accurate and efficient in identifying software performance defects. The beneficial effect of this process is to improve the automation level of defect detection, reduce manual intervention, and at the same time improve the speed and accuracy of detection, which helps to timely discover and fix potential performance problems in the early stages of software development, thereby improving the overall quality and performance of software products.

[0143] For example, in order to help understand the implementation process of the detection model construction and update method obtained by combining this embodiment with the above-mentioned embodiment 1, please refer to Figure 8 , Figure 8 A brief flowchart of a detection model construction and update method is provided, specifically:

[0144] The main implementation steps of the embodiment of the present invention include five parts: performance defect data set classification and calibration, defect classification model construction, new sample input, model iteration and update, and project code detection. After the first two steps are completed, the model is embedded in the visual software platform, and the next three steps are all completed on the platform.

[0145] The implementation process of this solution specifically includes: First, collect and organize historical performance defect cases. These cases come from actual software projects and may include but are not limited to user reports, test results, and records from the development process. The collection of cases must ensure that the performance of the software system in different scenarios is covered, so that subsequent models can effectively identify various performance defects. Detailed classification and calibration of the collected cases. This step involves classifying the cases into different categories, such as architectural issues, application logic errors, database performance bottlenecks, etc. (first-level classification), as well as more specific defect types, such as thread lock contention, memory leaks, concurrent processing errors, etc. (secondary classification).

[0146] Each case is classified by multi-person voting, and each case is assigned a primary classification label and a secondary classification label. The primary classification label is used to indicate the general direction of the defect, while the secondary classification label is used to accurately locate the specific performance problem. In this way, it can ensure that each case is accurately classified, providing high-quality data for subsequent feature extraction and model training.

[0147] Then, key performance features are extracted from the classified cases. These features may include code complexity, execution time, resource consumption, etc. Feature vectors are generated based on the extracted features. Each case corresponds to a multi-dimensional feature vector. The feature vectors are processed using the radial basis kernel function (RBF) and a first-level classification model is trained, which can roughly classify the cases into different categories. The feature vectors of the first-level classification are reduced in dimension by principal component analysis (PCA) to remove redundant information and retain key features.

[0148] Finally, the linear kernel function is used to train the secondary classification model of the feature vector after dimensionality reduction to obtain the final defect detection model. The trained defect detection model is integrated into a visual software platform, which allows users to submit code segments to be tested. Users can enter the code through the platform interface, and the system will automatically call the defect detection model to detect performance defects in the code. The platform also supports users to provide feedback on the detection results so that the system can further learn and optimize.

[0149] The system supports dynamic sample insertion and updating. Users can add new defect samples on the platform, which will be used to further train and optimize the model. When the model identifies new defects in actual applications or users submit new cases, the system will trigger model iteration and update. During the iteration and update process, the system will introduce a loss function to quantify the errors in model predictions and adjust model parameters based on these errors to improve the prediction accuracy of the model.

[0150] Through the above process, this solution implements an automated and iteratively updateable software performance defect detection system, which can effectively identify and classify software performance defects and improve the quality and stability of the software system.

[0151] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the detection model construction and update method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0152] Please refer to Fig. 9 The present application also provides a detection model construction and update device, the detection model construction and update device comprising:

[0153] A first construction module 91 is used to construct an initial defect data set according to pre-acquired performance defect cases;

[0154] A second construction module 92 is used to perform feature vector extraction and principal component analysis based on the initial defect data set to construct a defect detection model;

[0155] The updating module 93 is used to respond to the model iteration update triggering event and update the defect detection model according to the event type of the model iteration update triggering event to obtain a defect detection update model.

[0156] The detection model construction and update device provided by the present application adopts the detection model construction and update method in the above-mentioned embodiment, which can solve the technical problems of detection model construction and update. Compared with the prior art, the beneficial effects of the detection model construction and update device provided by the present application are the same as the beneficial effects of the detection model construction and update method provided by the above-mentioned embodiment, and the other technical features in the detection model construction and update device are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.

[0157] The present application provides a detection model construction and update device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the detection model construction and update method in the above-mentioned embodiment one.

[0158] Reference below Fig.10 , which shows a schematic diagram of the structure of a detection model construction and update device suitable for implementing the embodiment of the present application. The detection model construction and update device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.10 The detection model building and updating device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0159] like Fig.10 As shown, the detection model construction and update device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the detection model construction and update device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 can allow the detection model building and updating device to communicate wirelessly or wired with other devices to exchange data. Although the detection model building and updating device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have instead.

[0160] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0161] The detection model construction and update device provided in the present application adopts the detection model construction and update method in the above-mentioned embodiment. Compared with the prior art, the beneficial effects of the detection model construction and update device provided in the present application are the same as the beneficial effects of the detection model construction and update method provided in the above-mentioned embodiment, and other technical features in the detection model construction and update device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0162] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0163] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0164] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the detection model construction and updating method in the above-mentioned embodiment.

[0165] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0166] The above-mentioned computer-readable storage medium may be included in the detection model construction and update device; or it may exist independently without being assembled into the detection model construction and update device.

[0167] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0168] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0169] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0170] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned detection model construction and update method, and can solve the technical problems of detection model construction and update. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the detection model construction and update method provided in the above-mentioned embodiment, and will not be repeated here.

[0171] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned detection model construction and update method when executed by a processor.

[0172] The computer program product provided in this application can solve the technical problems of detection model construction and update. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as the beneficial effects of the detection model construction and update method provided in the above embodiment, which will not be repeated here.

[0173] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A detection model construction and updating method, characterized in that: The method comprises: Construct an initial defect dataset based on pre-acquired performance defect cases; Performing feature vector extraction and principal component analysis based on the initial defect data set to build a defect detection model; In response to a model iteration update triggering event, the defect detection model is updated according to the event type of the model iteration update triggering event to obtain a defect detection update model.

2. The method according to claim 1, characterized in that The step of constructing an initial defect data set based on the pre-acquired performance defect cases includes: Obtain pre-collected performance defect cases; Distribute the performance defect cases to the target user group according to the preset distribution scale for defect root cause calibration referendum; According to the result of the defect root cause calibration referendum, a multi-level label of defect root cause classification of the performance defect case is determined by a preset root cause calibration strategy to obtain an initial defect data set.

3. The method according to claim 2, characterized in that The step of determining the defect root cause classification multi-level labels of the performance defect case according to the result of the defect root cause calibration referendum with a preset root cause calibration strategy to obtain an initial defect data set includes: Determine the referendum probabilities of each label corresponding to the performance defect case in the result of the defect root cause calibration referendum; If the classification label corresponding to the maximum value of the referendum probabilities of each label is not unique, the preset distribution scale is expanded by the preset growth value and then the following steps are performed: Distribute the performance defect cases to the target user group according to the preset distribution scale for defect root cause identification referendum; If the classification label corresponding to the maximum value among the referendum probabilities of each label is unique, the classification label is determined as the defect root cause classification multi-level label of the performance defect case.

4. The method according to claim 2, characterized in that The step of performing feature vector extraction and principal component analysis based on the initial defect data set to construct a defect detection model includes: Extracting key performance characteristics of defect cases in the initial defect data set; Based on the key performance characteristics of the defect case, generating a complete feature vector corresponding to the defect case; Based on the complete feature vector and a preset radial basis kernel function, a defect primary classification model is trained to obtain a primary classification feature vector; Performing feature differentiation dimensionality reduction processing on the first-level classification feature vector through principal component analysis to obtain a second-level classification feature vector; A defect secondary classification model is trained based on the secondary classification feature vector and a preset linear kernel function to obtain a defect detection model.

5. The method according to claim 1, characterized in that The model iteration update triggering event includes a manual sample adding event, and the step of updating the defect detection model in response to the model iteration update triggering event according to the event type of the model iteration update triggering event to obtain the defect detection update model includes: In response to a manual sample adding event, obtaining a defect case sample input by a user; Analyze the sample characteristics and defect root cause classification multi-level labels of the defect case samples, wherein the defect root cause classification multi-level labels include a primary defect category label and a secondary defect category label; The defect detection model is iteratively trained through the first-level defect major category labels, the second-level defect minor category labels and the sample features to obtain a defect detection update model.

6. The method according to claim 1, characterized in that The model iteration update triggering event includes a defect recognition detection event, and the step of updating the defect detection model in response to the model iteration update triggering event according to the event type of the model iteration update triggering event to obtain the defect detection update model includes: In response to a defect identification detection event, obtaining case information to be detected, wherein the case information to be detected includes a primary defect category label and a secondary defect category label; Identify the detection case information through the defect detection model to obtain a classification recognition result, wherein the classification recognition result includes a primary defect recognition label and a secondary defect recognition label; Quantifying a first error between the primary defect category label and the primary defect identification label, and a second error between the secondary defect category label and the secondary defect identification label based on a preset loss function; Model parameters of the defect detection model are adjusted based on the first error and the second error respectively to obtain an updated defect detection model.

7. A detection model construction and updating device, characterized in that: The device comprises: A first building module is used to build an initial defect data set based on pre-acquired performance defect cases; A second building module is used to perform feature vector extraction and principal component analysis based on the initial defect data set to build a defect detection model; The updating module is used to respond to the model iteration update triggering event and update the defect detection model according to the event type of the model iteration update triggering event to obtain the defect detection update model.

8. A detection model construction and update device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the detection model construction and updating method according to any one of claims 1 to 6.

9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the detection model construction and updating method according to any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the detection model construction and updating method according to any one of claims 1 to 6 are implemented.