Intelligent software quality measurement method and system based on deep semantic fusion and dynamic weight

By constructing a composite fuzzy matter-element matrix, a hierarchical Transformer algorithm, and the TOPSIS method, the problem of inconsistent weights in class graph complexity measurement is solved, achieving a high-precision and adaptive intelligent measurement of software quality, applicable to different types of software systems.

CN121579323APending Publication Date: 2026-02-27JIANGXI UNIVERSITY OF FINANCE AND ECONOMICS
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511864979.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-11
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

In existing technologies, there is a lack of unified weight standards for class graph complexity measurement methods, which leads to different researchers using different weight indicators, resulting in inconsistent measurement values ​​for the same class graph. Furthermore, traditional methods are insufficient in terms of weight accuracy and adaptability.

Method used

A composite fuzzy matter-element matrix is ​​constructed and dimensionless processing is performed. The initial static weights are calculated using the entropy weight method. A deep semantic model is constructed by combining the hierarchical Transformer algorithm. Through multi-scale feature extraction and dynamic weight generation, it is optimized into instance-level dynamic weights. Finally, the TOPSIS method is used to calculate the final complexity metric.

Benefits of technology

It achieves high-precision quality assessment of different types of software systems, with an accuracy improvement of approximately 12% to 18.8%, significantly improved adaptability and interpretability, and can automatically assign reasonable indicator weights to different types of software systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121579323A_ABST
    Figure CN121579323A_ABST
Patent Text Reader

Abstract

The invention provides an intelligent software quality measurement method and system based on deep semantic fusion and dynamic weight, and the method comprises the steps: constructing a composite fuzzy matter element matrix of a software class diagram, and carrying out the dimensionless processing of the composite fuzzy matter element matrix, and obtaining an optimal membership matrix; calculating an initial static weight of the complexity measurement index of the software class diagram; optimizing the initial static weight into an instance-level dynamic weight, and obtaining a self-attention value of each complexity measurement index; introducing the self-attention numerical value into the optimal membership matrix, and constructing an enhanced weighted fuzzy compound element matrix in combination with the instance-level dynamic weight; and on the basis of the enhanced weighted fuzzy complex element matrix, a TOPSIS method is adopted, and a final complexity metric value of the software class diagram is calculated in combination with bidirectional projection closeness. The method can adapt to quality evaluation requirements of different types of software systems, and a high-precision, high-adaptability and interpretable intelligent measurement method is provided for software engineering quality management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of software engineering quality management technology, specifically relating to a software quality intelligent measurement method and system based on deep semantic fusion and dynamic weights. Background Technology

[0002] Software metrics is an important and long-standing research area in software engineering. It is a crucial measure and effective method for evaluating and predicting software development activities, with the fundamental purpose of providing guidance for developing high-quality software. Since Rubey RJ and Hartwick RD proposed the concept of software metrics in 1968, research and application of software metrics have spanned over fifty years, primarily focusing on two aspects: software quality metrics based on internal software attributes and software quality metrics based on external software attributes.

[0003] Regarding research on object-oriented software quality metrics, Chidamber S. and Kemerer C. proposed a set of CK metrics in 1994, including six metrics: weighted number of methods per class, number of subclasses, depth of inheritance tree, coupling between classes, lack of class cohesion, and number of response sets per class. This laid the foundation for object-oriented software quality metrics. Padhy N. et al., building on the CK metrics, combined the weighted number of methods per class, class response, class coupling, inheritance tree depth, and number of children per class to propose three metrics. Furthermore, Misra S. and Adewumi A. et al. proposed a set of cognitive complexity metrics for evaluating object-oriented software projects, including: method complexity, message complexity, attribute complexity, weighted class complexity, and code complexity. These object-oriented software metrics all belong to the category of software quality metrics research based on internal software attributes.

[0004] However, it is worth noting that in research on software quality measurement based on external software attributes, the software quality characteristics that developers and researchers focus on are software quality characteristics in a broad sense. That is, in addition to the software quality characteristics included in the ISO / IEC 25010 software quality model in a narrow sense, other software quality characteristics related to software development and application should also be included.

[0005] Class diagrams, as a crucial software model, describe the classes in a system and their various relationships. Their scientific construction significantly impacts software complexity. Currently, methods for measuring the complexity of class diagrams are limited. One major reason is that the UML standard published by the Object Management Group (OMG) only provides semantic conceptual descriptions of the modeling elements in a class diagram. This leads researchers to use different weighting indicators when measuring class diagram models, lacking a unified standard and resulting in varying measurement values ​​for the same class diagram. Furthermore, given the comprehensiveness, fuzziness, and complexity of software quality measurement systems, many scholars believe that fuzzy mathematics theory and methods are more suitable for handling situations where quantities are ambiguous or missing. Therefore, this invention considers the unknown weight information of the software class diagram to be evaluated, and the potential difficulty in determining the specific quantity or even the absence of evaluation indicators when calculating each indicator in the class diagram. To overcome the shortcomings of existing technologies in providing low precision for the weights of inter-class relationships in class diagrams, this invention proposes a software quality intelligent measurement method and system based on deep semantic fusion and dynamic weighting. Summary of the Invention

[0006] To address the problems of unknown weight information, fuzzy evaluation indicators, and insufficient accuracy of traditional methods in software quality measurement, this invention provides the following solution: A software quality intelligent measurement method based on deep semantic fusion and dynamic weights includes: Construct a composite fuzzy matter-element matrix of the software class diagram, and perform dimensionless processing on the composite fuzzy matter-element matrix to obtain a superior membership matrix; Based on the aforementioned composite fuzzy matter-element matrix, the initial static weights of the software class graph complexity metric are calculated using the entropy weight method. A deep semantic model is constructed based on the hierarchical Transformer algorithm, the initial static weights are optimized into instance-level dynamic weights, and the self-attention value of each complexity metric is obtained. The self-attention value is introduced into the preferred membership matrix, and combined with the instance-level dynamic weights, to construct an enhanced weighted fuzzy complex meta-matrix. Based on the enhanced weighted fuzzy complex meta-matrix, the TOPSIS method is used, combined with bidirectional projection proximity calculation to calculate the final complexity metric of the software class graph, thus completing the intelligent measurement of software quality.

