Training Method, Device, Equipment and Medium for Automobile Software Quality Evaluation Model

By building a quality evaluation model in the automotive field, using trained models and samples in the reference field to optimize the quality evaluation model in the automotive field, the problem of inaccurate traditional manual evaluation is solved, and the accuracy and automation of automotive software quality evaluation is achieved.

CN118643914BActive Publication Date: 2025-06-13CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410706969.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-03
Publication Date
2025-06-13
Estimated Expiration
2044-06-03

AI Technical Summary

Technical Problem

Traditional automotive software quality evaluation relies on manual subjective judgment, which leads to inaccurate evaluation results and is difficult to quantify and standardize.

Method used

By building a quality evaluation model in the automotive field, using trained models and samples from the reference field, combining cross-domain triple loss values ​​and model loss values, the quality evaluation model in the automotive field is optimized until the preset training stop conditions are met.

Benefits of technology

It realizes the accuracy and automation of automotive software quality evaluation, reduces the subjectivity of manual evaluation, and improves the consistency and reliability of evaluation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118643914B_ABST
    Figure CN118643914B_ABST
Patent Text Reader

Abstract

The present application relates to a training method, device, equipment, and storage medium for an automotive software quality assessment model. The method includes: when performing each training, obtaining a first quality assessment sample corresponding to a reference domain and a second quality assessment sample corresponding to the automotive domain; using the first quality assessment sample, the second quality assessment sample, and a first quality assessment model that has been trained and completed in the reference domain to train a newly constructed second quality assessment model in the automotive domain; when performing the current training, determining a cross-domain triplet loss value and a model loss value corresponding to the second quality assessment model, and optimizing the second quality assessment model according to the cross-domain triplet loss value and the model loss value until the second quality assessment model meets the training stop condition. Compared with the manual assessment method, using the second quality assessment model for the quality assessment of automotive software is more accurate, and it realizes the automated and standardized assessment of automotive software quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of automobiles, and particularly relates to a method, device, equipment, and medium for training an automobile software quality evaluation model. Background Art

[0002] In the rapidly developing automobile industry, automobile software has become a key driver of innovation and competitiveness. As the complexity of automobile software systems increases day by day, ensuring the quality of its code and interfaces has become crucial. Automobile software not only needs to meet functional requirements but also must ensure a high degree of reliability and safety. In this context, software quality evaluation has become a key link. Traditional software evaluation methods often rely on the subjective judgments of developers or reviewers. However, this way of evaluating software quality based on human subjectivity, that is, the way of manually evaluating software quality, is prone to the problem of inaccurate software quality evaluation results. The main reasons for this problem are as follows: There are significant differences in the intuitions and experiences of different people, making it difficult to quantify and standardize the process of software quality evaluation. Moreover, it is difficult to ensure the consistency and reliability of the software quality evaluation results given by different people. Summary of the Invention

[0003] This application provides a method, device, equipment, and medium for training an automobile software quality evaluation model to solve the problem of inaccurate software quality evaluation results that are prone to occur when evaluating software quality based on human subjectivity.

[0004] In view of the above technical problems, the technical solutions of this application are solved through the following embodiments:

[0005] An embodiment of this application provides a method for training an automobile software quality evaluation model, including: when performing each training, obtaining a first quality evaluation sample corresponding to a reference field and a second quality evaluation sample corresponding to the automobile field; using the first quality evaluation sample, the second quality evaluation sample, and a first quality evaluation model that has been trained and completed in the reference field to train a newly constructed second quality evaluation model in the automobile field; where, when performing this training, determining a cross-domain triple loss value and a model loss value corresponding to the second quality evaluation model, and optimizing the second quality evaluation model according to the cross-domain triple loss value and the model loss value until the second quality evaluation model meets a preset training stop condition.

[0006] Among them, the first quality assessment sample and the second quality assessment sample correspond to the same multiple assessment users and the same multiple common software; in terms of structure, both the first quality assessment sample and the second quality assessment sample are software quality scoring matrices; among them, the rows in the software quality scoring matrix correspond one-to-one with the assessment users, and the columns correspond one-to-one with the common software; alternatively, the rows in the software quality scoring matrix correspond one-to-one with the common software, and the columns correspond one-to-one with the assessment users; the element values in the software quality scoring matrix represent software quality scores.

[0007] Among them, training the newly constructed second quality assessment model in the automotive field by using the first quality assessment sample, the second quality assessment sample, and the first quality assessment model that has been trained and completed in the reference field includes: the first quality assessment model generates first intermediate data according to the first quality assessment sample and predicts first scoring data according to the first intermediate data; the second quality assessment model generates second intermediate data according to the second quality assessment sample and predicts second scoring data according to the second intermediate data; determining the cross-domain triple loss value according to the first intermediate data and the second intermediate data, and determining the model loss value of the second quality assessment model according to the second quality assessment sample, the second intermediate data, and the second scoring data.

[0008] Among them, the first quality evaluation model generates first intermediate data according to the first quality evaluation samples, including: the first quality evaluation model generates first user query embeddings corresponding to the multiple evaluation users and first software query embeddings corresponding to the multiple common software according to the first quality evaluation samples; the second quality evaluation model generates second intermediate data according to the second quality evaluation samples, including: the second quality evaluation model generates second user query embeddings corresponding to the multiple evaluation users and second software query embeddings corresponding to the multiple common software according to the second quality evaluation samples; determining the cross-domain triple loss value according to the first intermediate data and the second intermediate data includes: for each of the first user query embeddings, selecting one of the first software query embeddings as a positive sample, selecting one of the first software query embeddings as a negative sample and selecting one of the second software query embeddings as a negative sample; determining a first triple loss value among the first user query embedding, the positive sample and the two negative samples; calculating the sum of the first triple loss values corresponding to each of the first user query embeddings as the first triple loss value corresponding to the reference domain; for each of the second user query embeddings, selecting one of the second software query embeddings as a positive sample, selecting one of the second software query embeddings as a negative sample and selecting one of the first software query embeddings as a negative sample; determining a second triple loss value among the second user query embedding, the positive sample and the two negative samples; calculating the sum of the second triple loss values corresponding to each of the second user query embeddings as the second triple loss value corresponding to the automotive domain; taking the sum of the first triple loss value and the second triple loss as the cross-domain triple loss value.

