Intelligent software project risk prediction method and system based on AI algorithm

By using a multimodal risk modeling method based on AI algorithms, the problems of single feature dimensions and insufficient model generalization ability in software project risk prediction are solved. This method achieves high-precision risk level classification and quantitative assessment, thereby enhancing the practical guiding value of risk prediction.

CN121599449APending Publication Date: 2026-03-03SHANGHAI FAITH INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511510249.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-22
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

Existing technologies for software project risk prediction suffer from limited feature dimensions, insufficient model generalization ability, and a lack of quantitative analysis tools. They are unable to fully characterize the multimodal features and complex dependencies in the dynamic evolution of projects, resulting in insufficient practical guiding value of the prediction results.

Method used

A multimodal risk modeling method based on AI algorithms is adopted, which achieves multimodal feature fusion and high-precision quantitative assessment through multi-source data acquisition, data preprocessing, feature engineering and risk prediction model construction, including hybrid feature set construction, dual-channel hybrid neural network architecture and Monte Carlo simulation.

Benefits of technology

It enhances the ability to model software project risks, provides high-precision risk level classification and quantitative delay assessment, supports risk response strategies, and solves the problems of single feature dimensions and insufficient model generalization ability in traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121599449A_ABST
    Figure CN121599449A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of software engineering, and discloses a software project risk intelligent prediction method based on an AI algorithm, and the method comprises the following steps: S1, collecting multi-source data; s2, data preprocessing; s3, performing feature engineering; s4, constructing a risk prediction model; s5, model training; and S6, risk prediction and updating. According to the software project risk intelligent prediction method and system based on the AI algorithm, an interface calling module for multi-source data acquisition is connected with a software project management system, a code warehouse, a demand management platform and a test tool to obtain multi-dimensional data, and the multi-dimensional data is processed by a three-level cleaning mechanism for data preprocessing; a sliding window method of feature engineering, a graph isomorphic network and a TextCNN respectively extract time sequence features, structural features and semantic features to construct a mixed feature set, multi-modal information is fused by a time sequence branch, a graph branch and a multi-head attention fusion layer of a dual-channel mixed neural network of a risk prediction model, and multi-modal features of project dynamic evolution are comprehensively described.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of software engineering technology, specifically to a method and system for intelligent prediction of software project risks based on AI algorithms. Background Technology

[0002] Software project risk refers to the potential for negative consequences such as project delays, cost overruns, or substandard quality that may occur during the software development process due to uncertainties in factors such as requirement changes, resource allocation, technical complexity, and team collaboration. Essentially, it is the risk of deviation between project objectives and actual results, which is usually manifested as specific indicators such as critical path deviation, work hour fluctuations, and increased code defect rate. Moreover, risk factors are characterized by multi-source heterogeneity, dynamic evolution, and high coupling, and need to be identified and controlled through systematic prediction and management methods.

[0003] Existing technologies for software project risk prediction suffer from core problems such as limited feature dimensions, insufficient model generalization ability, and lack of quantitative assessment. Traditional methods often rely on human experience or single-dimensional data, such as WBS planning time or code complexity, making it difficult to comprehensively depict the multimodal characteristics of the project's dynamic evolution. This results in insufficient modeling capabilities for complex dependencies, such as code module call chains, and the correlation between requirement changes and schedules. Furthermore, existing prediction models often employ linear regression or simple neural networks, failing to effectively integrate temporal dependencies, graph structure features, and semantic information. They also lack tools for quantitative analysis of risk probabilities, such as Monte Carlo simulation-based schedule distribution simulation, making it difficult to provide high-precision risk level classification and response strategy support. Consequently, the practical guiding value of the prediction results is limited. Therefore, this paper proposes an intelligent prediction method and system for software project risks based on AI algorithms. Summary of the Invention

[0004] (a) Technical problems to be solved To address the shortcomings of existing technologies, this invention provides a software project risk intelligent prediction method and system based on AI algorithms. It has advantages such as multimodal risk modeling, dynamic feature fusion, and high-precision quantitative assessment, and solves the problems of traditional methods such as single feature dimension, insufficient model generalization ability, and lack of quantitative analysis tools for risk prediction.