[0007] Preferably, the deep semantic model includes: The semantic embedding layer is used to perform high-dimensional semantic mapping on the preferred membership matrix using a learnable embedding matrix and a position encoding matrix to obtain the embedded semantic representation matrix. A multi-scale feature extraction layer is used to extract and fuse multi-scale features from the semantic representation matrix to obtain a fused multi-scale feature representation. A dynamic weight generation layer is used to obtain instance-level dynamic weights of the software class graph based on the multi-scale feature representation.

[0008] Preferably, the multi-scale feature extraction layer includes: The microscale feature extraction module is used to introduce the local mask matrix into the self-attention calculation, construct the local window attention, and use a two-layer feedforward neural network to extract microscale features. The mesoscale feature extraction module is used to introduce a predefined relation bias matrix into the self-attention calculation, construct relation-aware attention, and use a two-layer feedforward neural network to extract mesoscale features. The macro-scale feature extraction module is used to extract macro-scale features by employing a multi-head self-attention mechanism, residual connections, and layer normalization. The feature fusion module is used to dynamically allocate fusion weights for features at each scale based on a gating fusion mechanism, and to perform multi-scale feature weighted fusion using the fusion weights to obtain the fused multi-scale feature representation.

[0009] Preferably, the dynamic weight generation layer adopts a two-stage generation strategy: The first stage aggregates the fused multi-scale feature representations into scalar feature representations through global average pooling. The second stage uses a multilayer perceptron to map the scalar feature representation into a weight vector of a preset dimension.

[0010] Preferably, the method for calculating the final complexity metric of the software class diagram includes: Obtain the positive and negative ideal solution vectors of the enhanced weighted fuzzy complex metamatrix; Based on the positive ideal solution vector, the negative ideal solution vector, and the weighted evaluation vector of the class graph to be evaluated, the positive projection proximity and the negative projection proximity are calculated respectively. A dynamic comprehensive proximity function is constructed based on the forward projection proximity and the negative projection proximity. Based on the dynamic synthesis proximity function, the final complexity metric of the software class graph is calculated.

[0011] This invention also provides a software quality intelligent measurement system based on deep semantic fusion and dynamic weights, for implementing the method, comprising: The optimal membership matrix construction module is used to construct the composite fuzzy matter-element matrix of the software class graph and perform dimensionless processing on the composite fuzzy matter-element matrix to obtain the optimal membership matrix. The initial static weight calculation module is used to calculate the initial static weight of the software class diagram complexity metric index based on the composite fuzzy matter-element matrix and using the entropy weight method. The dynamic weight generation module is used to construct a deep semantic model based on the hierarchical Transformer algorithm, optimize the initial static weights into instance-level dynamic weights, and obtain the self-attention value of each complexity metric. The matter-element enhancement module is used to introduce the self-attention value into the preferred membership matrix and combine it with the instance-level dynamic weights to construct an enhanced weighted fuzzy complex matter-element matrix. The complexity metric calculation module is used to calculate the final complexity metric of the software class graph based on the enhanced weighted fuzzy complex meta-matrix, using the TOPSIS method and combining bidirectional projection proximity, thus completing the intelligent measurement of software quality.

[0012] Preferably, in the dynamic weight generation module, the deep semantic model includes: The semantic embedding layer is used to perform high-dimensional semantic mapping on the preferred membership matrix using a learnable embedding matrix and a position encoding matrix to obtain the embedded semantic representation matrix. A multi-scale feature extraction layer is used to extract and fuse multi-scale features from the semantic representation matrix to obtain a fused multi-scale feature representation. A dynamic weight generation layer is used to obtain instance-level dynamic weights of the software class graph based on the multi-scale feature representation.

[0013] Preferably, the multi-scale feature extraction layer includes: The microscale feature extraction module is used to introduce the local mask matrix into the self-attention calculation, construct the local window attention, and use a two-layer feedforward neural network to extract microscale features. The mesoscale feature extraction module is used to introduce a predefined relation bias matrix into the self-attention calculation, construct relation-aware attention, and use a two-layer feedforward neural network to extract mesoscale features. The macro-scale feature extraction module is used to extract macro-scale features by employing a multi-head self-attention mechanism, residual connections, and layer normalization. The feature fusion module is used to dynamically allocate fusion weights for features at each scale based on a gating fusion mechanism, and to perform multi-scale feature weighted fusion using the fusion weights to obtain the fused multi-scale feature representation.

[0014] Compared with existing technologies, the beneficial effects of this invention are as follows: First, a composite fuzzy matter-element matrix is ​​constructed and dimensionless, and the initial static weights are calculated using the entropy weight method. Second, an improved hierarchical Transformer architecture is used to construct a deep semantic modeling network. This network includes four core structures: semantic embedding, multi-scale feature extraction, cross-scale adaptive fusion, and dynamic weight generation. Class graph features are extracted at the micro, meso, and macro scales, and instance-level dynamic weights are generated through a gated fusion mechanism, breaking through the accuracy bottleneck of traditional static weights. Through instance-level dynamic weights, the model can automatically assign reasonable indicator weights to different types of software systems (such as monolithic applications, microservice architectures, domain-driven design, etc.). For example, for microservice architectures that emphasize modularity, the model may learn to assign higher weights to inter-class relationship indicators (NDep, NAssoc, etc.); for monolithic applications, it may assign higher weights to intra-class indicators (NM, NA). Experiments show that compared with traditional static weights, dynamic weights improve the Pearson correlation coefficient from -0.827 to -0.925, with an accuracy improvement of approximately 12%.

[0015] This invention incorporates deep learning attention values ​​into the construction of enhanced matter-element representations based on superior membership. Finally, an improved TOPSIS method is employed, introducing bidirectional projection proximity to calculate the comprehensive complexity metric. This invention utilizes a self-supervised hybrid training strategy, combining expert annotation, physical constraints, and entropy weight consistency as supervisory signals, achieving an accuracy improvement of approximately 18.8% while maintaining interpretability. This method can adapt to the quality assessment needs of different types of software systems, providing a high-precision, highly adaptable, and interpretable intelligent measurement method for software engineering quality management. Attached Figure Description

[0016] To more clearly illustrate the technical solution of the present invention, the drawings used in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a flowchart of the intelligent software quality measurement method based on deep semantic fusion and dynamic weights in an embodiment of the present invention. Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0020] Example 1: like Figure 1 As shown, a software quality intelligent measurement method based on deep semantic fusion and dynamic weights includes: S1: Construct the composite fuzzy matter-element matrix of the software class diagram, and perform dimensionless processing on the composite fuzzy matter-element matrix to obtain the optimal membership matrix.