[0009] Among them, determining the model loss value of the second quality evaluation model according to the second quality evaluation samples, the second intermediate data and the second scoring data includes: using the following regularized cross-entropy loss function to calculate the model loss value:

[0010]

[0011]

[0012] Among them, represents the model loss value; y represents the software quality score in the second quality evaluation sample; represents the software quality score at the corresponding position in the second scoring data; Y represents all software quality scores in the quality evaluation sample; λ represents a preset regularization coefficient; Θ represents the regularization term of the second user query embedding and the second software query embedding corresponding to y; denotes the 2-norm function; max(R) represents the maximum software quality score among the second quality assessment samples.

[0013] Among them, the following first scale-invariant loss function is adopted to calculate the first triplet loss value:

[0014]

[0015]

[0016] Among them, denotes the triplet loss value corresponding to the reference domain; denotes the i-th first user query embedding of the reference domain; denotes the first software query embedding of the reference domain as a positive sample; denotes the second software query embedding of the automotive domain as a negative sample; denotes the first software query embedding of the reference domain as a negative sample; α 2 and β 2 are hyperparameters; the superscript T represents transpose;

[0017] The following second scale-invariant loss function is adopted to calculate the second triplet loss value:

[0018]

[0019] Among them, denotes the triplet loss value corresponding to the automotive domain; denotes the i-th second user query embedding of the automotive domain; denotes the second software query embedding of the automotive domain as a positive sample; denotes the first software query embedding of the reference domain as a negative sample; denotes the second software query embedding of the automotive domain as a negative sample.

[0020] Among them, after the second quality assessment model satisfies the training stop condition, it further includes: obtaining the software source code corresponding to the software to be evaluated; inputting the software source code into the second quality assessment model and obtaining the software quality score corresponding to the software to be evaluated output by the second assessment model.

[0021] An embodiment of the present application also provides a training device for an automotive software quality assessment model, comprising: an acquisition module, used to acquire a first quality assessment sample corresponding to a reference field and a second quality assessment sample corresponding to an automotive field when performing each training; a training module, used to train a newly constructed second quality assessment model in the automotive field using the first quality assessment sample, the second quality assessment sample and the first quality assessment model that has been trained in the reference field; wherein, when performing this training, a cross-domain triplet loss value and a model loss value corresponding to the second quality assessment model are determined, and the second quality assessment model is optimized based on the cross-domain triplet loss value and the model loss value until the second quality assessment model meets a preset training stop condition.

[0022] An embodiment of the present application also provides a training device for an automobile software quality assessment model, comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the processor is configured to: execute a training program for the automobile software quality assessment model stored in the memory to implement the training method for the automobile software quality assessment model described in any one of the above items.

[0023] An embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are executed to implement the training method of the automotive software quality assessment model described in any one of the above items.

[0024] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application can obtain the first quality assessment sample corresponding to the reference field and the second quality assessment sample corresponding to the automotive field when performing each training; the first quality assessment sample, the second quality assessment sample and the first quality assessment model that has been trained in the reference field are used to train the newly constructed second quality assessment model in the automotive field; wherein, when performing this training, the cross-domain triplet loss value and the model loss value corresponding to the second quality assessment model are determined, and the second quality assessment model is optimized according to the cross-domain triplet loss value and the model loss value until the second quality assessment model meets the preset training stop condition. The embodiment of the present application uses samples in the automotive field, with the help of relatively rich samples in the reference field and a mature first quality assessment model, to train the second quality assessment model and optimize the assessment accuracy of the second quality assessment model. Compared with the manual assessment method, the quality assessment of automotive software using the second quality assessment model is more accurate, and the automated assessment and standardized assessment of automotive software quality are realized. Brief Description of the Drawings

[0025] The accompanying drawings herein are incorporated into and constitute a part of this specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.

[0026] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the accompanying drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0027] One or more embodiments are exemplarily illustrated by the pictures in the corresponding accompanying drawings. These exemplary illustrations do not constitute limitations on the embodiments. Elements with the same first numerical label in the drawings are represented as similar elements, unless otherwise stated, the drawings in the figures do not constitute a scale limitation.

[0028] Figure 1 It is a flowchart of a method for training an automotive software quality assessment model according to an embodiment of the present application;

[0029] Figure 2 It is a structural diagram of a cross - domain analysis framework according to an embodiment of the present application;

[0030] Figure 3 It is a flowchart of steps for training a second quality assessment model according to an embodiment of the present application;

[0031] Figure 4 It is a structural diagram of an apparatus for training an automotive software quality assessment model according to an embodiment of the present application;

[0032] Figure 5 It is a structural diagram of a device for training an automotive software quality assessment model according to an embodiment of the present application. Detailed Description of the Embodiments

[0033] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present application.

[0034] The following disclosure provides many different embodiments or examples for implementing different structures of the present application. To simplify the disclosure of the present application, the components and settings of specific examples are described below. Of course, they are only examples and are not intended to limit the present application. In addition, the present application may repeat the first digit and / or letter in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0035] An embodiment of the present application provides a method for training an automotive software quality assessment model.

[0036] In the embodiment of the present application, aiming at the problem that the subjective evaluation of software quality, that is, the manual evaluation of software quality, is prone to inaccurate software quality evaluation results, a training method for an automotive software quality assessment model based on a cross-domain analysis framework is proposed, thereby providing a new perspective for improving software quality assessment performance.

