Software upgrading risk prediction method and device and electronic equipment
By calculating the Mahalanobis distance and global mutation index of high-dimensional feature vectors, and combining them with cumulative sum control graph algorithms, the problem of insufficient accuracy in risk assessment of software version upgrades in existing technologies is solved, achieving more efficient and accurate risk prediction.
Patent Information
- Application Number
- CN202511759896.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-27
- Publication Date
- 2026-03-20
AI Technical Summary
Existing technologies are costly, inefficient, and inaccurate in assessing the risks of software version upgrades, making it difficult to accurately evaluate the stability and usability of the upgraded software version.
By calculating the Mahalanobis distance between high-dimensional feature vectors and the global mutation index, combined with the cumulative sum control graph algorithm, risk assessment indicators are obtained to accurately capture the differences and mutation characteristics between software versions.
This improves the accuracy and precision of risk assessment during software upgrades, ensuring that the upgraded software version can be used normally.
Smart Images

Figure CN121704887A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of software updating, in particular to a software upgrade risk prediction method and device and electronic equipment. BACKGROUND
[0002] In the current fast iteration software development mode, large software systems such as operating systems, databases, middleware, cloud service platforms, etc. will release dozens or even hundreds of versions every year. For users, when facing software version upgrade, they may face the situation that the upgraded version runs unstably in the production environment, resulting in upgrade failure, or various problems occur during use after upgrade. Based on this, when it is necessary to upgrade the historical software version to the new version to obtain new features, performance improvement and security patches, the potential risk of upgrading from the historical version to the new version must be accurately evaluated to ensure that the upgraded software version can be normally used.
[0003] In the prior art, software version upgrade can be achieved in the following ways: 1) following the official upgrade path based on limited testing and manual summary; 2) performing comprehensive regression testing, building a test environment consistent with the production environment, and executing a complete test case suite to determine the potential risk of upgrading the historical software version to the new version, thereby realizing version upgrade; 3) based on automatic analysis of test cases, comparing the number of failed test cases between two versions to evaluate the potential risk, and then completing version upgrade; 4) through simple code difference analysis, calculating the change amount of code lines, the number of modified files and other basic indicators to evaluate the potential risk, and finally realizing software version upgrade.
[0004] However, using the prior art to evaluate the potential risk of upgrading the historical software version to the new version has the problems of high cost, low efficiency and insufficient risk evaluation accuracy. SUMMARY
[0005] Embodiments of the present application provide a software upgrade risk prediction method, device and electronic equipment, which can calculate the Mahalanobis distance between high-dimensional feature vectors, fully consider the correlation between multi-dimensional features, and thus more accurately capture the differences between different software versions. In addition, the global mutation index can be obtained by means of the cumulative sum control chart algorithm, which can accurately locate the mutation features occurring in the software version evolution process. Finally, the risk evaluation index is obtained by combining the Mahalanobis distance and the global mutation index, which improves the accuracy of the risk evaluation index in the software upgrade process and effectively improves the accuracy of the predicted risk.
[0006] To achieve the above purpose, in a first aspect, embodiments of the present application provide a software upgrade risk prediction method, comprising: obtaining high-dimensional feature vectors corresponding to a software version to be evaluated and a plurality of historical software versions respectively; determining a sample covariance matrix according to the high-dimensional feature vectors corresponding to the plurality of historical software versions; determining a Mahalanobis distance between the software version to be evaluated and a software version to be upgraded according to the high-dimensional feature vector corresponding to the software version to be evaluated, the sample covariance matrix, and a high-dimensional feature vector corresponding to the software version to be upgraded; determining global mutation indexes corresponding to the software version to be evaluated and the plurality of historical software versions respectively by a cumulative sum control chart algorithm for the plurality of high-dimensional feature vectors; determining a risk evaluation index between the software version to be evaluated and the software version to be upgraded according to the Mahalanobis distance and the plurality of global mutation indexes.
[0007] In one embodiment, the high-dimensional feature vector includes code dimension features, quality dimension features, and semantic dimension features. The code dimension features include code entropy sub-features, API interface change rate sub-features, and architecture key module coupling degree change sub-features. The quality dimension features include defect density sub-features, test case pass rate change sub-features, and static analysis alarm growth rate sub-features. The semantic dimension features include release note sentiment score sub-features and change keyword frequency sub-features.
[0008] In one embodiment, the determination of the Mahalanobis distance between the software version to be evaluated and the software version to be upgraded according to the high-dimensional feature vector corresponding to the software version to be evaluated, the sample covariance matrix, and the high-dimensional feature vector corresponding to the software version to be upgraded includes: determining an inverse matrix corresponding to the sample covariance matrix; substituting the high-dimensional feature vector corresponding to the software version to be evaluated, the inverse matrix, and the high-dimensional feature vector corresponding to the software version to be upgraded into a Mahalanobis distance calculation formula to calculate and determine the Mahalanobis distance.
[0009] In one embodiment, the Mahalanobis distance calculation formula can be defined by the following expression:
[0010] wherein, represents the high-dimensional feature vector corresponding to the software version to be upgraded, represents the high-dimensional feature vector corresponding to the software version to be evaluated, represents the inverse matrix corresponding to the sample covariance matrix, represents a matrix.
[0011] In one embodiment, the global mutation index corresponding to the software version to be evaluated and the plurality of historical software versions is determined by the cumulative and control chart algorithm, comprising: For a plurality of sub-features corresponding to the software version to be evaluated and the plurality of historical software versions, respectively, the time series feature corresponding to each sub-feature is obtained; Each time series feature is iteratively calculated to determine a plurality of control chart statistics corresponding to each time series feature; According to the plurality of control chart statistics and the preset threshold, the global mutation index corresponding to the software version to be evaluated and the plurality of historical software versions is determined.
[0012] In one embodiment, the global mutation index corresponding to the software version to be evaluated and the plurality of historical software versions is determined according to the plurality of control chart statistics and the preset threshold, comprising: For the time series feature of each sub-feature corresponding to the software version to be evaluated and each historical software version, it is judged whether the plurality of control chart statistics corresponding to the time series feature is greater than the preset threshold; If yes, the sub-feature corresponding to the control chart statistics is determined as a mutation feature; The total number of a plurality of mutation features is counted, and the total number is determined as the global mutation index.
[0013] In one embodiment, the risk assessment index between the software version to be evaluated and the software version to be upgraded is determined according to the Mahalanobis distance and the plurality of global mutation indexes, comprising: The Mahalanobis distance and the plurality of global mutation indexes are weighted and fused to obtain the risk assessment index between the software version to be evaluated and the software version to be upgraded.
[0014] In one embodiment, the risk assessment index between the software version to be evaluated and the software version to be upgraded is obtained by weighting and fusing the Mahalanobis distance and the plurality of global mutation indexes, comprising: According to the formula The risk assessment index is obtained; Wherein, The first weight coefficient of the Mahalanobis distance is represented by The Mahalanobis distance is represented by The second weight coefficient of the cumulative global mutation index between the second historical software version in the plurality of historical software versions and the software version to be evaluated is represented by The global mutation index of the first software version is represented by The global mutation index of the first software version is represented by an index representing a second historical software version of the plurality of historical software versions, Table a cumulative distribution function of a standard normal distribution.
[0015] In a second aspect, an embodiment of the present application provides a software upgrade risk prediction device, comprising: a high-dimensional feature vector acquisition module configured to acquire high-dimensional feature vectors corresponding to a software version to be evaluated and a plurality of historical software versions respectively; a sample covariance matrix determination module configured to determine a sample covariance matrix according to the high-dimensional feature vectors corresponding to the plurality of historical software versions; a Mahalanobis distance determination module configured to determine a Mahalanobis distance between the software version to be evaluated and a software version to be upgraded according to the high-dimensional feature vector corresponding to the software version to be evaluated, the sample covariance matrix, and a high-dimensional feature vector corresponding to the software version to be upgraded; a global mutation index determination module configured to determine global mutation indexes corresponding to the software version to be evaluated and the plurality of historical software versions respectively by using a cumulative sum control chart algorithm on the plurality of high-dimensional feature vectors; a risk evaluation index determination module configured to determine a risk evaluation index between the software version to be evaluated and the software version to be upgraded according to the Mahalanobis distance and the plurality of global mutation indexes.
[0016] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the software upgrade risk prediction method of the first aspect when executing the computer program.
[0017] The above technical solution has the following technical effects: Thus, the software upgrade risk prediction method provided in this embodiment obtains high-dimensional feature vectors corresponding to the software version to be evaluated and multiple historical software versions. Based on the high-dimensional feature vectors of the historical software versions, a sample covariance matrix is determined. The Mahalanobis distance between the software version to be evaluated and the software version to be upgraded is determined based on the high-dimensional feature vector of the software version to be evaluated, the sample covariance matrix, and the high-dimensional feature vector of the current software version to be upgraded. For the multiple high-dimensional feature vectors, a cumulative sum control graph algorithm is used to determine the global mutation index corresponding to the software version to be evaluated and the multiple historical software versions. Based on the Mahalanobis distance and the multiple global mutation indices, a risk assessment index between the software version to be evaluated and the software version to be upgraded is determined. In this way, by calculating the Mahalanobis distance between high-dimensional feature vectors, the correlation between multi-dimensional features can be fully considered, thereby accurately capturing the differences between different software versions. Furthermore, by using the cumulative sum control graph algorithm to obtain the global mutation index, the mutation characteristics occurring during the software version evolution can be accurately located. Finally, by combining the Mahalanobis distance and the global mutation index to obtain the risk assessment index, the accuracy of the risk assessment index during the software upgrade process is improved, effectively increasing the precision of risk prediction. Attached Figure Description
[0018] Figure 1 A flowchart illustrating a software upgrade risk prediction method according to an embodiment of the present invention; Figure 2 A schematic diagram of a software upgrade risk prediction device provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0019] To further illustrate the various embodiments, the present invention provides accompanying drawings. These drawings are part of the disclosure of the present invention, primarily used to illustrate the embodiments and to explain the operating principles of the embodiments in conjunction with the relevant descriptions in the specification. With reference to these drawings, those skilled in the art should be able to understand other possible implementations and the advantages of the present invention. Components in the drawings are not drawn to scale, and similar component symbols are generally used to represent similar components.
[0020] The present invention will now be further described in conjunction with the accompanying drawings and specific embodiments.
[0021] Example 1: Figure 1 This is a flowchart illustrating a software upgrade risk prediction method according to an embodiment of the present invention. Specifically, this embodiment includes the following steps: S10: Obtain the high-dimensional feature vectors corresponding to the software version to be evaluated and multiple historical software versions.
[0022] The to-be-evaluated software version refers to a software version to be upgraded, the plurality of historical software versions refer to historical old software versions corresponding to the to-be-evaluated software version, and the high-dimensional feature vector includes code dimension features, quality dimension features, and semantic dimension features. The code dimension features include code entropy sub-features, API interface change rate sub-features, and architecture key module coupling degree change sub-features.
[0023] Optionally, on the basis of the above-mentioned embodiments, in some embodiments of the present application, the code entropy sub-feature refers to a measure of the chaos or dispersion of code changes, which can be determined by determining, wherein, represents the number of changed lines of the modified file, and N represents the total number of changed lines of the modified file, represents the proportion of the number of changed lines of each modified file to the total number of changed lines of the version. It should be noted that a high entropy value of the code entropy indicates that the changes are dispersed in a large number of files, which may be architecture adjustment or feature change affecting a wide range, and the risk is high. A low entropy value indicates that the changes are concentrated in a small number of files, and the risk is relatively controllable.
[0024] Optionally, on the basis of the above-mentioned embodiments, in some embodiments of the present application, the API interface change rate sub-feature refers to a measure of the stability of the public interface. It can be determined by parsing the interface definition in the API document or the source code, and by identifying the number of newly added, modified and deleted interfaces in the total number of interfaces of the to-be-upgraded software version, i.e., the old version. Specifically, according to the formula determines the API interface change rate sub-feature, wherein, represents the number of newly added interfaces, represents the number of modified interfaces, represents the number of deleted interfaces, represents the total number of interfaces of the old version.
[0025] Optionally, on the basis of the above-mentioned embodiments, in some embodiments of the present application, the architecture key module coupling degree change sub-feature refers to a measure of the degree of influence of the core module. It can be determined by defining a set of architecture key modules, such as the kernel, the transaction engine, etc., and using a dependency analysis tool to calculate the number of incoming or outgoing dependency relationships between a plurality of modules in the to-be-evaluated software version and the to-be-upgraded software version. Specifically, according to the formula determines the architecture key module coupling degree change sub-feature, wherein, represents the number of incoming or outgoing dependency relationships between a plurality of modules in the to-be-evaluated software version, represents the number of incoming or outgoing dependency relationships between a plurality of modules in the to-be-upgraded software version.
[0026] The quality dimension features include a defect density sub-feature, a test case pass rate change sub-feature, and a static analysis alert growth rate sub-feature.
[0027] Optionally, based on the above-mentioned embodiments, in some embodiments of the present application, the defect density sub-feature refers to reflecting the inherent quality of the software version to be evaluated. It can be determined by obtaining the number of Bugs of serious and above levels reported within a specific time window T, such as 90 days, after the release of the version from the issue tracking system. Specifically, according to the formula determining the defect density sub-feature, wherein, represents the number of Bugs, represents the specific time window.
[0028] Optionally, based on the above-mentioned embodiments, in some embodiments of the present application, the test case pass rate change sub-feature refers to measuring the quality regression between the software version to be evaluated and the software version to be upgraded. It can be determined by calculating the difference between the quality regression value of the software version to be evaluated and the quality regression value of the software version to be upgraded. Specifically, according to the formula determining the test case pass rate change sub-feature, wherein, represents the quality regression value of the software version to be evaluated, represents the quality regression value of the software version to be upgraded.
[0029] Optionally, based on the above-mentioned embodiments, in some embodiments of the present application, the static analysis alert growth rate sub-feature refers to capturing the potential deterioration of code quality. It can be determined by obtaining the number of alerts of each version of the software version to be evaluated and the software version to be upgraded through a tool, such as SonarQube, according to the formula determining, wherein, represents the number of alerts of the software version to be upgraded, represents the number of alerts of the software version to be evaluated.
[0030] The semantic dimension features include a release note sentiment score sub-feature and a change keyword frequency sub-feature.
[0031] Optionally, based on the above-mentioned embodiments, in some embodiments of the present application, the release note sentiment score sub-feature refers to perceiving the disruptive nature of the upgrade from natural language descriptions. It can be determined by calculating its sentiment composite score through a pre-trained sentiment analysis model.
[0032] Optionally, based on the above embodiments, in some embodiments of the present application, changing the keyword frequency sub-feature refers to quantifying the mentioned disruptive changes in the to-be-evaluated software version and the to-be-upgraded software version. This can be achieved by constructing a disruptive change keyword dictionary, calculating the TF-IDF value of these keywords in the Release Notes, and further taking the maximum value or average value to determine.
[0033] It should be noted that for multiple sub-features, the mean and standard deviation of each sub-feature need to be obtained, and the data included in each sub-feature is standardized according to the mean and standard deviation.
[0034] S11: Determine a sample covariance matrix according to the high-dimensional feature vectors corresponding to the plurality of historical software versions.
[0035] Specifically, the high-dimensional feature vectors corresponding to the to-be-evaluated software version and the plurality of historical software versions are obtained. After obtaining the high-dimensional feature vectors corresponding to the plurality of historical software versions, the sample covariance matrix is determined according to the high-dimensional feature vectors corresponding to the plurality of historical software versions.
[0036] S12: Determine the Mahalanobis distance between the to-be-evaluated software version and the to-be-upgraded software version according to the high-dimensional feature vector corresponding to the to-be-evaluated software version, the sample covariance matrix, and the high-dimensional feature vector corresponding to the current to-be-upgraded software version.
[0037] Specifically, after obtaining the sample covariance matrix, the Mahalanobis distance between the to-be-evaluated software version and the to-be-upgraded software version is determined according to the high-dimensional feature vector corresponding to the to-be-evaluated software version, the sample covariance matrix, and the high-dimensional feature vector corresponding to the current to-be-upgraded software version.
[0038] Optionally, based on the above embodiments, in some embodiments of the present application, one implementation of S12 can be: S121: Determine the inverse matrix corresponding to the sample covariance matrix.
[0039] S122: Substitute the high-dimensional feature vector corresponding to the to-be-evaluated software version, the inverse matrix, and the high-dimensional feature vector corresponding to the to-be-upgraded software version into the Mahalanobis distance calculation formula to calculate and determine the Mahalanobis distance.
[0040] The Mahalanobis distance calculation formula is used to calculate the distance between multi-dimensional features, obtain the feature correlation between each feature, and the Mahalanobis distance can consider the shape of the feature distribution. This avoids the case where the difference between the to-be-evaluated software version and the to-be-upgraded software version is very large in a certain feature, and the variance of this feature itself is also very large (i.e., unstable), which leads to the contribution of this difference to the total distance being weakened.
[0041] Specifically, after obtaining the sample covariance matrix, an inverse matrix corresponding to the sample covariance matrix is obtained, and further, the high-dimensional feature vector corresponding to the software version to be evaluated, the inverse matrix, and the high-dimensional feature vector corresponding to the software version to be upgraded are substituted into the Mahalanobis distance calculation formula to calculate and determine the Mahalanobis distance.
[0042] Optionally, based on the above-mentioned embodiments, in some embodiments of the present application, the Mahalanobis distance calculation formula can be defined by the following expression:
[0043] wherein, the high-dimensional feature vector corresponding to the software version to be upgraded, the high-dimensional feature vector corresponding to the software version to be evaluated, the inverse matrix corresponding to the sample covariance matrix, the matrix.
[0044] S13: For a plurality of high-dimensional feature vectors, a global mutation index corresponding to the software version to be evaluated and a plurality of historical software versions is determined by a cumulative sum control chart algorithm.
[0045] wherein the global mutation index is used to express the parameter value of the mutation of a plurality of different sub-features included in the high-dimensional feature vectors corresponding to the software version to be evaluated and the plurality of historical software versions.
[0046] Specifically, for a plurality of different sub-features included in a plurality of high-dimensional feature vectors, i.e., code entropy sub-features included in code dimension features, API interface change rate sub-features, and architecture key module coupling degree change sub-features; defect density sub-features, test case pass rate change sub-features, and static analysis alarm growth rate sub-features included in quality dimension features; release note sentiment score sub-features and change keyword frequency sub-features included in semantic dimension features, a global mutation index corresponding to the software version to be evaluated and a plurality of historical software versions is determined by a cumulative sum control chart algorithm.
[0047] Optionally, based on the above-mentioned embodiments, in some embodiments of the present application, one implementation of S13 can be: S131: For a plurality of sub-features corresponding to the software version to be evaluated and a plurality of historical software versions, respectively, a time series feature corresponding to each sub-feature is obtained.
[0048] Specifically, a plurality of different sub-features included in the high-dimensional feature vectors corresponding to the software version to be evaluated and a plurality of historical software versions are arranged in the order of software version timestamps, and a time series feature corresponding to each of a plurality of sub-features corresponding to the software version to be evaluated and a time series feature corresponding to each of a plurality of sub-features corresponding to each historical software version is obtained.
[0049] S132: iteratively calculating each time series feature to determine a plurality of control chart statistics corresponding to each time series feature respectively.
[0050] Each control chart statistic corresponds to a software version timestamp.
[0051] Specifically, for the time series features corresponding to the plurality of sub-features of the software version to be evaluated and the time series features corresponding to the plurality of sub-features of each historical software version, iteratively calculating each time series feature to determine a plurality of control chart statistics corresponding to each time series feature respectively.
[0052] For example, for the code entropy sub-feature in the plurality of sub-features of the software version to be evaluated, the time series feature thereof is determined as , ,..., According to the formula , wherein represents the control chart statistic determined in the last iteration, represents the offset value corresponding to the i-th iteration, t , represents the initial baseline mean, represents the reference value, which is usually 0.5, but is not limited thereto, and the present application does not specifically limit it, and persons skilled in the art can set it according to the actual situation. k
[0053] S133: determining the global mutation index corresponding to the software version to be evaluated and the plurality of historical software versions according to the plurality of control chart statistics and a preset threshold.
[0054] The preset threshold refers to a numerical value preset for determining the global mutation index.
[0055] Specifically, after obtaining the plurality of control chart statistics, the global mutation index corresponding to the software version to be evaluated and the plurality of historical software versions is determined according to the plurality of control chart statistics and the preset threshold.
[0056] Optionally, based on the above embodiment, in some embodiments of the present application, one implementation of S133 can be: S1331: judging whether the plurality of control chart statistics corresponding to the time series feature of each sub-feature of the software version to be evaluated and each historical software version is greater than the preset threshold.
[0057] S1332: if yes, determining the sub-feature corresponding to the control chart statistic as a mutation feature.
[0058] Specifically, after obtaining multiple control chart statistics corresponding to the time series features of each sub-feature of the high-dimensional feature vector of the software version to be evaluated, the values of each control chart statistic are compared with preset thresholds to determine whether each control chart statistic is greater than the preset threshold. When there is a control chart statistic that is greater than the preset threshold, the sub-feature of the current software version corresponding to that control chart statistic is determined to be a mutation feature.
[0059] S1333: Count the total number of multiple mutation features and determine the total number as the global mutation index.
[0060] Specifically, after obtaining multiple control chart statistics corresponding to the time series features of each sub-feature, the statistics are compared with preset thresholds to determine whether each statistic exceeds the preset threshold. If any control chart statistic exceeds the preset threshold, the sub-feature corresponding to that statistic in the current software version is identified as a mutation feature. Furthermore, the total number of all mutation features is counted, and this total number is determined as the global mutation index.
[0061] Optionally, based on the above embodiments, in some embodiments of the present invention, according to the formula... It is confirmed that, among them, Indicates the first Software versions, This represents the total number of sub-features corresponding to each software version. No. The software version of the 1st k Control chart statistics for each sub-feature This indicates a preset threshold.
[0062] S14: Based on Mahalanobis distance and multiple global mutation indices, determine the risk assessment indicators between the software version to be evaluated and the software version to be upgraded.
[0063] Specifically, after obtaining the Mahalanobis distance and multiple global mutation indices, risk assessment indicators are determined between the software version to be evaluated and the software version to be upgraded, based on the Mahalanobis distance and multiple global mutation indices.
[0064] Optionally, based on the above embodiments, in some embodiments of the present invention, one implementation of S14 may be: S141: Weighted fusion of Mahalanobis distance and multiple global mutation indices to obtain risk assessment indicators between the software version to be evaluated and the software version to be upgraded.
[0065] Specifically, according to the formula We weighted and fused Mahalanobis distance and multiple global mutation indices to obtain risk assessment indicators between the software version to be evaluated and the software version to be upgraded.
[0066] wherein, the first weight coefficient representing a Mahalanobis distance, the Mahalanobis distance, the second weight coefficient representing a cumulative global mutation index between the second historical software version and the software version to be evaluated in the plurality of historical software versions, the global mutation index of the second historical software version, the index of the second historical software version in the plurality of historical software versions. the cumulative distribution function of the standard normal distribution. Since the global mutation index is a non-negative integer, based on this, the cumulative global mutation index can be smoothly mapped to a probability scale of [0, 1] by the cumulative distribution function. When the cumulative global mutation index is very small, the risk grows slowly. It should be noted that when determining the risk assessment index, the global mutation index of the historical software version after the second historical software version in the plurality of historical software versions is accumulated to determine the existing global mutation index before the software version to be evaluated. The first weight coefficient and the second weight coefficient can be determined by using a logistic regression model.
[0067] In this way, the software upgrade risk prediction method provided by the embodiment can obtain high-dimensional feature vectors corresponding to the software version to be evaluated and the plurality of historical software versions, determine a sample covariance matrix according to the high-dimensional feature vectors corresponding to the plurality of historical software versions, determine a Mahalanobis distance between the software version to be evaluated and the software version to be upgraded according to the high-dimensional feature vector corresponding to the software version to be evaluated, the sample covariance matrix, and the high-dimensional feature vector corresponding to the current software version to be upgraded, determine global mutation indexes corresponding to the software version to be evaluated and the plurality of historical software versions respectively by using a cumulative sum control chart algorithm, and determine a risk assessment index between the software version to be evaluated and the software version to be upgraded according to the Mahalanobis distance and the plurality of global mutation indexes. In this way, by calculating the Mahalanobis distance between the high-dimensional feature vectors, the correlation between the multi-dimensional features can be fully considered, so that the differences between different software versions can be accurately captured. In addition, the global mutation indexes can be obtained by using the cumulative sum control chart algorithm, which can accurately locate the mutation features occurring in the evolution process of the software version. Finally, the risk assessment index is obtained by combining the Mahalanobis distance and the global mutation index, which improves the accuracy of the risk assessment index in the software upgrade process and effectively improves the prediction accuracy of the risk.
[0068] Embodiment two:
[0069] The application also provides a model training device, such as Figure 2 As shown, it comprises: a high-dimensional feature vector acquisition module 10, a sample covariance matrix determination module 11, a Mahalanobis distance determination module 12, a global mutation index determination module 13, and a risk assessment index determination module 14.
[0070] The high-dimensional feature vector acquisition module 10 is configured to acquire high-dimensional feature vectors corresponding to the software version to be evaluated and a plurality of historical software versions.
[0071] The sample covariance matrix determination module 11 is configured to determine a sample covariance matrix according to the high-dimensional feature vectors corresponding to the plurality of historical software versions.
[0072] The Mahalanobis distance determination module 12 is configured to determine a Mahalanobis distance between the software version to be evaluated and the software version to be upgraded according to the high-dimensional feature vector corresponding to the software version to be evaluated, the sample covariance matrix, and the high-dimensional feature vector corresponding to the current software version to be upgraded.
[0073] The global mutation index determination module 13 is configured to determine global mutation indexes corresponding to the software version to be evaluated and the plurality of historical software versions by a cumulative sum control chart algorithm for the plurality of high-dimensional feature vectors.
[0074] The risk assessment index determination module 14 is configured to determine a risk assessment index between the software version to be evaluated and the software version to be upgraded according to the Mahalanobis distance and the plurality of global mutation indexes.
[0075] In this embodiment, the high-dimensional feature vector acquisition module acquires high-dimensional feature vectors corresponding to the software version to be evaluated and a plurality of historical software versions. The sample covariance matrix determination module determines a sample covariance matrix according to the high-dimensional feature vectors corresponding to the plurality of historical software versions. The Mahalanobis distance determination module determines a Mahalanobis distance between the software version to be evaluated and the software version to be upgraded according to the high-dimensional feature vector corresponding to the software version to be evaluated, the sample covariance matrix, and the high-dimensional feature vector corresponding to the current software version to be upgraded. The global mutation index determination module determines global mutation indexes corresponding to the software version to be evaluated and the plurality of historical software versions by a cumulative sum control chart algorithm for the plurality of high-dimensional feature vectors. The risk assessment index determination module determines a risk assessment index between the software version to be evaluated and the software version to be upgraded according to the Mahalanobis distance and the plurality of global mutation indexes. Thus, by calculating the Mahalanobis distance between high-dimensional feature vectors, the correlation between multi-dimensional features can be fully considered, thereby more accurately capturing the differences between different software versions. In addition, the global mutation index can be accurately positioned by using the cumulative sum control chart algorithm to obtain the global mutation index. Finally, the risk assessment index is obtained by combining the Mahalanobis distance and the global mutation index, which improves the accuracy of the risk assessment index in the software upgrading process and effectively improves the accuracy of the predicted risk.
[0076] Embodiment three: The application further provides an electronic device, such as Figure 3 As shown in the figure, the electronic device comprises a processor 1101, a memory 1102, a bus 1103, and a computer program stored in the memory 1102 and executable on the processor 1101, the processor 1101 comprising one or more than one processing core, the memory 1102 being connected to the processor 1101 through the bus 1103, the memory 1102 being used for storing program instructions, and the processor implementing the steps in the above method embodiments of the embodiment one of the application when executing the computer program.
[0077] Further, as an executable solution, the electronic device can be a computer unit, which can be a desktop computer, a notebook, a palm computer, a cloud server, and the like. The computer unit can comprise, but is not limited to, a processor and a memory. Those skilled in the art can understand that the above-mentioned constituent structure of the computer unit is merely an example of the computer unit, and does not constitute a limitation on the computer unit, and can comprise more or fewer components than the above, or combine certain components, or different components. For example, the computer unit can also comprise an input / output device, a network access device, a bus, and the like, and the embodiments of the application do not limit this.
[0078] Further, as an executable solution, the processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, and the like. The processor is the control center of the computer unit, and connects all parts of the computer unit through various interfaces and lines.
[0079] The memory can be used to store the computer program and / or modules, and the processor realizes various functions of the computer unit by running or executing the computer program and / or modules stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system and at least one application required by a function; and the data storage area can store data created according to the use of the mobile phone and the like. In addition, the memory can include a high-speed random access memory, and can also include a nonvolatile memory, for example, a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash storage device, or other volatile solid-state storage devices.
[0080] Although the present application is specifically shown and described in connection with the preferred embodiments, those skilled in the art will appreciate that various modifications in form and detail can be made without departing from the spirit and scope of the application as defined by the appended claims.
Claims
1. A method for predicting software upgrade risks, characterized in that, The method includes: Obtain the high-dimensional feature vectors corresponding to the software version to be evaluated and multiple historical software versions; The sample covariance matrix is determined based on the high-dimensional feature vectors corresponding to multiple historical software versions. Based on the high-dimensional feature vector corresponding to the software version to be evaluated, the sample covariance matrix, and the high-dimensional feature vector corresponding to the current software version to be upgraded, the Mahalanobis distance between the software version to be evaluated and the software version to be upgraded is determined. For multiple high-dimensional feature vectors, the global mutation index corresponding to the software version to be evaluated and multiple historical software versions is determined by the cumulative sum control graph algorithm; Based on the Mahalanobis distance and multiple global mutation indices, risk assessment indicators are determined between the software version to be evaluated and the software version to be upgraded.
2. The method according to claim 1, characterized in that, The high-dimensional feature vector includes: code dimension features, quality dimension features, and semantic dimension features; The code dimension features include: code entropy sub-feature, API interface change rate sub-feature, and key architecture module coupling degree change sub-feature; The quality dimension features include: defect density sub-feature, test case pass rate change sub-feature, and static analysis alarm growth rate sub-feature; The semantic dimension features include: the emotional features of the release description and the frequency features of change keywords.
3. The method according to claim 2, characterized in that, The step of determining the Mahalanobis distance between the software version to be evaluated and the software version to be upgraded based on the high-dimensional feature vector corresponding to the software version to be evaluated, the sample covariance matrix, and the high-dimensional feature vector corresponding to the current software version to be upgraded includes: Determine the inverse matrix corresponding to the sample covariance matrix; The high-dimensional feature vector corresponding to the software version to be evaluated, the inverse matrix, and the high-dimensional feature vector corresponding to the software version to be upgraded are substituted into the Mahalanobis distance calculation formula to calculate and determine the Mahalanobis distance.
4. The method according to claim 3, characterized in that, The formula for calculating Mahalanobis distance can be defined by the following expression: in, This represents the high-dimensional feature vector corresponding to the software version to be upgraded. This represents the high-dimensional feature vector corresponding to the software version to be evaluated. This represents the inverse matrix corresponding to the sample covariance matrix. Represents a matrix.
5. The method according to claim 4, characterized in that, The step involves determining the global mutation index corresponding to the software version to be evaluated and multiple historical software versions, respectively, using a cumulative sum control graph algorithm for multiple high-dimensional feature vectors, including: For the software version to be evaluated and multiple historical software versions, the time series features corresponding to each sub-feature are obtained; For each time series feature, iterative calculations are performed to determine multiple control chart statistics corresponding to each time series feature; Based on the statistics of the multiple control charts and preset thresholds, the global mutation index corresponding to the software version to be evaluated and multiple historical software versions is determined.
6. The method according to claim 5, characterized in that, The step of determining the global mutation index corresponding to the software version to be evaluated and multiple historical software versions based on the multiple control chart statistics and preset thresholds includes: For the time series features of each sub-feature corresponding to the software version to be evaluated and each historical software version, determine whether the multiple control chart statistics corresponding to the time series features are greater than the preset threshold. If so, then the sub-feature corresponding to the control chart statistic is determined to be a mutation feature; The total number of multiple mutation features is counted, and the total number is determined as the global mutation index.
7. The method according to claim 6, characterized in that, The step of determining the risk assessment indicators between the software version to be evaluated and the software version to be upgraded, based on the Mahalanobis distance and multiple global mutation indices, includes: The Mahalanobis distance and multiple global mutation indices are weighted and fused to obtain the risk assessment index between the software version to be evaluated and the software version to be upgraded.
8. The method according to claim 7, characterized in that, The step of weightedly fusing the Mahalanobis distance and multiple global mutation indices to obtain the risk assessment index between the software version to be evaluated and the software version to be upgraded includes: According to the formula The aforementioned risk assessment indicators were obtained; in, This represents the first weighting coefficient of the Mahalanobis distance. This represents the Mahalanobis distance. This represents the second weighting coefficient of the cumulative global mutation index between the second historical software version out of multiple historical software versions and the software version to be evaluated. Indicates the first Global mutation index for each software version This represents the index of the second historical software version out of multiple historical software versions. surface This represents the cumulative distribution function of the standard normal distribution.
9. A software upgrade risk prediction device, characterized in that, include: The high-dimensional feature vector acquisition module is used to acquire the high-dimensional feature vectors corresponding to the software version to be evaluated and multiple historical software versions, respectively. The sample covariance matrix determination module is used to determine the sample covariance matrix based on the high-dimensional feature vectors corresponding to multiple historical software versions. The Mahalanobis distance determination module is used to determine the Mahalanobis distance between the software version to be evaluated and the software version to be upgraded based on the high-dimensional feature vector corresponding to the software version to be evaluated, the sample covariance matrix, and the high-dimensional feature vector corresponding to the current software version to be upgraded. The global mutation index determination module is used to determine the global mutation index corresponding to the software version to be evaluated and multiple historical software versions respectively, based on multiple high-dimensional feature vectors, through the cumulative sum control graph algorithm. The risk assessment index determination module is used to determine the risk assessment index between the software version to be assessed and the software version to be upgraded based on the Mahalanobis distance and multiple global mutation indices.
10. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the software upgrade risk prediction method according to any one of claims 1 to 8.