[0005] (II) Technical Solution To achieve the aforementioned objectives of multimodal risk modeling, dynamic feature fusion, and high-precision quantitative assessment, this invention provides the following technical solution: an intelligent prediction method for software project risks based on AI algorithms, comprising the following steps: S1. Multi-source data collection: Through interface call modules, connect to the software project management system, code repository, requirements management platform and testing tools to collect four types of data, including WBS decomposition data, historical project progress records, code static analysis results and requirements change logs. The WBS decomposition data should include the prerequisite dependencies and planned work hours of each sub-activity, and the code static analysis results should cover 20 software metrics such as cyclomatic complexity, lines of code, and comment rate. S2. Data Preprocessing: A three-level cleaning mechanism is adopted. The first level removes duplicate records through hash verification. The second level identifies outliers based on the 3σ principle and repairs them using the nearest neighbor mean interpolation method. The third level uses Z-score standardization to map numerical features to a distribution range with a mean of 0 and a standard deviation of 1. For text-based requirement change logs, word segmentation and stop word removal are performed, and then the logs are transformed into 128-dimensional vectors using a word vector model. S3. Feature Engineering: Construct a hybrid feature set, including time series features, structural features, and semantic features. Time series features are extracted from historical progress data using a sliding window method to extract the activity time volatility and critical path deviation rate of the last three iterations. Structural features are based on the program dependency graph and use a graph isomorphic network to extract the call relationship features between code modules. The network contains three graph convolutional layers, with each layer having node embedding dimensions of 64, 128, and 256. Semantic features are extracted from the requirements document using TextCNN. The convolutional layers use 16 kernels of three different sizes: 3×128, 5×128, and 7×128, outputting a 256-dimensional semantic vector. S4. Risk Prediction Model Construction: A dual-channel hybrid neural network architecture is adopted, including a temporal branch, a graph branch, a fusion layer, and an output layer. The temporal branch is an improved LSTM network with two bidirectional LSTM layers and a hidden layer dimension of 256. A gating regulator is introduced into the memory cells to enhance the ability to capture long-term dependencies. The graph branch uses a GAT network to process program dependency graph features and has two attention mechanism layers with four attention heads per node. The fusion layer achieves cross-modal feature fusion through an 8-head attention mechanism, with an attention weight matrix dimension of 512×512. The output layer adopts a dual-output structure, outputting risk probabilities (0-1) through a Sigmoid activation function and five risk levels through Softmax. S5. Model Training: The Adam optimizer is used, with an initial learning rate of 0.001. Cosine annealing is employed to adjust the learning rate. The loss function is weighted cross-entropy, where the weight of high-risk samples is set to three times that of low-risk samples. The formula is as follows:

[0006] in The labels are real (1 indicates high risk, 0 indicates low risk). To predict probabilities, is the weight coefficient; during training, a validation set evaluation is performed every 5 epochs, and an early stopping mechanism is triggered when there is no improvement after 3 consecutive evaluations. S6. Risk Prediction and Update: Real-time access to project dynamic data; recalculation of features and input into the model every 24 hours; output of a prediction report including risk probability, top 5 influencing factors, and mitigation suggestions; when the predicted risk level is ≥3, automatic triggering of Monte Carlo simulation; random generation of work hours based on the BetaPERT distribution (α=2, β=2) of each sub-activity; calculation of the total project duration 10,000 times based on WBS dependencies; generation of duration probability distribution curve using kernel density estimation, where the probability of schedule delay = P ( T (Planned construction period) × 100% P ( T >Planned construction period) × 100%, T To simulate the total project duration.

[0007] Preferably, in the multi-source data acquisition step, static code analysis is implemented by calling a code quality analysis tool API, and cyclomatic complexity is calculated by controlling the number of nodes and edges in the flow graph, using the following formula:

[0008] in Let be the number of sides. For the number of nodes, The number of connected components; historical project progress records must contain complete lifecycle data for at least 5 similar projects, and the WBS decomposition level for each project must be no less than 4 levels.

[0009] Preferably, in the feature engineering step, the time series feature extraction adopts the following formula: Activity duration volatility is calculated as the ratio of standard deviation to mean, using the following formula:

[0010] in For the first Actual working hours of each iteration Historical average working hours This represents the number of iterations; when the number of iterations is less than 3, the median of similar projects is used to fill in the required parameters for calculation. Critical path deviation rate is calculated by comparing the actual performance with the planned performance, using the following formula:

[0011] This indicator reflects the degree of deviation between the actual progress and the planned progress of the critical path during project execution.

[0012] Preferably, in the time-series branch of the risk prediction model, the gating mechanism of the improved LSTM satisfies the following calculation steps: Forget gate calculation: Input the hidden state of the previous time step With current input The concatenated vector, through the weight matrix and bias terms Perform a linear transformation, followed by the Sigmoid function. Activate to obtain the Forgotten Gate ; Input gate computation: Similarly, a linear transformation is performed on the concatenated vector, using the weight matrix. Sum and bias terms via the Sigmoid function Activate to get the input gate ; Cell state update: The forget gate Cell state at the previous moment Multiplication, plus input gate and The product; Output gate calculation: Perform a linear transformation on the concatenated vector, and then pass it through the weight matrix. and bias terms via the Sigmoid function Activate to get the output gate ; Hidden state calculation: output gate and Multiply to obtain the hidden state at the current time. .

[0013] Preferably, the Monte Carlo simulation steps are as follows: based on the sub-activities decomposed by WBS, a probability model conforming to the BetaPERT distribution is set for the time consumption of each sub-activity; 10,000 sets of sub-activity time consumption data are generated by random sampling; the total project duration is calculated based on the pre-dependencies of the sub-activities; the probability distribution curve and 95% confidence interval of the total duration are generated by kernel density estimation; and the quantitative assessment result of the project delay is output.

[0014] A software project risk intelligent prediction system based on AI algorithms, comprising: Data Acquisition Layer: Contains 4 dedicated collectors: the project management collector obtains WBS data through the project management system API, the code collector captures code commit records in real time through code repository WebHook, the requirement collector uses web crawling technology to parse requirement management platform documents, and the test collector connects to continuous integration tools to obtain test reports; each collector is configured with a 512MB cache pool and supports breakpoint resume. Preprocessing engine: It consists of a hash deduplication module, an anomaly repair module, and a feature transformation module. The anomaly repair module adopts a stream processing framework with a processing latency of ≤100ms. The feature transformation module has a built-in word vector model (word vector dimension 128, window size 5). Feature computation nodes: Three types of computation units are deployed. The temporal feature unit adopts the sliding window algorithm (window size is configurable), the structural feature unit runs the graph isomorphic network inference engine, and the semantic feature unit integrates the TextCNN model (containing 3 types of convolution kernels). Predictive model service: It adopts a distributed deployment architecture with 8 inference nodes, each node is configured with a GPU (≥16GB of video memory), and the model parameters are dynamically scheduled through Kubernetes; the model architecture includes temporal branches (improved LSTM), graph branches (GAT) and multi-head attention fusion layer; Visualization terminal: Provides a risk dashboard, including a WBS risk heatmap (node ​​color mapping risk probability), trend curves (results of the last 10 predictions), and a Monte Carlo simulation histogram of project duration distribution, and supports exporting prediction reports in PDF format.

[0015] Preferably, the project management collector of the data acquisition layer connects to the project management system through an authentication protocol, calls the interface to obtain task data in batches, and parses fields including planned working hours, actual working hours, and dependencies. The data update frequency is set to once per hour, and an incremental synchronization mechanism is adopted.

[0016] Preferably, the GAT network layer in the prediction model service satisfies the following conditions: The input layer receives 256-dimensional node features; Attention layer 1 calculates the attention coefficient ,in It has 128 learnable parameters. The weight matrix is ​​(256×128). and Representing nodes respectively i and nodes j eigenvectors; Attention layer 2 outputs 128-dimensional node features, employing a 4-head attention mechanism; The output layer obtains graph-level feature vectors through global mean pooling, and each layer is configured with a Dropout layer (ratio 0.2) to prevent overfitting.

[0017] Preferably, the risk heatmap of the visualization terminal uses a WBS decomposition structure as a tree skeleton, with each node's color mapping risk probability (0-1 corresponding to a green-red gradient), and the node size mapping the influence factor (calculated through SHAP values). Clicking on a node can display the top 3 risk factors of the activity and the Monte Carlo simulation's histogram of the project duration distribution.

[0018] (III) Beneficial Effects Compared with existing technologies, this invention provides a method and system for intelligent prediction of software project risks based on AI algorithms, which has the following beneficial effects: 1. This AI-based intelligent prediction method and system for software project risks obtains multi-dimensional data by connecting to software project management systems, code repositories, requirement management platforms, and testing tools through multi-source data acquisition interface call modules. After a three-level data preprocessing cleaning mechanism, feature engineering methods such as sliding window method, graph isomorphic network, and TextCNN extract time series features, structural features, and semantic features to construct a hybrid feature set. Then, the risk prediction model's dual-channel hybrid neural network integrates multimodal information through time-series branches, graph branches, and multi-head attention fusion layers, comprehensively depicting the multimodal characteristics of the project's dynamic evolution and improving the modeling ability for complex dependencies such as code module call chains, requirement changes, and schedule correlations.

[0019] 2. The AI-based software project risk intelligent prediction method and system features a dual-channel architecture in the risk prediction model. An improved LSTM enhances long-term dependency capture, a GAT network processes graph structure features, and a fusion layer achieves cross-modal fusion to improve the model's generalization ability. In the risk prediction and update phase, Monte Carlo simulation generates the project duration distribution based on WBS dependency relationships. Combined with the risk probability and level classification of the output layer, it provides quantitative delay assessment, solves the problem of missing quantitative assessment, and provides high-precision support for risk response. Attached Figure Description

[0020] Figure 1 This is a flowchart of the intelligent prediction method for software project risks according to the present invention; Figure 2 This is a diagram of the intelligent prediction system architecture for software project risks according to the present invention. Detailed Implementation

[0021] The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments and 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.

[0022] Please see Figure 1-2 A software project risk intelligent prediction method based on AI algorithms includes the following steps: S1. Multi-source data collection: Through interface call modules, connect to the software project management system, code repository, requirements management platform and testing tools to collect four types of data, including WBS decomposition data, historical project progress records, code static analysis results and requirements change logs. The WBS decomposition data should include the prerequisite dependencies and planned work hours of each sub-activity, and the code static analysis results should cover 20 software metrics such as cyclomatic complexity, lines of code, and comment rate. S2. Data Preprocessing: A three-level cleaning mechanism is adopted. The first level removes duplicate records through hash verification. The second level identifies outliers based on the 3σ principle and repairs them using the nearest neighbor mean interpolation method. The third level uses Z-score standardization to map numerical features to a distribution range with a mean of 0 and a standard deviation of 1. For text-based requirement change logs, word segmentation and stop word removal are performed, and then the logs are transformed into 128-dimensional vectors using a word vector model. S3. Feature Engineering: Construct a hybrid feature set, including time series features, structural features, and semantic features. Time series features are extracted from historical progress data using a sliding window method to extract the activity time volatility and critical path deviation rate of the last three iterations. Structural features are based on the program dependency graph and use a graph isomorphic network to extract the call relationship features between code modules. The network contains three graph convolutional layers, with each layer having node embedding dimensions of 64, 128, and 256. Semantic features are extracted from the requirements document using TextCNN. The convolutional layers use 16 kernels of three different sizes: 3×128, 5×128, and 7×128, outputting a 256-dimensional semantic vector. S4. Risk Prediction Model Construction: A dual-channel hybrid neural network architecture is adopted, including a temporal branch, a graph branch, a fusion layer, and an output layer. The temporal branch is an improved LSTM network with two bidirectional LSTM layers and a hidden layer dimension of 256. A gating regulator is introduced into the memory cells to enhance the ability to capture long-term dependencies. The graph branch uses a GAT network to process program dependency graph features and has two attention mechanism layers with four attention heads per node. The fusion layer achieves cross-modal feature fusion through an 8-head attention mechanism, with an attention weight matrix dimension of 512×512. The output layer adopts a dual-output structure, outputting risk probabilities (0-1) through a Sigmoid activation function and five risk levels through Softmax. S5. Model Training: The Adam optimizer is used, with an initial learning rate of 0.001. Cosine annealing is employed to adjust the learning rate. The loss function is weighted cross-entropy, where the weight of high-risk samples is set to three times that of low-risk samples. The formula is as follows:

[0023] in The labels are real (1 indicates high risk, 0 indicates low risk). To predict probabilities, is the weight coefficient; during training, a validation set evaluation is performed every 5 epochs, and an early stopping mechanism is triggered when there is no improvement after 3 consecutive evaluations. S6. Risk Prediction and Update: Real-time access to project dynamic data; recalculation of features and input into the model every 24 hours; output of a prediction report including risk probability, top 5 influencing factors, and mitigation suggestions; when the predicted risk level is ≥3, automatic triggering of Monte Carlo simulation; random generation of work hours based on the BetaPERT distribution (α=2, β=2) of each sub-activity; calculation of the total project duration 10,000 times based on WBS dependencies; generation of duration probability distribution curve using kernel density estimation, where the probability of schedule delay = P ( T (Planned construction period) × 100% P ( T >Planned construction period) × 100%, T To simulate the total project duration.

[0024] A software project risk intelligent prediction system based on AI algorithms, comprising: Data Acquisition Layer: Contains 4 dedicated collectors: the project management collector obtains WBS data through the project management system API, the code collector captures code commit records in real time through code repository WebHook, the requirement collector uses web crawling technology to parse requirement management platform documents, and the test collector connects to continuous integration tools to obtain test reports; each collector is configured with a 512MB cache pool and supports breakpoint resume. Preprocessing engine: It consists of a hash deduplication module, an anomaly repair module, and a feature transformation module. The anomaly repair module adopts a stream processing framework with a processing latency of ≤100ms. The feature transformation module has a built-in word vector model (word vector dimension 128, window size 5). Feature computation nodes: Three types of computation units are deployed. The temporal feature unit adopts the sliding window algorithm (window size is configurable), the structural feature unit runs the graph isomorphic network inference engine, and the semantic feature unit integrates the TextCNN model (containing 3 types of convolution kernels). Predictive model service: It adopts a distributed deployment architecture with 8 inference nodes, each node is configured with a GPU (≥16GB of video memory), and the model parameters are dynamically scheduled through Kubernetes; the model architecture includes temporal branches (improved LSTM), graph branches (GAT) and multi-head attention fusion layer; Visualization terminal: Provides a risk dashboard, including a WBS risk heatmap (node ​​color mapping risk probability), trend curves (results of the last 10 predictions), and a Monte Carlo simulation histogram of project duration distribution, and supports exporting prediction reports in PDF format.

[0025] Example 1: This embodiment focuses on a medical industry HIS software development project, and fully implements an AI-based intelligent risk prediction method for software projects. The specific steps are as follows: During the multi-source data acquisition phase, the module was connected to four types of systems via interface calls. The project management system used Jira, a commonly used project management tool, was called to obtain WBS decomposition data, including the ID of each sub-activity, the parent activity ID, the planned work hours, the actual work hours, and the prerequisite dependencies. For example, "requirements design" depends on "prototype design". A total of 12 levels of WBS data were collected, involving 32 sub-activities. The code repository uses Git and employs a WebHook mechanism to capture code commit records in real time, including the number of lines of code for each commit, modified file paths, and static analysis results. Static analysis is implemented by integrating the SonarQube tool, obtaining 20 software metrics such as cyclomatic complexity, lines of code, and comment rate. Cyclomatic complexity is calculated using the formula... For example, if a module's control flow graph has 15 nodes, 20 edges, and 1 connected component, its cyclomatic complexity is 20 - 15 + 2 × 1 = 7. The requirements management platform uses Confluence, which uses the Scrapy framework, a web crawler, to parse requirements documents and change logs, and extract requirements descriptions, change times, and change content. The testing tool uses Jenkins and connects to its API to obtain test reports, including test case pass rate, number of defects and severity. The four types of data are stored in the time series database InfluxDB and are incrementally synchronized once per hour.

[0026] During the data preprocessing stage, a three-stage cleaning process is performed: The first level of hash verification calculates the MD5 value for each record to remove duplicate data, such as multiple submission records of the same requirement change. Second-level outlier handling, based on 3 The principle is to calculate the average value of the work hour data. =8 days, standard deviation =2 days, will be greater than +3 That is, 14 days or less -3 That is, records of 2 days are judged as outliers and are filled with the average of the three nearest records. For example, if the outlier is 15 days, the nearest records are 10, 11, and 12 days, and the filling value is 11 days. The third level of standardization uses Z-score to map numerical features such as working hours and cyclomatic complexity to a distribution interval with a mean of 0 and a standard deviation of 1. The standardized value of a certain working hour over 10 days is (10-8) / 2=1. For the text - type requirement change log, use the jieba word - segmentation tool for word segmentation, remove stop words such as "的" and "在" (using the Harbin Institute of Technology stop - word list), train a Word2Vec model through the gensim library with a window size of 5 and 100 iterations, and convert the text into 128 - dimensional word vectors.

[0027] In the feature engineering stage, construct three types of features; for time - series features, use the sliding - window method with a window size set to 3 iterations, and calculate the activity - time consumption volatility and the critical - path deviation rate. The working hours of a certain sub - activity in the last 3 iterations are 8, 10, and 12 days, and the average = 10, and the volatility is √[((8 - 10) 2 +(10 - 10) 2 +(12 - 10) 2 ) / 3] / 10≈0.163; the planned critical - path working hours are 100 days, and the actual is 105 days, and the deviation rate is (105 - 100) / 100 = 0.05. For structural features, based on the program - dependence graph, use the SourceDG tool to generate, and implement a graph - isomorphism network through the DGL library. The network contains 3 graph - convolutional layers. The input node features are 20 - dimensional software metrics. The output of the first layer is 64 - dimensional embeddings, the second layer is 128 - dimensional, and the third layer is 256 - dimensional. The activation function for all layers is ReLU. For semantic features, use TextCNN. The input is a 128 - dimensional word - vector sequence of the requirement document. The convolutional layer uses 16 convolution kernels of three sizes: 3×128, 5×128, and 7×128. After max - pooling, they are concatenated into a 256 - dimensional semantic vector.

[0028] The risk - prediction model is constructed using a dual-channel architecture. The time - series branch is an improved LSTM, which contains 2 layers of bidirectional LSTM with a hidden - layer dimension of 256. A gating adjustment factor is introduced into the memory cell and is calculated as the mean of the hidden states of the previous 3 time steps. The forget gate is used to enhance the ability to capture long - term dependencies. The graph branch is a GAT network. The input is 256 - dimensional node features. The first - layer attention calculation

[0029] is a 128 - dimensional learnable parameter, is a 256×128 weight matrix. The 4 - head attention mechanism is adopted, and the output is 512 - dimensional features. The second layer is also 4 - head attention, and the output is 256 - dimensional graph features. The fusion layer achieves cross-modal fusion through an 8-head attention mechanism. The Q, K, and V matrices are all 512×64 in dimension. After concatenation, a linear transformation is performed to output a 512-dimensional fusion feature. The output layer adopts dual outputs: Sigmoid activation outputs the risk probability of 0-1, and Softmax outputs 5 risk levels: level 1 is 0-0.2, level 2 is 0.2-0.4, level 3 is 0.4-0.6, level 4 is 0.6-0.8, and level 5 is 0.8-1.0.

[0030] During the model training phase, the PyTorch framework was used, with Adam as the optimizer. 1 = 0.9 2 = 0.999 =1 e -8, initial learning rate 0.001, using cosine annealing strategy. =100, =1 e -5 adjusts the learning rate.

[0031] The loss function is weighted cross-entropy, where high-risk samples (label 1) have a weight of 3, and low-risk samples (label 0) have a weight of 1. The formula is as follows: .

[0032] Every 5 epochs, the F1 score is evaluated using the validation set, which accounts for 20% of the total data. Early stopping is triggered when there is no improvement after 3 consecutive evaluations. The final model achieved an F1 score of 0.87 on the validation set.

[0033] During the risk prediction and update phase, dynamic project data is accessed through Kafka, and Airflow schedules tasks to recalculate features and input them into the model every 24 hours, outputting a prediction report, including risk probabilities such as 0.65, the top 5 impact factors (i.e., high code complexity, frequent requirement changes, critical path deviation rate of 0.05), and corresponding suggestions such as increasing code review frequency and freezing non-critical requirement changes. When the predicted risk level is ≥3 (e.g., 0.65 corresponds to level 4), Monte Carlo simulation is automatically triggered. Based on the BetaPERT distribution of each sub-activity, α=2, β=2, minimum = planned time × 0.8, maximum = planned time × 1.2, mode = planned time, 10,000 sets of time data are generated using numpy.random. The total project duration is calculated using the networkx library according to the WBS dependency relationship. The project duration probability distribution curve is generated using scipy.stats.gaussian_kde, where the probability of the project duration being 200 days longer than the planned duration is 32%, i.e., the delay probability is 32%.

[0034] Example 2: This embodiment focuses on the specific implementation of multi-source data acquisition and preprocessing, taking a financial industry trading system development project as an example: When collecting data from multiple sources, the project management collector connects to Azure DevOps and calls the API through OAuth2.0 authentication to obtain work item data in batches. The parsed fields include ID, ParentID (dependency relationship), OriginalEstimate (planned work hours), and CompletedWork (actual work hours). Data from 5 similar historical projects are collected. Each project has a WBS decomposition level of 4-6 levels and is stored in JSON format.

[0035] The code collector interfaces with GitLab, configuring WebHook trigger events to "push" and "merge_request" to capture code commit records in real time, including commit hashes, authors, lists of modified files, and code diffs. It uses the GitPython library to parse changes in line counts and integrates PMD tools to calculate static metrics, such as cyclomatic complexity = 5, line count = 200, and comment rate = 15% for a given class. The requirements collector targets IBM RationalDOORS, using its DXL scripts to export requirements documents and change logs, extracting requirement IDs, descriptions, change dates, and change details.

[0036] The test collector interfaces with TestRail to obtain test case execution results, including the number of passes, failures, blocked tests, and defect links.

[0037] In data preprocessing, the hash deduplication module calculates the SHA-256 hash value for each record, such as work items and code submissions, compares the hash values, and removes duplicate submissions of the same code.

[0038] The anomaly repair module uses the Flink stream processing framework, with processing latency controlled within 80ms. It calculates time data, such as the time of a sub-activity (2, 3, 25 days). =10、 =10.6, 25 days is determined to be an outlier, and the median of the first 5 records (3 days) is used to fill the gap.

[0039] The feature transformation module uses sklearn's StandardScaler to standardize numerical features with Z-score, uses NLTK to segment the requirement change log (text), removes punctuation and stop words, and generates word vectors with a dimension of 128 using a pre-trained GloVe model, filling missing words with random vectors.

[0040] Example 3: This embodiment details the implementation process of feature engineering, taking a backend development project of an e-commerce platform as an example: When extracting time series features, the sliding window size is set to 3 iterations, with each iteration lasting 2 weeks. For the "Order Module Development" sub-activity, the actual working hours for the last 3 iterations were 14, 16, and 18 days, respectively. The calculated mean μ=16, and the volatility is √[((14-16)]. 2 +(16-16) 2 +(18-16) 2 ) / 3] / 16≈0.102.

[0041] The critical path includes "order module development", "payment module development" and "integration testing". The planned total time was 50 days, the actual total time was 55 days, and the deviation rate was (55-50) / 50=0.1.

[0042] Structural feature extraction is based on the Program Dependency Graph (PDG). The LLVM tool is used to generate the control flow and data dependencies of the code, and a graph structure with nodes as functions and edges as call relationships is constructed, containing 120 nodes and 180 edges. The graph isomorphic network is implemented through PyTorchGeometric.

[0043] The first layer of the graph convolutional layer takes 10-dimensional features of the nodes as input, such as the number of parameters and the return value type, and outputs a 64-dimensional embedding. The weight matrix is ​​initialized using Xavier.

[0044] The second layer has 64-dimensional input and 128-dimensional output.

[0045] The third layer has 128-dimensional input and 256-dimensional output. Each layer adds BatchNorm and Dropout at a ratio of 0.2.

[0046] Semantic feature extraction is performed on requirement documents such as "implement the function of automatically canceling user orders after timeout". After word segmentation using spaCy, the text is processed by the TextCNN model.

[0047] The input is a 128-dimensional word vector sequence with a length of 50, padded with 0 if necessary. The convolutional layers use 3×128 (16), 5×128 (16), and 7×128 (16) convolutional kernels with a stride of 1 and padding=1. After ReLU activation, the kernels are max-pooled to 1×1 and concatenated to form a 256-dimensional vector. The result is 16×3×53=2544, which is obtained through a 256-dimensional linear transformation.

[0048] Example 4: This embodiment focuses on the construction and training of a risk prediction model, using a government system development project as an example: An improved LSTM with a time-series branch, taking 256-dimensional time-series features as input, with a first-layer bidirectional LSTM hidden layer of 256 dimensions and a forget gate. ,in That is, the mean of the hidden states in the first 3 time steps, and the input gate. Cell state Output gate Hidden state .

[0049] The second LSTM layer has the same parameters and outputs 256-dimensional temporal features.

[0050] The graph branch of the GAT network takes 256-dimensional structural features as input, and the first layer of attention computes the pair of nodes. i and j , , It has 128-dimensional parameters. The attention weights are a 256×128 matrix. Output The first layer uses 4-head attention to concatenate the data into 512 dimensions. The second layer also uses 4-head attention, outputting 256-dimensional graph features.

[0051] The fusion layer employs an 8-head attention mechanism. Q = temporal features (256 dimensions transformed to 512 dimensions via linear transformation), K = graph features (256 dimensions transformed to 512 dimensions via linear transformation), and V = graph features (512 dimensions via linear transformation). Each attention head is calculated...

[0052] The spliced ​​output features a 512-dimensional fusion feature.

[0053] In the output layer, the Sigmoid layer outputs a risk probability of, for example, 0.72, and the Softmax layer maps the 512-dimensional features to 5 risk levels, with 0.72 corresponding to level 4.

[0054] During training, the dataset contained 10,000 samples, with 70% used for training and 30% for validation. There were 3,000 high-risk samples and 7,000 low-risk samples. The weighted cross-entropy loss had a high-risk weight of 3. The model stopped early after 100 iterations, achieving an accuracy of 89%.

[0055] In summary, this AI-based intelligent prediction method and system for software project risks obtains multi-dimensional data by connecting to software project management systems, code repositories, requirement management platforms, and testing tools through multi-source data acquisition interface call modules. After a three-level data preprocessing cleaning mechanism, feature engineering methods such as sliding window method, graph isomorphic network, and TextCNN extract time series features, structural features, and semantic features to construct a hybrid feature set. Then, the risk prediction model's dual-channel hybrid neural network integrates multimodal information through temporal branches, graph branches, and multi-head attention fusion layers, comprehensively depicting the multimodal characteristics of the project's dynamic evolution and improving the modeling ability for complex dependencies such as code module call chains, requirement changes, and schedule correlations.

[0056] Furthermore, this AI-based intelligent prediction method and system for software project risks features a dual-channel architecture in its risk prediction model. An improved LSTM enhances long-term dependency capture, a GAT network processes graph structure features, and a fusion layer enables cross-modal fusion, improving the model's generalization ability. In the risk prediction and update phase, Monte Carlo simulation generates project duration distribution based on WBS dependency relationships. Combined with the risk probability and level classification of the output layer, it provides quantitative delay assessment, solving the problem of missing quantitative assessment and providing high-precision support for risk response. This addresses the issues of traditional methods, such as single feature dimensions, insufficient model generalization ability, and lack of quantitative analysis tools for risk prediction.

[0057] The relevant modules involved in this system are all hardware system modules or functional modules that combine computer software programs or protocols with hardware in the prior art. The computer software programs or protocols involved in these functional modules are technologies known to those skilled in the art and are not improvements to this system. The improvement of this system lies in the interaction or connection between the modules, that is, in improving the overall structure of the system to solve the corresponding technical problems that this system aims to address.

[0058] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A software project risk intelligent prediction method based on AI algorithm, characterized in that, Includes the following steps: S1. Multi-source data collection: Through interface call modules, connect to the software project management system, code repository, requirements management platform and testing tools to collect four types of data, including WBS decomposition data, historical project progress records, code static analysis results and requirements change logs. The WBS decomposition data should include the prerequisite dependencies and planned work hours of each sub-activity, and the code static analysis results should cover 20 software metrics such as cyclomatic complexity, lines of code, and comment rate. S2. Data Preprocessing: A three-level cleaning mechanism is adopted. The first level removes duplicate records through hash verification. The second level identifies outliers based on the 3σ principle and repairs them using the nearest neighbor mean interpolation method. The third level uses Z-score standardization to map numerical features to a distribution range with a mean of 0 and a standard deviation of 1. For text-based requirement change logs, word segmentation and stop word removal are performed, and then the logs are transformed into 128-dimensional vectors using a word vector model. S3. Feature Engineering: Construct a hybrid feature set, including time series features, structural features, and semantic features. The time series features are extracted from historical progress data using the sliding window method to extract the activity time volatility and critical path deviation rate of the last three iterations. The structural features are based on the program dependency graph and use a graph isomorphic network to extract the call relationship features between code modules. The network contains three graph convolutional layers, and the node embedding dimensions of each layer are 64, 128, and 256. Semantic features are extracted from the requirements document using TextCNN. The convolutional layer uses 16 kernels of three different sizes: 3×128, 5×128, and 7×128, and outputs a 256-dimensional semantic vector. S4. Risk Prediction Model Construction: A dual-channel hybrid neural network architecture is adopted, including a temporal branch, a graph branch, a fusion layer, and an output layer. The temporal branch is an improved LSTM network with two bidirectional LSTM layers and a hidden layer dimension of 256. A gating regulator is introduced into the memory cells to enhance the ability to capture long-term dependencies. The graph branch uses a GAT network to process program dependency graph features and contains two attention mechanism layers with four attention heads per node. The fusion layer achieves cross-modal feature fusion through an eight-head attention mechanism, and the attention weight matrix dimension is 512×512. The output layer adopts a dual-output structure, which outputs the risk probability (0-1) through the Sigmoid activation function and the 5-level risk level through the Softmax function. S5. Model Training: The Adam optimizer is used, with an initial learning rate of 0.

001. Cosine annealing is employed to adjust the learning rate. The loss function is weighted cross-entropy, where the weight of high-risk samples is set to three times that of low-risk samples. The formula is as follows: ; in The labels are real (1 indicates high risk, 0 indicates low risk). To predict probabilities, These are the weighting coefficients; During training, a validation set evaluation is performed every 5 epochs. If there is no improvement after 3 consecutive evaluations, an early stop mechanism is triggered. S6. Risk Prediction and Update: Real-time access to project dynamic data; recalculation of features and input into the model every 24 hours; output of a prediction report including risk probability, top 5 influencing factors, and mitigation suggestions; when the predicted risk level is ≥3, automatic triggering of Monte Carlo simulation; random generation of work hours based on the BetaPERT distribution (α=2, β=2) of each sub-activity; calculation of the total project duration 10,000 times based on WBS dependencies; generation of duration probability distribution curve using kernel density estimation, where the probability of schedule delay = P ( T (Planned construction period) × 100% P ( T >Planned construction period) × 100%, T To simulate the total project duration.

2. The method for intelligent prediction of software project risks based on AI algorithms according to claim 1, characterized in that, In the multi-source data acquisition step, static code analysis is implemented by calling a code quality analysis tool API, and cyclomatic complexity is calculated by controlling the number of nodes and edges in the flow graph, using the following formula: ; in Let be the number of sides. For the number of nodes, The number of connected components; historical project progress records must contain complete lifecycle data for at least 5 similar projects, and the WBS decomposition level for each project must be no less than 4 levels.

3. The intelligent prediction method for software project risks based on AI algorithms according to claim 1, characterized in that, In the feature engineering step, the time series feature extraction uses the following formula: Activity duration volatility is calculated as the ratio of standard deviation to mean, using the following formula: ; in For the first Actual working hours of each iteration Historical average working hours This represents the number of iterations; when the number of iterations is less than 3, the median of similar projects is used to fill in the required parameters for calculation. Critical path deviation rate is calculated by comparing the actual performance with the planned performance, using the following formula: ; This indicator reflects the degree of deviation between the actual progress and the planned progress of the critical path during project execution.

4. The method for intelligent prediction of software project risks based on AI algorithms according to claim 1, characterized in that, In the time-series branch of the risk prediction model, the gating mechanism of the improved LSTM satisfies the following calculation steps: Forget gate calculation: Input the hidden state of the previous time step With current input The concatenated vector, through the weight matrix and bias terms Perform a linear transformation, followed by the Sigmoid function. Activate to obtain the Forgotten Gate ; Input gate computation: Similarly, a linear transformation is performed on the concatenated vector, using the weight matrix. Sum and bias terms via the Sigmoid function Activate to get the input gate ; Cell state update: The forget gate Cell state at the previous moment Multiplication, plus input gate and The product; Output gate calculation: Perform a linear transformation on the concatenated vector, and then pass it through the weight matrix. and bias terms via the Sigmoid function Activate to get the output gate ; Hidden state calculation: output gate and Multiply to obtain the hidden state at the current time. .

5. The method for intelligent prediction of software project risks based on AI algorithms according to claim 1, characterized in that, The Monte Carlo simulation steps are as follows: based on the WBS decomposition of each sub-activity, a probability model conforming to the BetaPERT distribution is set for the time consumption of each sub-activity. 10,000 sets of sub-activity time consumption data are generated by random sampling. The total project duration is calculated based on the pre-dependencies of the sub-activities. Kernel density estimation is used to generate the probability distribution curve and 95% confidence interval of the total duration. The quantitative assessment results of the project delay are output.

6. A software project risk intelligent prediction system based on AI algorithms, characterized in that, include: Data Acquisition Layer: Contains 4 dedicated collectors: the project management collector obtains WBS data through the project management system API, the code collector captures code commit records in real time through code repository WebHook, the requirement collector uses web crawling technology to parse requirement management platform documents, and the test collector connects to continuous integration tools to obtain test reports; each collector is configured with a 512MB cache pool and supports breakpoint resume. Preprocessing engine: It consists of a hash deduplication module, an anomaly repair module, and a feature transformation module. The anomaly repair module adopts a stream processing framework with a processing latency of ≤100ms. The feature transformation module has a built-in word vector model (word vector dimension 128, window size 5). Feature computation nodes: Three types of computation units are deployed. The temporal feature unit adopts the sliding window algorithm (window size is configurable), the structural feature unit runs the graph isomorphic network inference engine, and the semantic feature unit integrates the TextCNN model (containing 3 types of convolution kernels). Predictive model service: It adopts a distributed deployment architecture with 8 inference nodes, each node is configured with a GPU (≥16GB of video memory), and the model parameters are dynamically scheduled through Kubernetes; the model architecture includes temporal branches (improved LSTM), graph branches (GAT) and multi-head attention fusion layer; Visualization terminal: Provides a risk dashboard, including a WBS risk heatmap (node ​​color mapping risk probability), trend curves (results of the last 10 predictions), and a Monte Carlo simulation histogram of project duration distribution, and supports exporting prediction reports in PDF format.

7. The intelligent prediction system for software project risks based on AI algorithms according to claim 6, characterized in that, The project management collector in the data acquisition layer connects to the project management system through an authentication protocol, calls the interface to obtain task data in batches, and parses fields including planned working hours, actual working hours, and dependencies. The data update frequency is set to once per hour, and an incremental synchronization mechanism is adopted.

8. The intelligent prediction system for software project risks based on AI algorithms according to claim 6, characterized in that, The GAT network layer in the prediction model service satisfies the following conditions: The input layer receives 256-dimensional node features; Attention layer 1 calculates the attention coefficient ,in It has 128 learnable parameters. The weight matrix is ​​(256×128). and Representing nodes respectively i and nodes j eigenvectors; Attention layer 2 outputs 128-dimensional node features, employing a 4-head attention mechanism; The output layer obtains graph-level feature vectors through global mean pooling, and each layer is configured with a Dropout layer (ratio 0.2) to prevent overfitting.

9. The intelligent prediction system for software project risks based on AI algorithms according to claim 6, characterized in that, The risk heatmap of the visualization terminal uses a WBS decomposition structure as a tree skeleton. The color of each node maps to the risk probability (0-1 corresponds to a green-red gradient), and the node size maps to the influence factor (calculated through SHAP value). Clicking on a node can display the top 3 risk factors of the activity and the histogram of the schedule distribution in the Monte Carlo simulation.