[0037] The cross-domain analysis framework of the embodiment of the present application uses data and knowledge obtained from other reference domains (such as mature software projects) to improve the quality evaluation results of the target domain (such as the automotive domain), that is, to perform cross-domain transfer of knowledge (Cross Domain Transfer, abbreviated as CDT). Especially in the case of sparse data or inconsistent quality evaluation criteria, the cross-domain analysis framework can transfer knowledge from a data-rich reference domain to a data-sparse target domain to make up for this gap. This method not only improves the evaluation efficiency, but also, due to its data-driven and algorithmic model, can provide more objective and consistent quality evaluation results compared with the method of manually evaluating software quality.

[0038] The following will describe in detail the method for training an automotive software quality assessment model. As Figure 1 shown, it is a flowchart of the method for training an automotive software quality assessment model according to an embodiment of the present application.

[0039] Step S110, when performing each training, obtain a first quality assessment sample corresponding to the reference domain and a second quality assessment sample corresponding to the automotive domain.

[0040] The reference domain refers to a domain where quality assessment has been mature.

[0041] The automotive domain refers to the target domain of the cross-domain analysis framework. The reference domain and the automotive domain can be different domains or similar domains.

[0042] The first quality evaluation sample includes: the software quality scores corresponding to the reference domain for the common software in the reference domain and the automotive domain. The common software refers to the same software that can be applied in both the reference domain and the automotive domain. Among them, the software quality scores in the first quality evaluation sample are the quality scores evaluated by the evaluation user for the common software according to the preset quality evaluation criteria of the reference domain.

[0043] The second quality evaluation sample includes: the software quality score data corresponding to the automotive domain for the common software in the reference domain and the automotive domain. Among them, the software quality scores in the second quality evaluation sample are the quality scores evaluated by the evaluation user for the common software according to the preset quality evaluation criteria of the automotive domain.

[0044] Specifically, a training sample set is preset. The training sample set includes: multiple groups of training samples. Each group of training samples includes: the first quality evaluation sample corresponding to the reference domain and the second quality evaluation sample corresponding to the automotive domain. In each group of training samples, the first quality evaluation sample and the second quality evaluation sample correspond to the same evaluation user and the same common software. When performing each training, a group of training samples is obtained from the training sample set.

[0045] Step S120, using the first quality evaluation sample, the second quality evaluation sample, and the first quality evaluation model that has been trained and completed in the reference domain, train the newly constructed second quality evaluation model in the automotive domain.

[0046] The first quality evaluation model is used to evaluate the software quality scores of the reference domain. The first quality evaluation model has been trained using the data of the reference domain and has completed training.

[0047] The second quality evaluation model is used to evaluate the software quality scores of the automotive domain. The second quality evaluation model has not been trained yet.

[0048] In the embodiments of the present application, based on the cross-domain analysis framework, using the first quality evaluation sample, the second quality evaluation sample, and the first quality evaluation model that has been trained and completed in the reference domain, train the newly constructed second quality evaluation model in the automotive domain, and, in the process of training the second quality evaluation model each time, optimize the parameters in the second quality evaluation model to improve the software quality evaluation effect of the second quality evaluation model.

[0049] Step S130, when performing this training, determine the cross-domain triple loss value and the model loss value corresponding to the second quality evaluation model, and optimize the second quality evaluation model according to the cross-domain triple loss value and the model loss value until the second quality evaluation model meets the preset training stop condition.

[0050] The model loss value is used to measure the loss between the input and output of the second quality evaluation model. Among them, the lower the model loss value, the more accurate the software quality evaluation result given by the second quality evaluation model.

[0051] The cross-domain triple loss value is used to measure the degree of constraint among the data corresponding to the evaluation user, the data corresponding to the positive sample, and the data corresponding to the negative sample. Among them, the evaluation user refers to the evaluation user jointly corresponding to the first quality evaluation sample and the second quality evaluation sample. The positive sample refers to the common software whose average software quality score is greater than the score threshold. The negative sample refers to the common software whose average software quality score is less than or equal to the score threshold. The lower the cross-domain triple loss value, the closer the distance between the evaluation user and the positive sample, the farther the distance between the evaluation user and the negative sample, and the farther the distance between the positive sample and the negative sample.

[0052] In the embodiment of the present application, calculate the loss sum value of the model loss value and the cross-domain triple loss value; determine whether the second quality evaluation model meets the training stop condition according to the loss sum value; if so, determine that the second quality evaluation model has converged, otherwise, adjust the parameters in the second quality evaluation model to optimize the second quality evaluation model, and then jump to step S110 to start the next training for the second quality evaluation model.

[0053] For example: the training stop condition includes: if the loss sum value is less than the preset loss threshold, and the loss sum values for a preset number of consecutive training times are all less than the loss threshold, then determine that the second quality evaluation model meets the training stop condition, otherwise, determine that the second quality evaluation model does not meet the training stop condition. Among them, the loss threshold is an empirical value or a value obtained through experiments.

[0054] In the embodiment of the present application, after the second quality evaluation model meets the training stop condition, the second quality evaluation model can be applied to the software quality evaluation in the automotive field. Specifically, the software source code corresponding to the software to be evaluated can be obtained; the software source code is input into the second quality evaluation model and the quality score corresponding to the software to be evaluated output by the second evaluation model is obtained.