[0021] Matter-element analysis is an emerging discipline that studies the laws and methods for solving incompatible problems. In matter-element analysis, the things being described are... (Evaluation object), characteristics of things (Evaluation index) and the corresponding values ​​of the characteristic values The evaluation indicators and their corresponding values ​​are combined to form a set of basic elements describing things, which are called matter elements, represented as follows: .

[0022] If the value corresponding to the eigenvalue If it possesses fuzziness, it is called a fuzzy matter-element. If the thing being described... have Features Its corresponding value is Then it is called for 3D fuzzy matter element.

[0023] When evaluation is required A class diagram (denoted as) When ), each class diagram has One evaluation indicator (denoted as) ), will this a thing Dimensional elements combine together to form a thing A 3D composite fuzzy matter-element matrix, denoted as , represented as: In formula (1), the subscript Represents class diagram index ( Indicates the first (Class diagram), subscript Indicator index ( Indicates the first (indicators) Class diagram The The values ​​corresponding to each feature. Matrix Indicates inclusion Individual sample class diagrams, The initial data matrix of each evaluation indicator.

[0024] In the process of evaluating things, many evaluation indicators are involved. If there is no unified measurement standard among these indicators, the evaluation process will be difficult to carry out. In order to comprehensively compare indicators with different dimensions, it is necessary to process the values ​​of these evaluation indicators into dimensionless form.

[0025] In software quality evaluation, a larger value for complexity metrics (such as the number of methods NM, the number of classes NC, etc.) indicates a more complex system and lower quality; therefore, it belongs to the category of metrics where smaller values ​​are better (inverse metrics). For this type of metric, the dimensionless formula is: In formula (2): Class diagram The The dimensionless result of the corresponding values ​​of each feature (called the preferred membership degree) takes values ​​ranging from... ; For all class diagrams to be evaluated, the first The maximum value of each feature; For all class diagrams to be evaluated, the first The minimum value of each feature; For indicators where smaller is better: minimum value Corresponding to optimal performance maximum value Corresponding to the worst performance A higher value indicates better performance of the indicator.

[0026] The original values ​​in formula (1) After dimensionless processing using formula (2), we obtain the fuzzy matter-element with superior membership (superior membership matrix). : S2: Based on the composite fuzzy matter-element matrix, the initial static weights of the software class graph complexity metric are calculated using the entropy weight method. In this embodiment, the software class graph complexity metric includes time complexity, space complexity, and total space complexity. Specifically, in this embodiment, the software class graph complexity metric refers to the quantitative characteristic parameters used to evaluate the complexity of the software class graph, including but not limited to: the number of dependencies (NDep), the number of associations (NAssoc), the number of aggregations (NAgg), the number of generalizations (NGen), the number of methods within a class (NM), the number of attributes within a class (NA), and the total number of classes (NC). These metrics comprehensively characterize the complexity features of the software class graph from two dimensions: inter-class relationships and intra-class structure.

[0027] In software quality evaluation, the weight of a particular indicator reflects its relative importance in the overall evaluation process. Therefore, determining the weight is crucial. Common methods for determining weights in traditional research include the entropy method, expert scoring, and the analytic hierarchy process (AHP). This embodiment first uses the entropy weight method to calculate the initial weights.

[0028] The entropy method determines weights based on the differences in the degree of orderliness of the information contained in each indicator. The calculation process is as follows: For the initial data matrix in formula (1) First, standardization is performed: in Class diagram representation In terms of indicators The standardized value on the above satisfies and .

[0029] Next, calculate the... Information entropy value of the indicator : In formula (5), the constant With the number of samples in the system Related. Information entropy Used to measure the first The information utility value of the indicator: when completely disordered, At this point, the utility value of this indicator for the overall evaluation is zero. Therefore, the information utility value of an indicator depends on 1 and the information entropy of that indicator. The difference is denoted as: The initial static weights of each index (denoted as ) are estimated using the entropy method. superscript This indicates that this is the initial static global weight, and all class diagrams share the same set of weight coefficients: The denominator in formula (8) has been normalized, satisfying the following conditions: .

[0030] However, the traditional entropy weight method has the following inherent defects: The bottleneck of static weight accuracy: the weights calculated by formula (8) It is a static global weight, where all class diagrams share the same set of weight coefficients, which cannot reflect the individual differences between different class diagrams in terms of architectural patterns, design complexity, business scenarios, etc.

[0031] Independence assumption: The metrics are treated as independent of each other, ignoring the complex dependencies between software metrics (such as the interaction between inheritance depth and the number of classes).

[0032] Limitations of linear weighting: Linear weighting cannot model higher-order nonlinear interactions.

[0033] Unable to leverage historical experience: Unable to learn and optimize using historical experience annotated by experts.

[0034] S3: Construct a deep semantic model based on the hierarchical Transformer algorithm, optimize the initial static weights into instance-level dynamic weights, and obtain the self-attention value for each complexity metric.

[0035] A further implementation method is that the deep semantic model includes: a semantic embedding layer, a multi-scale feature extraction layer, and a dynamic weight generation layer.

[0036] The semantic embedding layer is used to perform high-dimensional semantic mapping on the preferred membership matrix using a learnable embedding matrix and a positional encoding matrix, obtaining the embedded semantic representation matrix; the preferred membership matrix... (Formula 3) performs high-dimensional semantic mapping: in: Let be the semantic representation matrix after embedding, where the _i_ is the semantic representation matrix after embedding. OK Class diagram representation eigenvectors. For learnable embedding matrices, For the embedded dimension. It is a positional encoding matrix used to preserve the inherent order information of indicators in the measurement system.

[0037] Position encoding uses a sine-cosine function: in For indicator location index, For embedded dimension indexes.

[0038] Technical details of the semantic embedding module: This module uses a learnable linear transformation to... Dimensional from the best membership vector mapping to Higher-dimensional space ( This enhances the expressive power of features. Embedding matrix The parameters are learned through backpropagation, making semantically similar metrics closer in distance in high-dimensional space. (Position encoding) The implementation uses the sine-cosine function from the original Transformer paper (Equation 10), which has the following advantages: (a) it does not require additional learnable parameters; (b) it can be extrapolated to index sequences of arbitrary length; and (c) it can express the relative positional relationship between indices. The positional encoding is added to the embedding vector instead of concatenating them, which injects positional information while maintaining dimensionality invariance, preventing the loss of index order information due to the permutation invariance of the self-attention mechanism.

[0039] A multi-scale feature extraction layer is used to extract and fuse features from the semantic representation matrix at multiple scales, obtaining a fused multi-scale feature representation. Software complexity is a comprehensive reflection of the multi-scale phenomenon, requiring feature extraction at different granularity levels. This invention extracts features at three scales. The multi-scale feature extraction module extracts features at different granularities through three parallel dedicated sub-modules, each employing a specifically improved attention mechanism. A further implementation method includes a multi-scale feature extraction layer comprising: The microscale feature extraction module incorporates the local mask matrix into the self-attention computation, constructs a local window attention mechanism, and employs a two-layer feedforward neural network to extract microscale features (the cohesion of intra-class indices {NM, NA}). Specifically, this submodule uses a local window attention mechanism to restrict each index to focusing only on its neighboring indices. Several metrics are used to form a sliding window of size 3. In the specific implementation, based on standard self-attention calculation, a local mask matrix is ​​introduced to set the attention score outside the window to 0. After softmax, the weights are reduced to 0, thus achieving local attention. This design focuses on the synergistic relationship between adjacent metrics (e.g., NM and NA often show correlation), reducing computational complexity and preserving fine-grained information about intra-class features. The calculation formula is: in Indicates local window attention. It is a two-layer feedforward neural network with the structure: Linear(128→256)→ReLU→Dropout(0.1)→Linear(256→128), which is used to further extract nonlinear features.

[0040] The mesoscale feature extraction module is used to introduce a predefined relation bias matrix into the self-attention calculation, construct a relation-aware attention mechanism, and employ a two-layer feedforward neural network to extract mesoscale features (coupling patterns of inter-class relations {NDep, NAssoc, NAgg, NGen}). Specifically, this submodule introduces a prior relation bias on top of standard attention, that is, it incorporates a predefined relation bias matrix when calculating the attention score. For indicators belonging to the same category relationship... ,set up Enhance the interaction between them; for other metrics, set This design is based on domain knowledge in software engineering that "relationship metrics have synergistic effects," and can capture the nonlinear combinatorial effects of coupling patterns (such as high dependency + high correlation potentially leading to decreased maintainability). Its calculation formula is: in Relation-aware attention is calculated by adding a relation bias to the standard attention formula: . same structure .

[0041] The macro-scale feature extraction module is used to extract macro-scale features (system-level architecture) using a multi-head self-attention mechanism, residual connections, and layer normalization. Specifically, this sub-module uses a multi-head self-attention mechanism and sets... Multiple attention heads. The multi-head mechanism allows the model to focus on different dependency patterns in parallel across different representation subspaces. For example, one head might focus on scale features (a combination of NC, NM, and NA), while another head might focus on relation features (a combination of NDep, NAssoc, etc.). Each head has a dimension of [missing information]. To improve training stability, residual connections and layer normalization are added after multi-head attention. The calculation formula is as follows: in This represents a multi-head self-attention mechanism, where each head computes... ,in As a learnable projection matrix, the outputs of multiple heads are concatenated and then subjected to a linear transformation: . A larger hidden layer dimension of 512 (structure: Linear(128→512)→GELU→Dropout(0.1)→Linear(512→128)) is used to model complex nonlinear relationships at the global level.

[0042] The collaborative mechanism of the three sub-modules is as follows: the micro-scale feature extraction module focuses on local details (window size 3), the meso-scale feature extraction module focuses on medium-range relationships (introducing relationship bias), and the macro-scale feature extraction module focuses on the global perspective (multi-head global attention). Each module has a different receptive field and focus, corresponding to the three levels of intra-class cohesion, inter-class coupling, and system architecture in software engineering, respectively, which aligns with the multi-layered nature of software complexity.

[0043] In formulas (11)-(13), superscript Indicates the first Features of a class diagram This represents the attention mechanism. This represents a multilayer perceptron. This represents a multi-head attention mechanism.

[0044] The feature fusion module is used to dynamically allocate fusion weights for features at each scale based on a gating fusion mechanism, and to perform multi-scale feature weighted fusion using the fusion weights to obtain the fused multi-scale feature representation.

[0045] Specifically, the importance of each scale is dynamically allocated through a gating fusion mechanism: in: The gating coefficient vector represents the fusion weights of features at different scales, with values ​​ranging from [value range missing]. . Each element controls the degree to which the corresponding scale feature should be preserved; the larger the value, the more important the scale feature. The Sigmoid activation function maps linear combinations to... The interval is used to achieve normalized weight control. and These are learnable parameters, and the optimal scale fusion strategy is automatically learned through training. This indicates a vector concatenation operation. This represents element-wise multiplication (Hadamard product), achieving weighted fusion. Class diagram representation The fused multi-scale feature representation integrates information from the micro, meso, and macro levels.

[0046] The advantage of gating mechanisms is that the model can adaptively adjust the importance of features at different scales based on the characteristics of the specific class graph. For example, for small-scale class graphs, it may rely more on micro-scale features; for large-scale complex systems, it may rely more on macro-scale features.

[0047] Technical advantages of the cross-scale adaptive fusion module: The core innovation of the gating mechanism lies in achieving soft adaptive selection of features at different scales. For small-scale class graphs (e.g., number of classes NC < 10), the model learns through training to assign higher gating coefficients (corresponding to g in g) to micro-scale features. The elements are relatively large because the complexity of small-scale systems is mainly determined by intra-class details; for large-scale complex systems (e.g., number of classes NC>30), the model learns to assign higher gating coefficients to macroscopic features (corresponding to g in g). The elements are relatively large, because the global architectural characteristics become the dominant factor at this point. Each element of the gating coefficient g controls the degree of preservation of the corresponding scale features, and its value ranges from [value range missing]. This achieves soft selection rather than hard switching. Sigmoid activation function. This ensures the boundedness of the gating coefficients and avoids gradient explosion. Through this adaptive fusion, the model can dynamically adjust the importance of different scales according to the specific characteristics of the class graph, overcoming the limitations of fixed fusion weights.

[0048] A dynamic weight generation layer is used to obtain instance-level dynamic weights of the software class graph based on multi-scale feature representations. A further implementation involves a two-stage generation strategy: the first stage aggregates the fused multi-scale feature representations into scalar feature representations using global average pooling; the second stage maps the scalar feature representations into weight vectors of a preset dimension using a multilayer perceptron.

[0049] Specifically, based on the fused features The class graph is calculated using a weight generator. The dynamic weight vector. The dynamic weight generation module adopts a two-stage generation strategy: the first stage uses global average pooling (…). (Operation) will fuse features (dimension is) The aggregation is represented as a scalar feature representation; the second stage uses a multilayer perceptron. Map the aggregated features to Dimensional weight vector. The structure is as follows: Input layer (aggregated scalar) → Hidden layer (64-dimensional, Tanh activation) → Dropout (0.2) → Output layer ( Dimension, corresponding (Several indicators). Finally, normalization is performed using the softmax function: Formula (16) is the core innovation of this invention: Class diagram The dynamic weight vector is a dimensional vector, ,in Class diagram representation The Middle The weights of each indicator are determined by the characteristics of the class graph itself, unlike traditional methods. Different class graphs have different weight vectors, achieving instance-level adaptive weighting. This indicates the fusion feature vector Calculate the average and reduce its dimensionality to a scalar or a low-dimensional vector. It is a multilayer perceptron that generates weights, mapping features to... Dimensional weight vector. The function ensures that the weights are normalized and satisfies the following conditions. and This makes the weights have the properties of a probability distribution.

[0050] For example, for a class diagram containing 7 indicators, formula (16) will output a 7-dimensional weight vector, such as This indicates that the second indicator in this type of chart is the most important (weight 0.22), while the third indicator is relatively unimportant (weight 0.08).

[0051] In order to train the above deep learning model (the learnable parameters in formulas (9)-(16)) In addition to the parameters of each MLP, a suitable loss function needs to be designed. Due to the lack of large-scale, accurately labeled data, this invention adopts a hybrid training strategy that combines self-supervised learning with domain knowledge constraints.

[0052] Training data preparation: Collect class graph metric data from historical software projects. Software engineering experts were invited to score the comprehensibility of some class diagrams. A higher score indicates that the more easily it is understood (i.e., the lower the complexity).

[0053] Total loss function design: The total loss function is defined as: (17) Formula (17) contains three types of monitoring signals: ① Order consistency loss The understandability scores annotated by experts are used as weak supervision signals, requiring the complexity order predicted by the model to be consistent with the expert scores.

[0054] in Class graph for model prediction The complexity value. The prediction value is calculated as follows: first, the dynamic weights are obtained through formula (16). Then, a weighted summation is used to calculate the prediction complexity: In formula (19), The preferred membership degree is converted into a complexity contribution value (the higher the membership degree, the lower the complexity), and the predicted complexity is obtained by weighted summation through dynamic weights. This is the interval parameter. When experts consider the class diagram... The understandability is lower than that of class diagrams. (Right now When ), the model should predict .

[0055] ② Physical constraint loss Ensure that complexity increases monotonically with respect to metrics, which aligns with the fundamental principles of software engineering.

[0056] This loss penalizes the negative gradient of complexity with respect to the metric, ensuring that any increase in the metric leads to an increase in complexity.

[0057] ③ Loss of consistency due to entropy weight To prevent the model from deviating completely from traditional methods and to preserve physical interpretability.

[0058] This loss measures the dynamic weights. With initial static weights The Euclidean distance is used to prevent excessive deviation from the traditional entropy weight method.

[0059] Hyperparameter settings: Optimal hyperparameters are searched on the validation set using Bayesian optimization, with a search space of [missing information]. , After 5-fold cross-validation, the present invention sets... , .

[0060] The model was trained using the Adam optimizer with a learning rate of [missing information]. The batch size is 16, and the training lasts for 200 epochs. After training, the model parameters are fixed and used for subsequent weight generation and metric calculation.

[0061] S4: Introduce the self-attention value into the preferred membership matrix, and combine it with instance-level dynamic weights to construct an enhanced weighted fuzzy complex meta-matrix; specifically, after obtaining the dynamic weights... Then, we need to integrate the semantic features learned by deep learning into the original preferred membership degree to obtain an enhanced matter-element representation.

[0062] First, through the deep learning process of formulas (11)-(13), we not only obtain the dynamic weights, but also the self-attention values ​​for each metric. Specifically, in the multi-head attention mechanism, for the class graph... Indicators Its self-attention diagonal elements This reflects the significance of the indicator within the context (i.e., how important the indicator is relative to other indicators). The self-attention matrix is... diagonal elements Indicators The weight of attention to oneself.

[0063] Integrate the semantic features learned from deep learning into the original preferred membership: in The original preferred membership degree of formula (2) Class diagram medium indicators Self-attention diagonal elements, The fusion coefficient controls the balance between traditional methods and deep learning.

[0064] Fusion coefficient Determination: Through 5-fold cross-validation test Using the Pearson correlation coefficient as the evaluation index, when The validation set performs best. This means that 60% of the traditional preferred membership information and 40% of the deep learning attention information are retained, while introducing context-aware capabilities while maintaining interpretability.

[0065] The validity guarantee of formula (22) is: due to (Guaranteed by Formula 2), (Guaranteed by softmax normalization), when At that time, after fusion Must be satisfied This ensures that the enhanced preferred membership is still an effective normalized value.

[0066] Constructing an enhanced weighted fuzzy complex element: The key improvement lies in the fact that, compared to the traditional method (using the same method for all rows), it... The different dynamic weights are used in each row of formula (23) as they are different. This achieves instance-level adaptation.

[0067] S5: Based on the enhanced weighted fuzzy complex meta-matrix, the TOPSIS method is used, combined with bidirectional projection proximity calculation to calculate the final complexity metric of the software class graph, thus completing the intelligent measurement of software quality.

[0068] The TOPSIS method (Technique for Order Preference by Similarity to Ideal Solution) is a technique for approximating the ideal solution. The basic idea is to define the positive and negative ideal solutions of the decision problem, and then find the solution that is closest to the positive ideal solution and furthest from the negative ideal solution.

[0069] Traditional TOPSIS methods use Euclidean distance as a metric, but Euclidean distance only reflects the straight-line distance between two points in space, which has the following drawbacks: ① Information loss (only considering the magnitude of the distance, ignoring directional information); ② Lack of asymmetry (giving equal weight to positive and negative ideal solutions); ③ Dimensionality sensitivity (affected by the curse of dimensionality). This invention introduces a bidirectional projection proximity model, which not only calculates the magnitude of the distance but also considers the direction and projection length, enabling a more accurate characterization of the similarity between the evaluation object and the ideal solution.

[0070] A further implementation method involves calculating the final complexity metric of the software class diagram, including: Obtain the positive and negative ideal solution vectors of the enhanced weighted fuzzy matter element matrix; specifically, determine the enhanced fuzzy matter element matrix. The positive ideal solution vector of (Formula 23) and negative ideal solution vector : in and This indicates that for all class diagrams ( Find the maximum and minimum values. (Optimal ideal solution) The negative ideal solution represents the optimal performance across all metrics. This represents the worst performance across all indicators.

[0071] Based on the positive ideal solution vector, the negative ideal solution vector, and the weighted evaluation vector of the class graph to be evaluated, the positive projection proximity and the negative projection proximity are calculated respectively; specifically, for each weighted evaluation vector of the class graph to be evaluated... Calculate its bidirectional projection closeness to the ideal solution vector: Forward projection proximity (measures the degree of similarity to the ideal solution): Negative projection proximity (measures the degree of similarity to the negative ideal solution): In formulas (26) and (27): Represents the vector of positive ideal solutions The Each component, namely .

[0072] Represents the negative ideal solution vector The Each component, namely .

[0073] Let be the Euclidean norm of the positive ideal solution vector.

[0074] It is the Euclidean norm of the negative ideal solution vector.

[0075] Physical meaning: The larger the value, the stronger the vector. The longer the projection along the direction of the positive ideal solution, the more similar it is to the positive ideal solution; A larger value indicates a greater similarity to the negative ideal solution (which is something we want to avoid). The range of values ​​for projection closeness is... , .

[0076] A dynamic comprehensive proximity function is constructed based on the forward projection proximity and the negative projection proximity. The final complexity metric of the software class diagram is calculated based on the dynamic synthesis proximity function.

[0077] Specifically, based on the concept of projection proximity, a dynamic comprehensive proximity function is constructed to calculate the final complexity: in: First item Basic complexity, range of values The closer to 0, the lower the complexity and the better the quality. Second item As the entropy regularization penalty factor, The regularization coefficient is used. Weight vector The information entropy (logarithm to base 2) has a range of values ​​of . .

[0078] When the weight distribution is uneven (some indicators are significantly more important), the entropy value is low; when the weight distribution is uniform (all indicators are equally important), the entropy value is low. The entropy value reaches its maximum. .

[0079] The present invention introduces an entropy penalty term to encourage the model to learn a discriminative weight allocation; The range of values ​​is The closer this value is to 0, the less complex the evaluation object is, and the closer it is to the optimal ideal level.

[0080] This embodiment also includes: result output and interpretability analysis.

[0081] Output the complexity metric for all class diagrams. Sort by complexity from low to high, identify the best and worst class graphs; generate a dynamic weight analysis report: displaying the weight vector of each class graph. Identify key metrics; generate attention heatmaps: visualization. This helps developers understand model decisions.

[0082] For ease of understanding, the main symbols involved in this invention are explained as follows: (1) Symbols for complexity metrics: NDep: Number of dependencies, representing the number of dependency associations between classes; NAssoc: Number of general associations, representing the number of general associations between classes; NAgg: Number of aggregations, representing the number of loose combinations of the whole and its parts; NGen: Number of generalizations, representing the number of inheritance relationships; NM: Number of methods in a class, representing the total number of methods defined in the class; NA: Number of attributes in a class, representing the total number of attributes defined in the class; NC: Number of Classes, representing the total number of classes contained in the class diagram.

[0083] (2) Matrix and vector symbols: m: The number of class diagrams to be evaluated; n: The number of metrics (n=7 in this example); i: Class diagram index (i=1,2,...,m); j: Index (j=1,2,...,n); X ij The original value of the j-th indicator in class diagram i; u ijThe preferred membership degree of the j-th index in class diagram i; w j (i): The dynamic weight of the j-th index in class graph i.

[0084] (3) Time and space complexity symbols: O(mn): indicates that the algorithm complexity is proportional to the product of the number of class graphs m and the number of indicators n; d: embedding dimension, which is set to 128 in this embodiment.

[0085] The analysis process for software class diagram complexity metrics is summarized as follows: Time complexity: Step 1 (Data Preprocessing): ; Step 2 (Traditional Entropy Weight Method): ; Step 3 (Deep Learning Inference): ,in For the embedding dimension, the main computational overhead comes from the multi-head attention mechanism; Step 4 (Enhancing Matter-Element Construction): ; Step 5 (Projection Proximity Calculation): ; Total time complexity: This is led by step 3.

[0086] Space complexity: Store the original data and intermediate matrix: ; Storing deep learning model parameters and features: ; Total space complexity: ; Actual performance (under typical hardware configuration): For typical software projects: Class diagram, One indicator, ; Time taken to measure a single class diagram: approximately 0.12 seconds; Batch measurement of 20 class diagrams: approximately 3.2 seconds; Meets the real-time measurement requirements of IDE plugins (user-acceptable response time < 5 seconds).

[0087] The technological innovation of the dynamic weight generation method designed in this invention lies in: (a) Instance-level adaptation: sharing the same set of static weights across all class diagrams as in traditional methods. Unlike other methods, this approach applies to each class diagram. Generate independent dynamic weight vectors The weight values ​​are determined by the fusion features of the class graph. The decision is made so that different class diagrams automatically receive different weight allocations based on their own architectural patterns and complexity characteristics.

[0088] (b) End-to-end learning: Weight generation network The parameters are trained end-to-end using the total loss function (Equation 17) without manual adjustment. The model can learn a reasonable weight allocation strategy from the relative ranking (Equation 18) annotated by experts, physical constraints (Equation 20), and entropy weight consistency constraints (Equation 21).

[0089] (c) Physical constraint guarantee: To prevent the model from deviating completely from the physical meaning of traditional methods, entropy-weighted consistency loss is used during training. (Formula 21) Constraining dynamic weights However, it does not deviate excessively from the initial static weights. This soft constraint mechanism allows the model to adaptively adjust while maintaining interpretability.

[0090] (d) Probability distribution characteristics: softmax normalization ensures and This gives the weights the properties of a probability distribution, making them easy to interpret as the relative contribution of each indicator to the complexity.

[0091] Technical effect: This invention improves the adaptability of systems of different scales by multi-scale modeling—micro (cohesion), meso (coupling), macro (architecture) and gated adaptive fusion—the model automatically adjusts the weights of each scale according to the characteristics of the class graph. Small scales depend on the micro scale, and large scales depend on the macro scale.

[0092] This invention utilizes instance-level dynamic weights, enabling the model to automatically assign appropriate metric weights to different types of software systems (such as monolithic applications, microservice architectures, and domain-driven design). For example, for microservice architectures emphasizing modularity, the model may learn to assign higher weights to inter-class relationship metrics (NDep, NAssoc, etc.); for monolithic applications, it may assign higher weights to intra-class metrics (NM, NA). Experiments show that, compared to traditional static weights, dynamic weights improve the Pearson correlation coefficient from -0.827 to -0.925, resulting in an accuracy improvement of approximately 12%.

[0093] The Euclidean distance in the TOPSIS method is improved to a two-way projection proximity calculation (Equations 26-27), which considers distance magnitude, orientation information, and projection length simultaneously. This overcomes the information loss inherent in Euclidean distance by including orientation information in the projection; it also overcomes asymmetry by calculating positive and negative projections separately; it overcomes dimensionality sensitivity by eliminating the influence of dimensions through projection normalization; and it introduces entropy regularization penalties to encourage the learning of discriminative weights.

[0094] A hybrid loss function is designed by combining three supervision signals: expert annotation (ranking loss), physical constraints (monotonicity), and entropy weight consistency (interpretability). Implementation: The total loss function in formula (17) includes: the ranking consistency loss in formulas (18)-(19). Physical constraint loss in formula (20) ; Entropy weight consistency loss of formula (21) The technological advantages are that only experts are needed to perform relative sorting of some class diagrams, without the need for precise numerical labeling; it is efficient with small samples, and a high-precision model can be trained with only 26 samples; physical constraints are guaranteed to ensure that the predictions conform to the basic laws of software engineering; interpretability is preserved, and it does not completely deviate from traditional methods, maintaining physical meaning.

[0095] The present invention is compared with the prior art, as shown in Table 1.

[0096] Table 1

[0097] Note: The “information entropy method” mentioned in Table 1 is from the literature: Lu H, Zhou Y, Xu B, et al. The ability of object-oriented metrics to predict change-proneness: a meta-analysis[J]. Empirical Software Engineering, 2012, 17(3):200-242. In Table 1, the “information entropy multi-attribute decision method” is from the literature: Yi T. On the Application of Information Entropy-based Multi-attribute Decision in UML Class DiagramMetrics[J]. International Journal of u- and e- Service, Science and Technology, 2015, 8, (6), pp:105-116. In summary, the practical application advantages of this invention are as follows: Significant improvement in accuracy: approximately 12% higher than the traditional fuzzy matter-element method, and approximately 18.8% higher than the "information entropy method" in Table 1.

[0098] Highly adaptable: It adapts to different types of software systems (monolithic applications, microservices, domain-driven design, etc.) through dynamic weights.

[0099] Good robustness: It can still work stably under conditions such as small sample size, missing values, and outliers.

[0100] Excellent interpretability: It retains the physical meaning of traditional methods (entropy weight consistency constraint); provides attention visualization heatmaps; and outputs personalized weight vectors for each class graph.

[0101] The project is available with a computation time of 0.12 seconds per class diagram, meeting real-time measurement requirements; it can be integrated into IDE plugins (such as IntelliJ IDEA and Eclipse); it provides a REST API interface for CI / CD process calls; and it supports batch measurement and incremental updates.

[0102] Highly scalable: The framework can be extended to other UML diagrams (sequence diagrams, state diagrams, etc.); new metrics can be added without redesign; it supports transfer learning and requires only a small number of samples for fine-tuning in new domains.

[0103] Example 2 This invention also provides a software quality intelligent measurement system based on deep semantic fusion and dynamic weights, for implementing the method of Embodiment 1, including: The optimal membership matrix construction module is used to construct the composite fuzzy matter-element matrix of the software class diagram and perform dimensionless processing on the composite fuzzy matter-element matrix to obtain the optimal membership matrix. The initial static weight calculation module is used to calculate the initial static weights of the software class diagram complexity metric based on the composite fuzzy matter-element matrix and using the entropy weight method. The dynamic weight generation module is used to build a deep semantic model based on the hierarchical Transformer algorithm, optimize the initial static weights into instance-level dynamic weights, and obtain the self-attention value of each complexity metric. The matter-element enhancement module is used to introduce self-attention values ​​into the preferred membership matrix and combine them with instance-level dynamic weights to construct an enhanced weighted fuzzy complex matter-element matrix. The complexity metric calculation module is used to calculate the final complexity metric of the software class graph based on the enhanced weighted fuzzy complex meta-matrix, using the TOPSIS method and combining bidirectional projection proximity, thus completing the intelligent measurement of software quality.

[0104] A further implementation method involves a deep semantic model within the dynamic weight generation module, comprising: The semantic embedding layer is used to perform high-dimensional semantic mapping on the superior membership matrix using a learnable embedding matrix and a position encoding matrix, so as to obtain the embedded semantic representation matrix. The multi-scale feature extraction layer is used to extract and fuse multi-scale features from the semantic representation matrix to obtain the fused multi-scale feature representation. The dynamic weight generation layer is used to obtain instance-level dynamic weights of the software class graph based on multi-scale feature representations.

[0105] A further implementation method includes a multi-scale feature extraction layer comprising: The microscale feature extraction module is used to introduce the local mask matrix into the self-attention calculation, construct the local window attention, and use a two-layer feedforward neural network to extract microscale features. The mesoscale feature extraction module is used to introduce a predefined relation bias matrix into the self-attention calculation, construct relation-aware attention, and use a two-layer feedforward neural network to extract mesoscale features. The macro-scale feature extraction module is used to extract macro-scale features by employing a multi-head self-attention mechanism, residual connections, and layer normalization. The feature fusion module is used to dynamically allocate fusion weights for features at each scale based on a gating fusion mechanism, and to perform multi-scale feature weighted fusion using the fusion weights to obtain the fused multi-scale feature representation.

[0106] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made to the technical solutions of the present invention by those skilled in the art without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.

Claims

1. A software quality intelligent measurement method based on deep semantic fusion and dynamic weight, characterized in that, The method comprises the following steps: a composite fuzzy matter-element matrix of the software class diagram is constructed, and the composite fuzzy matter-element matrix is dimensionless processed to obtain a suboptimal membership matrix; based on the composite fuzzy matter-element matrix, an entropy weight method is used to calculate initial static weights of the complexity measurement indexes of the software class diagram; a deep semantic model is constructed based on a hierarchical Transformer algorithm, the initial static weights are optimized into instance-level dynamic weights, and self-attention values of each complexity measurement index are obtained; the self-attention values are introduced into the suboptimal membership matrix, the instance-level dynamic weights are combined, and an enhanced weighted fuzzy composite matter-element matrix is constructed; based on the enhanced weighted fuzzy composite matter-element matrix, a TOPSIS method is used to calculate a final complexity measurement value of the software class diagram, and intelligent measurement of software quality is completed.

2. The method of claim 1, wherein, The deep semantic model comprises: a semantic embedding layer, which is used for high-dimensional semantic mapping of the suboptimal membership matrix by using a learnable embedding matrix and a position encoding matrix, and obtaining an embedded semantic representation matrix; a multi-scale feature extraction layer, which is used for multi-scale feature extraction and fusion of the semantic representation matrix, and obtaining a fused multi-scale feature representation; a dynamic weight generation layer, which is used for obtaining instance-level dynamic weights of the software class diagram based on the multi-scale feature representation.

3. The method of claim 2, wherein, The multi-scale feature extraction layer comprises: a microscopic scale feature extraction module, which is used for introducing a local mask matrix into self-attention calculation, constructing local window attention, and extracting microscopic scale features by using two layers of feedforward neural networks; a mesoscopic scale feature extraction module, which is used for introducing a pre-defined relationship bias matrix into self-attention calculation, constructing relationship-aware attention, and extracting mesoscopic scale features by using two layers of feedforward neural networks; a macroscopic scale feature extraction module, which is used for extracting macroscopic scale features by using a multi-head self-attention mechanism, residual connection and layer normalization; a feature fusion module, which is used for dynamically allocating fusion weights of features of each scale based on a gating fusion mechanism, and performing multi-scale feature weighted fusion by using the fusion weights to obtain a fused multi-scale feature representation.

4. The method of claim 2, wherein, The dynamic weight generation layer adopts a two-stage generation strategy: In the first stage, the fused multi-scale feature representation is aggregated into a scalar feature representation by global average pooling; In the second stage, the scalar feature representation is mapped into a weight vector of a preset dimension by a multilayer perceptron.

5. The method of claim 1, wherein, The method for calculating the final complexity measurement value of the software class diagram comprises: obtaining a positive ideal solution vector and a negative ideal solution vector of the enhanced weighted fuzzy composite matter-element matrix; based on the positive ideal solution vector, the negative ideal solution vector and a weighted evaluation vector of the class diagram to be evaluated, a positive projection closeness degree and a negative projection closeness degree are respectively calculated; based on the positive projection closeness degree and the negative projection closeness degree, a dynamic comprehensive closeness degree function is constructed; based on the dynamic comprehensive closeness degree function, the final complexity measurement value of the software class diagram is calculated.

6. An intelligent software quality measurement system based on deep semantic fusion and dynamic weight, for implementing the method of any one of claims 1-5, characterized in that, The method comprises the following steps: a suboptimal membership matrix is constructed by constructing a composite fuzzy matter-element matrix of a software class diagram, and the composite fuzzy matter-element matrix is dimensionless processed to obtain the suboptimal membership matrix; An initial static weight calculation module is configured to calculate initial static weights of the software class diagram complexity measurement indexes based on the composite fuzzy matter-element matrix by using an entropy weight method; A dynamic weight generation module is configured to construct a deep semantic model based on a hierarchical Transformer algorithm, optimize the initial static weights into instance-level dynamic weights, and obtain self-attention values of each complexity measurement index; A matter-element enhancement module is configured to introduce the self-attention values into the subordinate degree matrix, combine the instance-level dynamic weights, and construct an enhanced weighted fuzzy composite matter-element matrix; A complexity measurement value calculation module is configured to calculate final complexity measurement values of the software class diagram by using a TOPSIS method in combination with a bidirectional projection closeness, complete intelligent measurement of software quality based on the enhanced weighted fuzzy composite matter-element matrix.

7. The system of claim 6, wherein, In the dynamic weight generation module, the deep semantic model comprises: A semantic embedding layer is configured to perform high-dimensional semantic mapping on the subordinate degree matrix by using a learnable embedding matrix and a position encoding matrix, and obtain an embedded semantic representation matrix; A multi-scale feature extraction layer is configured to perform multi-scale feature extraction and fusion on the semantic representation matrix, and obtain a fused multi-scale feature representation; A dynamic weight generation layer is configured to obtain instance-level dynamic weights of the software class diagram based on the multi-scale feature representation.

8. The system of claim 7, wherein, The multi-scale feature extraction layer comprises: A microscopic scale feature extraction module is configured to introduce a local mask matrix into self-attention calculation, construct local window attention, and extract microscopic scale features by using two layers of feedforward neural networks; A mesoscopic scale feature extraction module is configured to introduce a predefined relationship bias matrix into self-attention calculation, construct relationship-aware attention, and extract mesoscopic scale features by using two layers of feedforward neural networks; A macroscopic scale feature extraction module is configured to extract macroscopic scale features by using a multi-head self-attention mechanism, residual connection and layer normalization; A feature fusion module is configured to dynamically allocate fusion weights of features of different scales based on a gating fusion mechanism, perform multi-scale feature weighted fusion by using the fusion weights, and obtain a fused multi-scale feature representation.

Citation Information

Patent Citations

  • Quantitative method and system of software quality

    CN109032926A

  • Software complexity measurement method based on ordered weighted average (OWA) operator

    CN119621123A