[0055] In the embodiments of the present application, when each training is executed, a first quality evaluation sample corresponding to a reference domain and a second quality evaluation sample corresponding to the automotive domain are obtained; the newly constructed second quality evaluation model in the automotive domain is trained by using the first quality evaluation sample, the second quality evaluation sample, and the first quality evaluation model that has been trained and completed in the reference domain; wherein, when this training is executed, a cross-domain triple loss value and a model loss value corresponding to the second quality evaluation model are determined, and the second quality evaluation model is optimized according to the cross-domain triple loss value and the model loss value until the second quality evaluation model meets the preset training stop condition. The embodiments of the present application utilize the samples in the automotive domain, with the help of the relatively rich samples in the reference domain and the mature first quality evaluation model, to train the second quality evaluation model and optimize the evaluation accuracy of the second quality evaluation model. Compared with the manual evaluation method, using the second quality evaluation model for the quality evaluation of automotive software is more accurate, and it realizes the automated and standardized evaluation of automotive software quality, shortens the time for software quality evaluation, improves the efficiency of software quality evaluation, and the software quality evaluation results are more objective.

[0056] The cross-domain analysis framework of the embodiments of the present application establishes connections between different domains by deeply analyzing the characteristics of users and software in different domains, so as to achieve more accurate and personalized software quality evaluation. Especially in the field of software testing, the cross-domain analysis framework of the embodiments of the present application can significantly improve the accuracy and reliability of the evaluation results of the code and interface quality of automotive software through detailed data analysis. Therefore, the embodiments of the present application effectively apply the cross-domain analysis framework based on contrastive learning to the quality evaluation of automotive software, which has important theoretical significance and provides important guidance for the actual application field.

[0057] The embodiments of the present application can quickly and effectively evaluate the quality of the code and interface of automotive software by migrating knowledge from other domains through the cross-domain analysis framework. Especially in the case of sparse data or inconsistent quality evaluation criteria, it can significantly reduce the time and resources required for evaluation. Moreover, by deeply analyzing the characteristics of users or projects in different reference domains and establishing connections between domains, the second quality evaluation model can achieve more accurate and personalized evaluation, which has a significant effect on improving the code and interface quality of automotive software.

[0058] To make the embodiments of the present application easier to understand, the embodiments of the present application will be further described below.

[0059] In the embodiments of the present application, for each group of training samples in the training sample set, in the first quality evaluation sample and the second quality evaluation sample, the number of common software can be multiple, the number of evaluating users can be multiple, and, the multiple common software are the same, and the multiple evaluating users are the same.

[0060] Specifically, the first quality evaluation sample includes: for each common software in the reference field and the automotive field, the software quality scores corresponding to the common software in the reference field respectively evaluated by each evaluating user. The second quality evaluation sample includes: for each common software in the reference field and the automotive field, the software quality scores corresponding to the common software in the automotive field respectively evaluated by each evaluating user. In order to better guide knowledge transfer, in each group of training samples in the training sample set, the first quality evaluation sample and the second quality evaluation sample correspond to the same multiple evaluating users and the same multiple common software.

[0061] Furthermore, in terms of structure, both the first quality evaluation sample and the second quality evaluation sample are software quality score matrices; wherein, the rows in the software quality score matrix correspond one-to-one with the evaluating users, and the columns correspond one-to-one with the common software; or, the rows in the software quality score matrix correspond one-to-one with the common software, and the columns correspond one-to-one with the evaluating users; the element values in the software quality score matrix represent software quality scores. The software quality score is used to measure the quality of the code and interfaces corresponding to the software.

[0062] For example: if the number of evaluating users is 3 and the number of common software is 4, a 3×4 software quality score matrix can be generated. Each of the 3 rows in the software quality score matrix corresponds to an evaluating user, each of the 4 columns corresponds to a common software, and each element represents the software quality score given by the evaluating user corresponding to its row to the common software corresponding to its column.

[0063] In the embodiments of the present application, based on the cross-domain analysis framework, the second quality evaluation model newly constructed in the automotive field is trained by using the first quality evaluation sample, the second quality evaluation sample, and the first quality evaluation model that has been trained and completed in the reference field.

[0064] In the embodiments of the present application, as Figure 2 shown, it is a structural diagram of a cross-domain analysis framework according to an embodiment of the present application. In this cross-domain analysis framework, it includes: a first quality evaluation model, a second quality evaluation model, and a cross-domain metric learning module. Among them, the cross-domain metric learning module is respectively connected to the first quality evaluation model and the second quality evaluation model.

[0065] The first quality evaluation model includes: a first encoder and a first predictor that are connected to each other.

[0066] The second quality evaluation model includes: a second encoder and a second predictor that are interconnected.

[0067] When performing this training, the cross-domain metric learning module determines the model loss value of the second quality evaluation model and respectively determines the first triplet loss value corresponding to the reference domain and the second triplet loss value corresponding to the automotive domain; wherein, the sum of the first triplet loss value and the second triplet loss value is used as the cross-domain triplet loss value.

[0068] Next, in combination with this cross-domain analysis framework, the training process of the second quality evaluation model will be further described.

[0069] As Figure 3 shown, it is a flowchart of the steps for training the second quality evaluation model according to an embodiment of the present application.

[0070] Step S310, the first quality evaluation model generates first intermediate data according to the first quality evaluation samples and predicts first scoring data according to the first intermediate data.

[0071] The first quality evaluation model generates first user query embeddings corresponding to the multiple evaluation users respectively and first software query embeddings corresponding to the multiple common software respectively according to the first quality evaluation samples, and predicts first scoring data according to the first user query embeddings corresponding to the multiple evaluation users respectively and the first software query embeddings corresponding to the multiple common software respectively. The first scoring data is the predicted values of the software quality scores corresponding to the multiple common software respectively. Among them, the dimension of the first scoring data may be consistent with the first quality evaluation samples.

[0072] Further, the first encoder generates first user feature vectors corresponding to the multiple evaluation users respectively and first software feature vectors corresponding to the multiple common software respectively according to the first quality evaluation samples, generates a first user query embedding according to each first user feature vector, and generates a first software query embedding according to each first software feature vector. The first predictor predicts the first scoring data according to the first user query embeddings corresponding to the multiple evaluation users respectively and the first software query embeddings corresponding to the multiple common software respectively.

[0073] For example: The first encoder can use the following formula to generate the first user query embedding and the first software query embedding:

[0074]

[0075]

[0076] Among them, represents the i-th first user query embedding, Denote the i-th first software query embedding, Denote the i-th first user feature vector, Denote the i-th first software feature vector, W u and W v both denote weight matrices; b u and b v both denote bias terms; σ is the sigmoid activation function.

[0077] Embeddings are usually low-dimensional dense vectors, with dimensions much smaller than those of the original feature space. Through training, the weight and bias parameters learned by the encoder map the potentially scattered and discontinuous data points in the original feature space to a new embedding space, where similar users or software are mapped to nearby points, thus becoming query embeddings (also known as: pre-query embeddings).

[0078] Furthermore, the types of the first encoder include but are not limited to: Doc2Vec text encoder, Node2Vec graph network encoder. The types of the first predictor include but are not limited to: MLP (Multilayer Perceptron, fully connected neural network) predictor.

[0079] Step S320, the second quality assessment model generates second intermediate data according to the second quality assessment samples and predicts second scoring data according to the second intermediate data.

[0080] The second quality assessment model generates second user query embeddings corresponding to the multiple evaluation users and second software query embeddings corresponding to the multiple common software according to the second quality assessment samples, and predicts second scoring data according to the second user query embeddings corresponding to the multiple evaluation users and the second software query embeddings corresponding to the multiple common software. The second scoring data are the predicted values of the software quality scores of the multiple common software. Among them, the dimension of the second scoring data can be the same as that of the second quality assessment samples, that is: the number of rows and columns is the same, and the corresponding data in the rows and columns are the same.

[0081] Furthermore, the second encoder generates second user feature vectors corresponding to the multiple evaluation users and second software feature vectors corresponding to the multiple common software according to the first quality assessment samples, generates second user query embeddings according to each second user feature vector, and generates second software query embeddings according to each second software feature vector. The second predictor predicts second scoring data according to the second user query embeddings corresponding to the multiple evaluation users and the second software query embeddings corresponding to the multiple common software.

[0082] For example: The second encoder can use the following formula to generate second user query embeddings and second software query embeddings:

[0083]

[0084]

[0085] Among them, represents the i-th second user query embedding, represents the i-th second software query embedding, represents the i-th second user feature vector, represents the i-th second software feature vector, W u and W v both represent weight matrices; b u and b v both represent bias terms; σ is the sigmoid activation function.

[0086] Furthermore, the type of the second encoder is the same as that of the first encoder, and the type of the second predictor is the same as that of the first predictor.

[0087] Step S330, the cross-domain metric learning module determines the cross-domain triplet loss value according to the first intermediate data and the second intermediate data, and determines the model loss value of the second quality evaluation model according to the second quality evaluation sample, the second intermediate data, and the second scoring data.

[0088] The cross-domain metric learning module uses the common evaluation users and common software in the two domains as a bridge, and simultaneously collects the respective effective information of the two domains, such as software quality scores, and uses this effective information to enhance the quality evaluation effect of the code and interfaces.

[0089] In the embodiments of the present application, the sum value of the first triplet loss value and the second triplet loss can be used as the cross-domain triplet loss value.

[0090] The process of determining the first triplet loss value is described below:

[0091] For each of the first user query embeddings, select one first software query embedding as the positive sample, select one first software query embedding as the negative sample, and select one second software query embedding as the negative sample; determine the first triplet loss value among the first user query embedding, the positive sample, and the two negative samples; calculate the sum value of the first triplet loss values respectively corresponding to each of the first user query embeddings as the first triplet loss value corresponding to the reference domain.

[0092] Further, positive and negative samples can be selected in a random selection manner. It is also possible to determine the average value of the software quality scores corresponding to each of the first software query embeddings in the first quality assessment sample; among the first software query embeddings with an average value greater than the preset score threshold, positive samples are selected, and among the first software query embeddings with an average value less than or equal to the score threshold, negative samples are selected; in the second quality assessment sample, determine the average value of the software quality scores corresponding to each of the second software query embeddings; among the second software query embeddings with an average value less than or equal to the score threshold, negative samples are selected.

[0093] For example: For the columns corresponding to the common software in the first quality assessment sample, calculate the average value of each column of elements; determine the columns with an average value greater than the score threshold, and select positive samples from the first software query embeddings of the common software corresponding to these columns; determine the columns with an average value less than or equal to the score threshold, and select negative samples from the first software query embeddings of the common software corresponding to these columns.

[0094] In the embodiments of the present application, using a scale-invariant loss function, according to the first intermediate data and the second intermediate data, determine the cross-domain triplet loss value. The first intermediate data includes: a first user query embedding and a first software query embedding. The second intermediate data includes: a second user query embedding and a second software query embedding.

[0095] For example: Adopt the following first scale-invariant loss function to calculate the first triplet loss value:

[0096]

[0097] Among them, represents the triplet loss value corresponding to the reference domain; represents the i-th first user query embedding in the reference domain; represents the first software query embedding in the reference domain as a positive sample; represents the second software query embedding in the automotive domain as a negative sample; represents the first software query embedding in the reference domain as a negative sample; α 2 and β 2 are hyperparameters; the superscript T represents transpose. u a represents all first user query embeddings. log represents the logarithmic function with base 10. exp represents the exponential function with base e. After starting to train the second quality assessment model, the hyperparameters need to be initialized.

[0098] Referring to the calculation method of the first triplet loss value, the process of determining the second triplet loss value is described below:

[0099] For each of the second user query embeddings, select one of the second software query embeddings as the positive sample, select one of the second software query embeddings as the negative sample, and select one of the first software query embeddings as the negative sample; determine the second triplet loss value between the second user query embedding, the positive sample, and the two negative samples; calculate the sum of the second triplet loss values corresponding to each of the second user query embeddings as the second triplet loss value corresponding to the automotive domain.

[0100] Further, a random selection method can be used to select the positive and negative samples. It is also possible to determine the average value of the software quality scores corresponding to each of the second software query embeddings in the second quality assessment sample; select the positive sample from the second software query embeddings whose average value is greater than the preset score threshold, and select the negative sample from the second software query embeddings whose average value is less than or equal to the score threshold. In the first quality assessment sample, determine the average value of the software quality scores corresponding to each of the first software query embeddings; select the negative sample from the first software query embeddings whose average value is less than or equal to the score threshold.

[0101] When calculating the second triplet loss value using the scale-invariant loss function, for example: use the following second scale-invariant loss function to calculate the second triplet loss value:

[0102]

[0103] where represents the triplet loss value corresponding to the automotive domain; represents the i-th second user query embedding in the automotive domain; represents the second software query embedding as the positive sample in the automotive domain; represents the first software query embedding as the negative sample in the reference domain; represents the second software query embedding as the negative sample in the automotive domain. u b represents all second user query embeddings. Similar to the first scale-invariant loss function, α 2 and β 2 are hyperparameters; the superscript T represents transpose; log represents the logarithmic function with base 10; exp represents the exponential function with base e.

[0104] In the embodiments of the present application, using the regularized cross-entropy loss function, according to the second quality assessment sample, the second intermediate data, and the second scoring data, determine the model loss value of the second quality assessment model.

[0105] For example: use the following regularized cross-entropy loss function to calculate the model loss value:

[0106]

[0107]

[0108] Among them, represents the model loss value; y represents the software quality score in the second quality assessment sample; represents the software quality score at the corresponding position in the second score data; Y represents all software quality scores in the quality assessment sample; λ represents a preset regularization coefficient; Θ represents the regularization term of the second user query embedding and the second software query embedding corresponding to y; represents the 2-norm function; max(R) represents the maximum software quality score in the second quality assessment sample.

[0109] In the embodiments of the present application, when calculating the triplet loss value, not only the constraint relationship between the data of the evaluation user and the data of the positive sample, and the constraint relationship between the data of the evaluation user and the data of the negative sample are considered, but also the constraint relationship between the data of the positive sample and the data of the negative sample is considered. Because, if only the relationship between the evaluation user and the software is considered and the relationship between the software and the software is ignored, the data of the negative sample may be dragged towards the data of the positive sample, which is contrary to the basic assumption of metric learning.

[0110] The embodiments of the present application also provide a training device for an automotive software quality assessment model. As Figure 4 shown, it is a structural diagram of a training device for an automotive software quality assessment model according to an embodiment of the present application.

[0111] The training device for the automotive software quality assessment model includes:

[0112] An acquisition module 410, configured to obtain a first quality assessment sample corresponding to a reference domain and a second quality assessment sample corresponding to an automotive domain during each training.

[0113] A training module 420, configured to train a newly constructed second quality assessment model in the automotive domain by using the first quality assessment sample, the second quality assessment sample, and a first quality assessment model that has been trained in the reference domain; wherein, during this training, a cross-domain triplet loss value and a model loss value corresponding to the second quality assessment model are determined, and the second quality assessment model is optimized according to the cross-domain triplet loss value and the model loss value until the second quality assessment model meets a preset training stop condition.

[0114] The functions of the device described in the embodiments of the present application have been described in the above method embodiments. Therefore, for the details not described in this embodiment, reference may be made to the relevant descriptions in the foregoing embodiments, which will not be elaborated here.

[0115] The embodiments of the present application also provide a training device for an automotive software quality assessment model, as Figure 5 shown, which is a structural diagram of a training device for an automotive software quality assessment model according to an embodiment of the present application.

[0116] The training device for the automotive software quality assessment model includes: a processor 510, a communication interface 520, a memory 530, and a communication bus 540. Among them, the processor 510, the communication interface 520, and the memory 530 complete communication with each other through the communication bus 540.

[0117] The memory 530 is used to store a computer program.

[0118] In an embodiment of the present application, when the processor 510 is used to execute the program stored on the memory 530, it implements the training method of the automotive software quality assessment model provided in any of the foregoing method embodiments, including: when performing each training, obtaining a first quality assessment sample corresponding to a reference domain and a second quality assessment sample corresponding to the automotive domain; using the first quality assessment sample, the second quality assessment sample, and a first quality assessment model that has been trained in the reference domain to train a newly constructed second quality assessment model in the automotive domain; wherein, when performing this training, determining a cross-domain triplet loss value and a model loss value corresponding to the second quality assessment model, and optimizing the second quality assessment model according to the cross-domain triplet loss value and the model loss value until the second quality assessment model meets a preset training stop condition.

[0119] Among them, the first quality assessment sample and the second quality assessment sample correspond to the same multiple evaluation users and the same multiple common software; in terms of structure, both the first quality assessment sample and the second quality assessment sample are software quality scoring matrices; wherein, the rows in the software quality scoring matrix correspond one-to-one with the evaluation users, and the columns correspond one-to-one with the common software; or, the rows in the software quality scoring matrix correspond one-to-one with the common software, and the columns correspond one-to-one with the evaluation users; the element values in the software quality scoring matrix represent software quality scores.

[0120] Among them, training the newly constructed second quality evaluation model in the automotive field by using the first quality evaluation sample, the second quality evaluation sample, and the first quality evaluation model that has been trained in the reference field includes: the first quality evaluation model generates first intermediate data according to the first quality evaluation sample and predicts first scoring data according to the first intermediate data; the second quality evaluation model generates second intermediate data according to the second quality evaluation sample and predicts second scoring data according to the second intermediate data; determining the cross-domain triple loss value according to the first intermediate data and the second intermediate data, and determining the model loss value of the second quality evaluation model according to the second quality evaluation sample, the second intermediate data, and the second scoring data.

[0121] Among them, the first quality evaluation model generating first intermediate data according to the first quality evaluation sample includes: the first quality evaluation model generates first user query embeddings corresponding to the multiple evaluation users respectively and first software query embeddings corresponding to the multiple common software respectively according to the first quality evaluation sample; the second quality evaluation model generating second intermediate data according to the second quality evaluation sample includes: the second quality evaluation model generates second user query embeddings corresponding to the multiple evaluation users respectively and second software query embeddings corresponding to the multiple common software respectively according to the second quality evaluation sample; determining the cross-domain triple loss value according to the first intermediate data and the second intermediate data includes: for each of the first user query embeddings, selecting one of the first software query embeddings as a positive sample, selecting one of the first software query embeddings as a negative sample, and selecting one of the second software query embeddings as a negative sample; determining the first triple loss value among the first user query embedding, the positive sample, and the two negative samples; calculating the sum of the first triple loss values corresponding to each of the first user query embeddings as the first triple loss value corresponding to the reference field; for each of the second user query embeddings, selecting one of the second software query embeddings as a positive sample, selecting one of the second software query embeddings as a negative sample, and selecting one of the first software query embeddings as a negative sample; determining the second triple loss value among the second user query embedding, the positive sample, and the two negative samples; calculating the sum of the second triple loss values corresponding to each of the second user query embeddings as the second triple loss value corresponding to the automotive field; taking the sum of the first triple loss value and the second triple loss as the cross-domain triple loss value.

[0122] Among them, determining the model loss value of the second quality evaluation model according to the second quality evaluation sample, the second intermediate data, and the second scoring data includes: calculating the model loss value by using the following regularized cross-entropy loss function:

[0123]

[0124]

[0125] Among them, represents the model loss value; y represents the software quality score in the second quality evaluation sample; represents the software quality score at the corresponding position in the second scoring data; Y represents all software quality scores in the quality evaluation sample; λ represents a preset regularization coefficient; Θ represents the regularization term of the second user query embedding and the second software query embedding corresponding to y; represents the 2-norm function; max(R) represents the maximum software quality score in the second quality evaluation sample.

[0126] Among them, calculate the first triplet loss value by using the following first scale-invariant loss function:

[0127]

[0128] Among them, represents the triplet loss value corresponding to the reference domain; represents the i-th first user query embedding of the reference domain; represents the first software query embedding of the reference domain as a positive sample; represents the second software query embedding of the automotive domain as a negative sample; represents the first software query embedding of the reference domain as a negative sample; α 2 and β 2 are hyperparameters; the superscript T represents transpose;

[0129] Calculate the second triplet loss value by using the following second scale-invariant loss function:

[0130]

[0131] Among them, represents the triplet loss value corresponding to the automotive domain; represents the i-th second user query embedding of the automotive domain; represents the second software query embedding of the automotive domain as a positive sample; represents the first software query embedding of the reference domain as a negative sample; Indicating the second software query embedding that is a negative sample in the field of the vehicle.

[0132] Wherein, after the second quality evaluation model satisfies the training stop condition, it further includes: obtaining the software source code corresponding to the software to be evaluated; inputting the software source code into the second quality evaluation model and obtaining the software quality score corresponding to the software to be evaluated output by the second evaluation model.

[0133] The embodiments of the present application further provide a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the training method of the vehicle software quality evaluation model provided in any one of the foregoing method embodiments are implemented. Since the training method of the vehicle software quality evaluation model has been described in detail above, for the parts not elaborated in the description of this embodiment, reference can be made to the relevant descriptions in the foregoing embodiments and will not be repeated here.

[0134] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0135] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the essence of the above technical solution or the part that contributes to the related technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disc, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0136] It should be understood that the terms used herein are for the purpose of describing particular example embodiments only and are not intended to be limiting. Unless the context clearly dictates otherwise, the singular forms "a", "an", and "the" as used herein may also include the plural forms. The terms "comprising", "including", "containing", and "having" are inclusive and thus specify the presence of the stated features, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not to be construed as necessarily requiring their performance in the particular order described or illustrated, unless an execution order is explicitly stated. It should also be understood that additional or alternative steps may be used.

[0137] The foregoing are only specific embodiments of the present application, enabling those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but rather will be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A training method for an automotive software quality assessment model, characterized in that: include: When performing each training, a first quality assessment sample corresponding to the reference field and a second quality assessment sample corresponding to the automobile field are obtained; The first quality assessment sample includes: for the common software in the reference field and the automotive field, the software quality score data corresponding to the reference field; the second quality assessment sample includes: for the common software in the reference field and the automotive field, the software quality score data corresponding to the automotive field; Using the first quality assessment sample, the second quality assessment sample, and the first quality assessment model that has been trained in the reference field, a newly constructed second quality assessment model in the automobile field is trained; Wherein, when executing this training, the cross-domain triplet loss value and the model loss value corresponding to the second quality assessment model are determined, and the second quality assessment model is optimized according to the cross-domain triplet loss value and the model loss value until the second quality assessment model meets the preset training stop condition; the cross-domain triplet loss value is used to measure the degree of constraint among the data corresponding to the evaluation user, the data corresponding to the positive sample, and the data corresponding to the negative sample; the evaluation user refers to the evaluation user corresponding to the first quality assessment sample and the second quality assessment sample; the positive sample refers to the common software whose average software quality score is greater than the scoring threshold; the negative sample refers to the common software whose average software quality score is less than or equal to the scoring threshold.

2. The method according to claim 1, characterized in that The first quality assessment sample and the second quality assessment sample correspond to the same plurality of assessment users and the same plurality of shared software; Structurally, both the first quality assessment sample and the second quality assessment sample are software quality scoring matrices; wherein, the rows in the software quality scoring matrix correspond one-to-one to the assessment users, and the columns correspond one-to-one to the common software; or, the rows in the software quality scoring matrix correspond one-to-one to the common software, and the columns correspond one-to-one to the assessment users; the element values ​​in the software quality scoring matrix represent the software quality scores.

3. The method according to claim 2, characterized in that The method of using the first quality assessment sample, the second quality assessment sample, and the first quality assessment model that has been trained in the reference field to train the newly constructed second quality assessment model in the automobile field includes: The first quality assessment model generates first intermediate data according to the first quality assessment sample and predicts first scoring data according to the first intermediate data; The second quality assessment model generates second intermediate data according to the second quality assessment sample and predicts second scoring data according to the second intermediate data; The cross-domain triplet loss value is determined according to the first intermediate data and the second intermediate data, and the model loss value of the second quality assessment model is determined according to the second quality assessment sample, the second intermediate data and the second scoring data.

4. The method according to claim 3, characterized in that The first quality assessment model generates first intermediate data according to the first quality assessment sample, including: The first quality assessment model generates, according to the first quality assessment sample, first user query embeddings respectively corresponding to the plurality of assessment users and first software query embeddings respectively corresponding to the plurality of shared software; The second quality assessment model generates second intermediate data according to the second quality assessment sample, including: The second quality assessment model generates second user query embeddings corresponding to the plurality of assessment users and second software query embeddings corresponding to the plurality of shared software according to the second quality assessment sample; The determining the cross-domain triplet loss value according to the first intermediate data and the second intermediate data includes: For each of the first user query embeddings, select one of the first software query embeddings as a positive sample, select one of the first software query embeddings as a negative sample, and select one of the second software query embeddings as a negative sample; determine a first triplet loss value between the first user query embedding, the positive sample, and the two negative samples; calculate the sum of the first triplet loss values ​​corresponding to each of the first user query embeddings as the first triplet loss value corresponding to the reference field; For each second user query embedding, select one of the second software query embeddings as a positive sample, select one of the second software query embeddings as a negative sample, and select one of the first software query embeddings as a negative sample; determine a second triplet loss value between the second user query embedding, the positive sample, and the two negative samples; calculate the sum of the second triplet loss values ​​corresponding to each of the second user query embeddings as the second triplet loss value corresponding to the automotive field; The sum of the first triplet loss value and the second triplet loss is used as the cross-domain triplet loss value.

5. The method according to claim 4, characterized in that The determining, according to the second quality assessment sample, the second intermediate data and the second scoring data, a model loss value of the second quality assessment model comprises: The following regularized cross entropy loss function is used to calculate the model loss value: in, represents the model loss value; y represents the software quality score in the second quality assessment sample; represents the software quality score of the corresponding position in the second scoring data; Y represents all software quality scores in the quality assessment sample; λ represents a preset regularization coefficient; Θ represents the regularization term of the second user query embedding and the second software query embedding corresponding to y; represents the 2-norm function; mac(R) represents the maximum software quality score in the second quality assessment sample.

6. The method according to claim 4, characterized in that The first triplet loss value is calculated using the following first scale-invariant loss function: in, represents the triplet loss value corresponding to the reference field; represents the i-th first user query embedding of the reference domain; A first software query embedding representing the reference domain as a positive sample; A second software query embedding representing the automobile domain as a negative sample; α represents the first software query embedding of the reference domain as a negative sample; 2 and β 2 is a hyperparameter; the superscript T indicates transposition; The second triplet loss value is calculated using the following second scale-invariant loss function: in, represents the triplet loss value corresponding to the automobile field; represents the i-th second user query embedding in the automobile field; A second software query embedding representing the automobile domain as a positive sample; a first software query embedding representing the reference domain as a negative sample; A second software query embedding representing the automobile domain as a negative sample.

7. The method according to claim 1, characterized in that After the second quality assessment model satisfies the training stop condition, the method further includes: Obtain the software source code corresponding to the software to be evaluated; The software source code is input into the second quality assessment model and a software quality score corresponding to the software to be assessed output by the second quality assessment model is obtained.

8. A training device for an automobile software quality assessment model, characterized in that: include: An acquisition module, used for acquiring a first quality assessment sample corresponding to the reference field and a second quality assessment sample corresponding to the automobile field when performing each training; The first quality assessment sample includes: for the common software in the reference field and the automotive field, the software quality score data corresponding to the reference field; the second quality assessment sample includes: for the common software in the reference field and the automotive field, the software quality score data corresponding to the automotive field; A training module is used to train a newly constructed second quality assessment model in the automotive field using the first quality assessment sample, the second quality assessment sample and the first quality assessment model that has been trained in the reference field; wherein, when executing this training, a cross-domain triplet loss value and a model loss value corresponding to the second quality assessment model are determined, and the second quality assessment model is optimized according to the cross-domain triplet loss value and the model loss value until the second quality assessment model meets a preset training stop condition; the cross-domain triplet loss value is used to measure the degree of constraint among the data corresponding to the evaluation user, the data corresponding to the positive sample, and the data corresponding to the negative sample; the evaluation user refers to the evaluation user to which the first quality assessment sample and the second quality assessment sample correspond; the positive sample refers to the common software whose average software quality score is greater than the scoring threshold; the negative sample refers to the common software whose average software quality score is less than or equal to the scoring threshold.

9. A training device for an automobile software quality assessment model, characterized in that: include: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor coupled to the at least one bus; At least one memory connected to the at least one bus, wherein the processor is configured to: execute a training program of the automotive software quality assessment model stored in the memory to implement the training method of the automotive software quality assessment model according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed to implement the training method of the automobile software quality assessment model according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Hub quality detection method and device, medium and computer program product

    CN113421264A

  • Model training method, device and equipment and readable storage medium

    CN116468096A