A multi-resource pool financial budget and cost estimation method and device based on constraint-enhanced hierarchical decision tree
By constructing a hierarchical decision tree structure model of resource pool profile vectors and cross-resource pool coupling matrices, the problem of unified modeling of financial budget data of multiple resource pools is solved, the effective handling of cost linkage relationships across resource pools is realized, the stability and adaptability of budget estimation are improved, the computational overhead is reduced, and the interpretability of the model is enhanced.
Patent Information
- Application Number
- CN202611401599.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-10
- Publication Date
- 2026-12-01
AI Technical Summary
Existing financial budgeting and cost estimation methods are difficult to model heterogeneous data from multiple resource pools in a unified manner, cannot reflect the constraints and objectives in budget estimation, single-layer models are difficult to handle cross-resource pool coupling relationships, model updates involve large computational costs and have poor adaptability, prediction results lack traceable interpretation, and it is difficult to cold start new resource pools.
A constraint-enhanced hierarchical decision tree approach is adopted. A hierarchical decision tree structure model is constructed by resource pool profile vectors and cross-resource pool coupling matrices. Combining resource pool-level and budget fusion-level decision trees, and employing constraint-enhanced splitting criteria and budget drift monitoring mechanisms, the modeling of cost patterns within resource pools and cross-resource pool linkages is realized.
It improves the uniformity and comparability of financial budget data from multiple resource pools, reduces the bias caused by differences in dimensions and mixed features in the model, enhances the stability and interpretability of budget estimation, reduces computational overhead and cold start time, and improves the adaptability and reliability of the model.
Smart Images

Figure CN123200367A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of financial budgeting technology, specifically to a method and apparatus for multi-resource pool financial budgeting and cost estimation based on a constraint-enhanced hierarchical decision tree. Background Technology
[0002] Existing financial budgeting and cost estimation methods mainly include manual experience estimation, static rule models, linear regression models, and solutions that apply machine learning models such as decision trees, random forests, and AdaBoost to project cost, workload estimation, or expense prediction. These solutions typically use historical cost data as input, train models to establish a mapping relationship between cost factors and budgeted costs, and output predicted values for new projects or budget cycles. Taking the most widely used ordinary regression decision tree as an example, this type of solution uses several cost factors as input variables and budgeted costs as output variables for model training. During training, node splitting is performed based on statistical indicators such as mean squared error, mean absolute error, or information gain, and hyperparameters such as maximum depth and minimum sample size are optimized through cross-validation, pruning, or grid search. In some existing budgeting systems, cost data is also categorized and summarized by department, project, or budget item, and shared costs are allocated using fixed-ratio rules. However, these systems generally input the allocation results as preprocessed static fields into the model, without explicitly encoding the allocation relationships, dependency strength, or capacity linkages between resource pools as constraints during model training.
[0003] The existing solutions mentioned above can fit the nonlinear relationship between cost factors and budget results to some extent, but they are essentially still the practice of directly applying general machine learning models to cost prediction scenarios. Therefore, they have the following technical defects: heterogeneous resource pool data are difficult to model uniformly, ordinary splitting criteria cannot reflect the constraints in budget estimation, single-layer models are difficult to handle cross-resource pool coupling relationships, model updates have large computational load and poor adaptability, prediction results lack traceable interpretation, and it is difficult to cold start new resource pools. Summary of the Invention
[0004] The purpose of this invention is to provide a method and apparatus for financial budgeting and cost estimation of multiple resource pools based on constraint-enhanced hierarchical decision trees. By constructing resource pool profile vectors, heterogeneous cost data from different resource pools are transformed into unified input features, solving the problem of difficulty in unified modeling of heterogeneous data from multiple resource pools and improving the consistency and comparability of input data.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: A multi-resource pool financial budgeting and cost estimation method based on constraint-enhanced hierarchical decision trees includes the following steps: S1: Collection, cleaning, and time alignment of financial budget data from multiple resource pools; Budget cost-related data is collected from data sources corresponding to multiple resource pools. Each resource pool corresponds to a resource type or business source, such as a human resources pool, equipment resource pool, cloud computing power resource pool, procurement resource pool, and marketing resource pool. Budget cost-related data includes at least the resource pool type identifier, direct costs, indirect costs, resource capacity, resource usage, unit price, discount coefficient, settlement cycle, fixed costs, variable costs, shared allocation ratio, budget item, actual expenditure, historical budget deviation, resource pool business priority, resource pool status identifier, and data source identifier. The resource pool type identifier, resource pool business priority, and resource pool status identifier can be obtained from the resource management system, project management system, or budget configuration data. Resource utilization rate is calculated based on resource usage and resource capacity; historical cost volatility and historical budget deviation rate are calculated based on historical budget cost-related data; and budget item codes are obtained by encoding budget items.
[0006] When collecting budget cost-related data, a unified key value is generated for each data record. This unified key value includes at least the budget period, resource pool identifier, budget item, business project identifier, and data source identifier. The unified key value links data from existing ERP systems, financial systems, project management systems, cloud resource management platforms, or procurement systems, preventing the same cost from being recorded repeatedly or omitted in different systems.
[0007] Align budget cost data with time windows, aggregating or splitting budget cost data at different granularities such as daily, weekly, monthly, and quarterly according to the target budget period. For example, cloud computing power costs billed daily are aggregated into monthly costs, equipment costs depreciated quarterly are amortized according to the target budget period, and procurement costs settled according to project nodes are mapped to the corresponding target budget period.
[0008] Missing and outlier values are handled in a tiered manner. For missing values that can be inferred from adjacent periods or similar resource pools, a weighted imputation method is used to generate replacement values. For fields that cannot be reliably imputed, the missing value marker is retained and the data quality score is reduced. For outliers that exceed the historical percentile range, they are not directly deleted, but are marked as "retain outliers," "correct outliers," or "remove outliers" based on the credibility of the source, the business approval status, and the historical fluctuation range of similar resource pools.
[0009] Generate a data quality score Q for each resource pool. The data quality score is calculated based on the missing value rate, outlier ratio, update time lag, field consistency, and source reliability. For example: Q = w1 × Completeness + w2 × Consistency + w3 × Timeliness + w4 × Anomaly Correction Credibility + w5 × Source Credibility, where w1 to w5 are preset weights. In subsequent training of the hierarchical decision tree structure model, the data quality score participates in sample weighting, node splitting loss calculation, and budget drift judgment.
[0010] To avoid the impact of differences in the dimensions of different resource pools on the training of the hierarchical decision tree structure model, a dual-channel feature processing approach is adopted: on the one hand, continuous features such as direct costs, indirect costs, fixed costs, variable costs, resource capacity, and resource usage are normalized or standardized according to the resource pool type; on the other hand, proportional features related to the total budget are retained, such as cost percentage, unit output cost, capacity utilization rate, historical volatility, and shared cost percentage. This reduces the differences in dimensions while avoiding the complete loss of resource pool cost scale information.
[0011] S2: Construction of resource pool profile vectors and cross-resource pool coupling matrices; For the j-th resource pool, in the k-th budget period, features are extracted from the budget cost-related data collected and processed by S1, and the computable features are calculated or encoded to construct a resource pool profile vector Pj,k. This vector includes at least one or more of the following features: resource pool type identifier, resource capacity, resource utilization rate, resource unit price, fixed cost, variable cost, shared cost allocation ratio, historical cost volatility, historical budget deviation rate, budget item code, data quality score, resource pool business priority, and resource pool status identifier. Specifically, the resource pool type identifier, resource capacity, resource unit price (unit price in S1), fixed cost, variable cost, shared cost allocation ratio, resource pool business priority, and resource pool status identifier are taken from the budget cost-related data collected and processed by S1; the resource utilization rate, historical cost volatility, historical budget deviation rate, and budget item code (obtained by encoding the budget item) are calculated or encoded from the budget cost-related data; and the data quality score is the data quality score generated in S1 based on the budget cost-related data.
[0012] The resource pool profile vector can be represented as: Pj,k = [typej, capj,k, usej,k, pricej,k, fixedj,k, varj,k, sharej,k,volj,k, biasj,k, Qj,k, priorityj,k].
[0013] Wherein, typej represents the resource pool type, capj,k represents the resource capacity, usej,k represents the resource usage or resource utilization rate, pricej,k represents the resource unit price, fixedj,k and varj,k represent fixed costs and variable costs respectively, sharej,k represents the sharing ratio, volj,k represents the historical cost volatility, biasj,k represents the historical budget deviation rate, Qj,k represents the data quality score, and priorityj,k represents the resource pool business priority.
[0014] For categorical features, one-hot encoding, target encoding, or preset category encoding can be used; for continuous features, normalization can be performed according to resource pool type to avoid the splitting threshold selection being affected by the fact that human resource costs, cloud resource costs, and equipment depreciation costs are at completely different levels; for time-based features, budget cycle number, quarterly identifier, holiday identifier, or peak season identifier can be generated.
[0015] Furthermore, a cross-resource pool coupling matrix A is constructed. The matrix element aij describes the cost dependency relationship between resource pool i and resource pool j. This dependency relationship can originate from shared cost allocation, upstream and downstream business dependencies, resource substitution relationships, common capacity bottlenecks, budget item merging relationships, or resource call chains. For example, when an increase in the usage of a cloud computing resource pool causes an increase in the cost of a storage resource pool, aij takes a positive correlation weight; when the cost of a resource pool is proportionally allocated to multiple departmental resource pools, aij represents the allocation ratio.
[0016] The cross-resource pool coupling matrix A can be generated using one or a combination of the following methods: First, read the enterprise budget allocation rule table and directly fill the allocation ratio in the rule table into the matrix; Second, calculate the correlation or lagged correlation between resource pools based on historical data, and convert correlation coefficients exceeding the threshold into coupling weights; Third, generate directed edges between resource pools based on the call chain, project affiliation, or resource dependency relationship in the business system; Fourth, correct the automatically generated matrix through manual configuration.
[0017] In this model, the coupling matrix A is constrained to be a row-normalized matrix, meaning that when the same shared cost source is allocated to multiple target resource pools, the sum of the weights corresponding to each target resource pool is 1. If the sum of the matrix weights does not meet the preset condition, the hierarchical decision tree structure model generates the allocation residual, which is used as a constraint penalty term when subsequent nodes split.
[0018] The resource pool profile vector and the cross-resource pool coupling matrix together constitute the input to the hierarchical decision tree structure model, enabling the model to simultaneously learn the cost patterns within resource pools and the linkages between resource pools. Compared to directly concatenating all original fields and inputting them into a single decision tree, this approach reduces feature confounding and allows cross-resource pool relationships to participate in training in an interpretable matrix form.
[0019] S3: Construction and training of a constraint-enhanced hierarchical decision tree model; A hierarchical decision tree structure model is adopted. The first layer is the resource pool level decision tree, and each resource pool corresponds to one or more resource pool level decision trees T. j This is used to output a resource pool cost estimate y based on the profile vector of the resource pool. j Prediction confidence level u j The budget deviation rate and resource pool weights are defined as follows: The budget deviation rate is determined based on the deviation between the estimated cost of a resource pool and the corresponding budget benchmark; the resource pool weight characterizes the influence of the corresponding resource pool on the total budget estimate and can be determined based on the statistical results of the leaf nodes of the resource pool-level decision tree, combined with the resource pool's business priority, cost proportion, and data quality score. The second layer is the budget fusion-level decision tree T_F, which receives the estimated cost of each resource pool from the output of each resource pool-level decision tree, the prediction confidence level, the budget deviation rate, the resource pool weight, as well as the budget cycle characteristics and the cross-resource pool coupling matrix, and outputs the total budget estimate Y or the estimate split by budget item. The budget cycle characteristics consist of one or more of the following generated in S2: the budget cycle sequence number, quarter identifier, holiday identifier, or peak season identifier.
[0020] Unlike ordinary regression decision trees, which primarily rely on prediction errors for node splitting, hierarchical decision tree structures, in addition to considering mean squared error, also incorporate budget overruns, capacity constraints, cross-resource pool coupling, data quality, and node stability as constraints into the splitting evaluation, employing a constraint-enhanced splitting criterion. For a candidate split s, its loss function can be expressed as: L(s) = MSE(s) + λ1·P_over(s) + λ2·P_cap(s) + λ3·P_couple(s) + λ4·P_quality(s) + λ5·P_stable(s); Wherein, MSE(s) represents the mean squared error of prediction after candidate splits; P_over(s) represents the budget overrun penalty term, used to improve sensitivity to overrun samples; P_cap(s) represents the capacity constraint penalty term, used to limit splits where resource usage exceeds the resource pool capacity boundary; P_couple(s) represents the cross-resource pool amortization residual term, used to constrain the amortization relationship between multiple resource pool estimates and the coupling matrix; P_quality(s) represents the data quality penalty term, used to reduce the impact of low-quality samples on split selection; P_stable(s) represents the node stability penalty term, used to suppress branches that rely solely on a small number of anomalous samples; λ1 to λ5 are the weights of each constraint term.
[0021] The budget overspending penalty term P_over(s) is calculated based on the proportion of samples whose predicted values exceed the budget ceiling B in the leaf nodes of the hierarchical decision tree structure model and the magnitude of the overspending. For example, P_over(s) = mean(max(0, - B)²). The capacity constraint penalty term P_cap(s) is calculated based on the extent to which resource usage (use) exceeds capacity (cap), for example, P_cap(s) = mean(max(0, use - cap)²). The cross-resource pool amortized residual term P_couple(s) is calculated based on the consistency between the estimated value vector y of each resource pool and the cross-resource pool coupling matrix A, for example, P_couple(s) = || y - A·y ||².
[0022] The data quality penalty term P_quality(s) is calculated based on the data quality score Q of the samples within a node in the hierarchical decision tree structure model. It assigns lower weights to errors in low-quality samples and increases the penalty for candidate splits where the proportion of low-quality samples is too high. The node stability penalty term P_stable(s) is calculated based on the number of samples in the left and right child nodes after a split, historical period coverage, and the variance of the leaf node residuals, to prevent the model from forming unstable branches due to a small amount of outlier data.
[0023] The hierarchical decision tree structure model traverses candidate splitting features and candidate thresholds at each node, calculates the losses of the left and right child nodes after the split, and selects the feature and threshold that minimizes L_left(s) + L_right(s) as the splitting scheme. Therefore, the node splitting in the hierarchical decision tree structure model not only reflects statistical fitting ability but also reflects constraints such as capacity, allocation, overspending, data reliability, and node stability in multi-resource pool budget estimation.
[0024] After the resource pool-level decision trees are trained, the cost estimates, prediction confidence levels, budget deviation rates, resource pool weights, coupling matrix features, and budget cycle features output by each resource pool-level decision tree are input into the budget fusion-level decision tree. The budget fusion-level decision tree learns the combination relationships and shared allocation adjustments between resource pools to generate the total budget estimate Y or estimates broken down by budget item. This structure avoids the feature confounding problem caused by directly inputting all resource pool data into a single decision tree.
[0025] Hierarchical decision tree models can employ K-fold cross-validation and post-pruning strategies during training. Pruning considers not only validation set error but also node stability, constraint violation frequency, and recall of budget overrun samples. Branches with small error reduction but high constraint violation frequency are pruned; branches that clearly identify budget overrun risks but have limited error reduction are retained based on budget risk weights.
[0026] To facilitate subsequent backtracking of the hierarchical decision tree structure model, the version information of the hierarchical decision tree structure model is saved after training, including the training data time range, resource pool list, feature field version, cross-resource pool coupling matrix version, split criterion weight, cross-validation index, pruning parameters, and release status.
[0027] S4: Budget forecasting, deviation interpretation, and decision path output; During the forecasting phase, the hierarchical decision tree model receives resource pool data for the new budget cycle and generates corresponding resource pool profile vectors, budget cycle features, and cross-resource pool coupling matrices according to S1 and S2. Each resource pool profile vector is input into its corresponding resource pool-level decision tree to obtain resource pool-level cost estimates, forecast confidence, budget deviation rates, and resource pool weights. The budget fusion-level decision tree then generates a total budget estimate Y or an estimate broken down by budget item based on the outputs of each resource pool-level decision tree, budget cycle features, and coupling relationships.
[0028] The hierarchical decision tree structure model also outputs budget deviation explanation information. For each resource pool, its decision path in the resource pool-level decision tree is recorded, including the triggered split features, threshold conditions, historical sample statistics of leaf nodes, corresponding constraint penalty terms, and the contribution rate of that resource pool to the total budget. For the total budget, the main resource pools affecting the outcome and their coupling relationships in the budget fusion-level decision tree are recorded.
[0029] The forecast results may include: total budget estimate, cost estimate for each resource pool, cost estimate for each budget item, resource pool contribution rate, forecast confidence level, main sources of deviation, budget overrun risk warning, data fields recommended for review, version number of the hierarchical decision tree model used, and training time of the hierarchical decision tree model. In this way, budget personnel not only obtain the forecast results but also receive traceable technical explanations corresponding to the model's computational path.
[0030] If the prediction confidence of a resource pool is lower than a preset threshold, and its data quality score is also lower than the threshold, the hierarchical decision tree model will not directly output a single predicted value. Instead, it will output a prediction range and a review prompt. The review prompt includes the names of the fields to be reviewed collected in S1. These fields are determined based on the splitting features that trigger the low-confidence decision path and the scores of each sub-item in the data quality score of the resource pool. For example, if the "unit price" feature triggers a split in the decision path and the "timeliness" sub-item in the data quality score has a low score, the hierarchical decision tree model will prompt, "The unit price field of this resource pool is outdated, the prediction confidence has decreased, and the unit price or contract discount data should be reviewed." This prompt is triggered by the model's input data and the decision path, rather than by subjective human judgment.
[0031] S5: Budget drift monitoring; After deployment, the hierarchical decision tree model continuously monitors the input feature distribution, prediction residuals, data quality scores, and cross-resource pool coupling matrices for each resource pool. For the j-th resource pool, the budget drift metric D can be calculated. j : D j = θ1·PSI j + θ2·EWMA(|r j |) + θ3·(1-Q j ) + θ4·ΔA j + θ5·V j ; Among them, PSI j EWMA(|r) represents the Population Stability Index of the resource pool profile vectors relative to the training set distribution. j |) represents the exponentially weighted moving average of the absolute value of the predicted residuals, Q. j ΔA represents the data quality score. j V represents the change in the coupling relationship related to resource pool j in the coupling matrix. j This indicates an abnormal indicator of capacity utilization or unit price volatility, with θ1 to θ5 as weights.
[0032] Drift thresholds can be set according to resource pool type. For example, a higher feature distribution drift threshold can be set for cloud computing resource pools with large cost fluctuations, while a lower residual drift threshold can be set for equipment depreciation resource pools with relatively stable settlement rules. The threshold can also be automatically determined based on quantiles on the historical validation set, for example, taking the training period D. j The 95th percentile was used as the drift threshold.
[0033] When D j When the drift threshold of the corresponding resource pool is exceeded, the hierarchical decision tree structure model determines that the cost structure of the resource pool has changed; when the drift indicators of multiple resource pools simultaneously exceed the threshold or ΔA... j When the coupling threshold is exceeded, the hierarchical decision tree model determines that the cross-resource pool relationship has changed. This determination is used to trigger subsequent incremental retraining, manual review, or model version freezing.
[0034] S6: Incremental retraining of the affected subtrees; When only a single or partial resource pool experiences drift, the hierarchical decision tree structure model does not undergo full retraining; instead, it only updates the corresponding resource pool-level decision tree T. j The system then determines whether to update the local nodes of the budget fusion-level decision tree based on changes in the resource pool-level output. Specifically, the hierarchical decision tree structure model takes the most recent N budget cycle samples from the resource pool that has drifted and some historically stable samples to form an incremental training set, which is then used to refine the resource pool-level decision tree T. j Perform retraining or local node replacement.
[0035] The incremental training set includes three types of samples: the first type is the latest sample after the drift occurs, which is used to learn the new cost structure; the second type is the representative stable sample before the drift occurs, which is used to avoid the model forgetting historical patterns; and the third type is the sample of the relevant resource pool that has a high coupling weight with the resource pool where the drift occurred, which is used to maintain the consistency of cross-pool allocation relationship.
[0036] For resource pool-level decision tree T j The hierarchical decision tree structure model can adopt two update methods: First, retain the paths from the root node to the intermediate nodes that still satisfy the stability condition, and only replace the leaf nodes or subtrees with greater drift impact (suitable for low drift levels); second, retrain the entire resource pool-level decision tree when drift is severe. The hierarchical decision tree structure model selects the update method based on drift indicators, changes in leaf node residuals, and sample coverage.
[0037] When the cross-resource pool coupling matrix changes significantly, the hierarchical decision tree structure model updates the budget fusion level decision tree T_F while retaining the unaffected resource pool level decision tree, ensuring that the total budget estimate reflects the new sharing and allocation relationships. After the model update, the hierarchical decision tree structure model records the model version, updated resource pool, drift reason, validation metrics, and rollback flag for subsequent auditing.
[0038] Before releasing a hierarchical decision tree model, an S7 version gating is applied. If the new hierarchical decision tree model's MSE on the validation set does not deteriorate beyond a preset threshold, the identification rate of budget overrun samples does not decrease, the number of constraint violations decreases or remains the same, and the prediction explanation path is complete, then the new version is released; otherwise, the old version is retained and a manual review prompt is output. This mechanism can prevent frequent model degradation due to short-term abnormal samples.
[0039] This incremental retraining mechanism reduces the computational overhead of retraining the overall hierarchical decision tree model and mitigates the interference of abnormal fluctuations in a single resource pool on models in other resource pools. Especially when there are a large number of resource pools, updating only the affected subtrees can significantly reduce the amount of training data loaded, the number of candidate split calculations, and the number of model validations.
[0040] S7: Model version gating; After the model update is complete, a version gating process is executed. The hierarchical decision tree model performs a multi-dimensional comparison between the new model and the current old model on the validation set. The comparison dimensions include the validation set mean squared error, the rate of identification of budget overrun samples, the number of constraint violations, and the completeness of the interpretation path. The hierarchical decision tree model releases a new version only if the new model's validation set mean squared error has not deteriorated beyond a preset threshold, the rate of identification of budget overrun samples has not decreased, the number of constraint violations has decreased or remained the same, and the prediction interpretation path is complete; otherwise, the new version is rejected, the model is automatically rolled back to the old model, and a prompt for manual review is output.
[0041] This version of the gating step can be executed after the S6 incremental retraining is completed and after the initial model training in S3 is completed, in order to ensure that each model change is verified for quality.
[0042] S8: Model expansion mechanism when adding, deleting, merging or splitting resource pools; When the hierarchical decision tree model detects a new resource pool, it first calculates its similarity to existing resource pools based on the pool type, resource capacity, resource utilization rate, resource unit price, fixed cost, variable cost, shared cost sharing ratio, and historical cost volatility. If an existing resource pool with a similarity higher than a threshold exists, the decision tree structure of that existing resource pool is copied or migrated as the initial subtree for the new resource pool, and fine-tuned using a small number of samples from the new resource pool. If no similar resource pool exists, a preset template subtree or a rule-based model is used as the cold start model.
[0043] When a resource pool is deleted, merged, or split, the hierarchical decision tree structure model updates the resource pool list, profile vector field, and cross-resource pool coupling matrix, and adjusts the input structure of the budget fusion-level decision tree accordingly. For example, when two procurement resource pools are merged, the hierarchical decision tree structure model maps the historical profile vectors of both to the merged resource pool and recalculates the fixed cost, variable cost, and shared cost allocation ratios; when a resource pool is split, the hierarchical decision tree structure model generates new coupling matrix weights according to the splitting rules.
[0044] Through this mechanism, the hierarchical decision tree structure model can adapt to changes in the number and type of resource pools without redesigning the overall budget estimation process.
[0045] The method can be deployed in an enterprise financial management system, budget management system, or data platform. The system may include a data interface, feature processing service, model training service, budget forecasting service, drift monitoring service, model version management module, and results display module. The data interface is used to collect data from ERP, financial systems, project management systems, cloud resource management platforms, or other business systems; the model training service is used to perform hierarchical decision tree training and incremental retraining; the budget forecasting service outputs budget estimation results in API form; and the drift monitoring service periodically or in real-time calculates budget drift indicators.
[0046] The budget forecasting service provides the following interfaces: input budget period, resource pool identifier, resource pool cost field, budget item and caller identifier, output total budget estimate, resource pool level estimate, budget deviation explanation, over-budget risk warning and model version number.
[0047] Due to the sensitive nature of financial budget data, the system implements access control and encrypted storage for data interfaces, model training logs, and prediction results. For each budget prediction request, the system records the request time, input field summary, caller, model version, output result, and interpretation path summary. This log is used for subsequent auditing and also for comparing output differences between different model versions within the same budget period.
[0048] Another objective of this invention is to provide a multi-resource pool financial budgeting and cost estimation device based on a constraint-enhanced hierarchical decision tree, comprising a data acquisition module, a profile generation module, a model training module, a budget prediction module, a drift monitoring module, and a model version management module.
[0049] In summary, the present invention has the following advantages: 1. This invention transforms heterogeneous cost data from different resource pools into unified input features by constructing resource pool profile vectors, solving the problem of difficult unified modeling of heterogeneous data from multiple resource pools and improving the consistency and comparability of input data.
[0050] 2. This invention uses a dual-channel feature processing method to eliminate dimensional differences while retaining cost scale information, thereby reducing the splitting bias caused by different field dimensions in the model.
[0051] 3. This invention enables the model to handle cost linkages between resource pools by generating a cross-resource pool coupling matrix, thus avoiding total budget deviations caused by independent estimation of a single resource pool.
[0052] 4. This invention uses a constraint-enhanced splitting criterion to simultaneously consider statistical error, budget overrun, capacity constraints, cross-pool residual allocation, data quality, and node stability during decision tree node splitting. This differs from the single statistical error splitting method of ordinary decision trees, thus improving the stability and constraint consistency of budget estimation.
[0053] 5. This invention uses a hierarchical model composed of a resource pool-level decision tree and a budget fusion-level decision tree to separate and model the cost patterns within the resource pool from the cross-resource pool fusion patterns, thereby reducing feature confounding and the risk of negative model transfer.
[0054] 6. This invention, through budget drift indicators and drift triggering mechanisms, can promptly detect changes in resource pool cost structure, prediction residuals, data quality, or coupling relationships, thus preventing long-term model failure.
[0055] 7. This invention reduces the computational overhead of full retraining and improves model update efficiency by using an incremental retraining mechanism for affected subtrees, which only updates the drifted resource pool-level subtrees and necessary fusion nodes.
[0056] 8. This invention prevents model degradation caused by short-term abnormal samples through model version gating and rollback mechanisms, thereby improving the reliability and auditability of model releases.
[0057] 9. This invention solves the cold start problem when there are insufficient samples in the newly added resource pool by using a similarity migration initialization mechanism for the newly added resource pool, thereby improving the scalability of the hierarchical decision tree structure model.
[0058] 10. This invention outputs the node conditions that trigger the prediction, the resource pool contribution rate, and the source of budget deviation through the prediction path and resource pool contribution explanation output mechanism, as well as the low confidence prediction interval and review prompt mechanism. It outputs risk prompts when the data quality is insufficient or the prediction is unstable, thereby improving the auditability of the model results and the security of decision-making. Attached Figure Description
[0059] Figure 1 This is a flowchart of a multi-resource pool financial budgeting and cost estimation method. Detailed Implementation
[0060] The present invention will now be described in further detail with reference to specific embodiments.
[0061] Example 1: Budget cost estimation for two resource pools; Assume the enterprise has resource pool 1 and resource pool 2. Resource pool 1 is the human resources pool, and resource pool 2 is the cloud computing power resource pool. For each budget period, the hierarchical decision tree structure model collects detailed cost data (direct cost c1, indirect cost c2), resource usage u, resource unit price p, sharing ratio a, historical budget deviation b, and data quality score Q for each resource pool according to S1.
[0062] The hierarchical decision tree structure model first extracts the resource capacity, unit price, fixed cost, variable cost, and sharing ratio of resource pool 1 and resource pool 2 directly from the budget cost-related data of S1. It then calculates the utilization rate based on resource usage and capacity, and the historical budget deviation rate based on historical budget data, constructing profile vectors P1 and P2 respectively. Finally, it generates a cross-resource pool coupling matrix A based on the sharing cost allocation relationship. For example, when the cloud computing power cost of resource pool 2 needs to be allocated to the corresponding project in resource pool 1 according to project usage, the cross-resource pool coupling matrix a... 21 This indicates the sharing ratio of resource pool 2 to resource pool 1.
[0063] During the S3 training phase, the hierarchical decision tree structure model trains resource pool-level decision trees T1 (for resource pool 1) and T2 (for resource pool 2). During training, candidate split nodes calculate not only MSE (Minimum Stake Es) but also budget overrun penalties, capacity constraint penalties, cross-resource pool amortization residuals, and data quality penalties. A typical regression decision tree might choose a splitting scheme that minimizes MSE but leads to overrun samples concentrating on the same leaf node. However, this embodiment selects a splitting scheme with lower constraint loss due to the increased budget overrun penalty.
[0064] In the S4 prediction phase, T1 outputs the estimated cost and confidence level of resource pool 1, and T2 outputs the estimated cost and confidence level of resource pool 2. The budget fusion-level decision tree T_F receives the outputs of T1 and T2, the coupling matrix A, and the budget period features to generate a total budget estimate. If the increased computing power usage of resource pool 2 leads to an increase in the cost allocated to the project in resource pool 1, then T_F adjusts the total budget based on the coupling matrix features.
[0065] Example 2: Budget merging for shared cost allocation across three resource pools; Suppose that the company simultaneously has a human resources pool, a cloud computing resource pool, and a marketing resource pool. Marketing activities increase cloud resource access, which in turn drives up storage and maintenance costs. A portion of these cloud resource costs is allocated to the human resources pool according to the proportion of human resources invested in the project.
[0066] The hierarchical decision tree structure model generates a third-order coupling matrix A based on the budget allocation rule table. In the matrix, a_marketing, cloud represents the cost transmission weight of the marketing resource pool to the cloud computing resource pool, and a_cloud, human resources represents the proportion of cloud computing costs allocated to the human resources pool. After the resource pool-level decision tree outputs preliminary cost estimates for the three types of resource pools respectively, the budget fusion-level decision tree merges the total budget based on A.
[0067] If a typical single-layer decision tree is trained directly using all fields, it may misjudge an increase in marketing expenses as a direct correlation with an increase in human resource costs. This embodiment first uses a coupling matrix to express the transmission paths from the marketing resource pool to the cloud computing resource pool, and from the cloud computing resource pool to the human resource pool. Then, the budget fusion-level decision tree learns the fusion relationship, thereby reducing the overall budget deviation caused by erroneous associations.
[0068] Example 3: Drift-triggered local incremental retraining; During the continuous budget cycle, the hierarchical decision tree structure model calculates the budget drift index for each resource pool according to S5. If the input feature distribution of resource pool 2 changes due to the adjustment of cloud service unit price, and its drift index D2 exceeds the threshold, while the drift index D1 of resource pool 1 does not exceed the threshold, then the hierarchical decision tree structure model retrains only the resource pool-level decision tree T2 of resource pool 2 according to S6, and updates the nodes related to resource pool 2 in the budget fusion-level decision tree T_F based on the change in T2 output.
[0069] Specifically, the incremental training set includes: the latest samples from the last 8 budget periods of resource pool 2 (to learn the new cost structure), representative stable samples from the 12 budget periods before the drift of resource pool 2 (to avoid forgetting historical patterns), and relevant samples from resource pool 1 and resource pool 3 that have coupled weights with resource pool 2 (to maintain consistency in cross-pool allocation relationships). Since the drift level of resource pool 2 is moderate (the drift index exceeds the threshold but does not exceed the severe drift threshold), the hierarchical decision tree structure model adopts the first update method: retaining the paths from the root node to the intermediate nodes of T2 that still meet the stability conditions, and only replacing the 3 leaf nodes with the greater impact of drift.
[0070] Compared with full retraining, this method reduces the amount of training data loaded and the number of model training sessions; at the same time, the stable model in resource pool 1 is not affected by the short-term fluctuations in resource pool 2, thereby improving the efficiency of model updates and the stability of budget estimation.
[0071] Example 4: Model version gating and rollback; After incremental retraining in Example 3, the hierarchical decision tree model performs the S7 version gating step. The new model T2' shows a 1.2% increase in MSE on the validation set compared to the old model (not exceeding the preset 3% degradation threshold), an increase in the identification rate of overspending samples from 82% to 86% (no decrease), a decrease in the number of constraint violations from 5 per 100 samples to 3 (a decrease), and complete prediction explanation paths. All gating conditions are met, and the hierarchical decision tree model is released as version V2.1.
[0072] In another scenario, a resource pool experienced a deviation from its normal cost structure due to a single abnormal promotional activity. The model trained on this abnormal sample saw its over-budget detection rate drop from 85% to 72% on the validation set. The hierarchical decision tree model detected that the gating condition was not met, refused to release a new version, automatically rolled back to the older version V1.5, and output a manual review prompt, requiring budget personnel to confirm the sustainability of the promotional activity. This mechanism prevented model degradation caused by short-term abnormal events.
[0073] Example 5: Migration initialization of a new resource pool; When an enterprise adds a new storage resource pool, the hierarchical decision tree structure model extracts its resource pool type, capacity, unit price, utilization rate, and cost volatility according to S8, and calculates its similarity with existing cloud computing power resource pools, equipment resource pools, etc. The calculation shows that the storage resource pool and the cloud computing power resource pool have high similarity in resource type (both are pay-as-you-go resources), unit price volatility pattern (correlation coefficient 0.78), and utilization rate distribution (KL divergence 0.12) (overall similarity 0.82, higher than the threshold of 0.70). The hierarchical decision tree structure model uses the resource pool-level decision tree structure of the cloud computing power resource pool as the initial subtree and fine-tunes it on a small number of historical samples of the newly added storage resource pool, thereby shortening the cold start time of the new resource pool.
[0074] If a new resource pool is dissimilar to any existing resource pool (with a comprehensive similarity score below 0.50), the hierarchical decision tree model uses a pre-defined template subtree for initial prediction, and gradually replaces the template nodes in subsequent budget cycles through S5 drift monitoring and S6 incremental training. This approach avoids the inability of new resource pools to be integrated into the budget estimation hierarchical decision tree model due to insufficient samples.
[0075] Example 6: Predicted path interpretation and manual review triggering; During a given budget period, the hierarchical decision tree model, according to S4, outputs a total budget estimate that exceeds the budget ceiling. The hierarchical decision tree model also simultaneously outputs the interpretation path: Cloud computing resource pool decision tree T2: Root node → "Capacity utilization rate > 85%" (splitting feature, threshold 85%) → "Unit price increased by > 5% compared to the previous period" (splitting feature, threshold 5%) → Leaf node #7 (historical sample mean is 12% higher than the baseline) → Data quality score Q2 = 0.62 (below the threshold 0.70) → Constraint penalty term P_cap is triggered; Budget fusion-level decision tree T_F: Receive T2 output → Identify the coupling weight between cloud resource pool and storage resource pool, increasing it from 0.25 to 0.33 → Total budget increased by 8%.
[0076] Based on the above path, the hierarchical decision tree structure model generates a review prompt: "It is recommended that finance personnel focus on reviewing: ① Whether the cloud service discount contract has been updated (trigger feature: unit price); ② Whether the storage resource allocation ratio has been adjusted due to project changes (trigger feature: coupling matrix change); ③ Whether there are abnormal peaks in cloud resource usage (trigger feature: capacity utilization)." This review prompt originates from the model node path and changes in the coupling matrix, making it traceable. Since the prediction confidence level of the cloud computing resource pool is 0.62 (lower than the preset threshold of 0.70), the hierarchical decision tree structure model outputs a prediction range instead of a single prediction value, and highlights the fields to be reviewed on the interface.
[0077] Example 7: Specific implementation of data acquisition and quality score calculation; In a real-world enterprise deployment scenario, the hierarchical decision tree structure model collects human resource costs (monthly settlement) from the ERP hierarchical decision tree structure model via the S1 data interface, cloud computing resource costs (daily settlement) from the cloud management platform, and equipment procurement costs (settled by project node) from the procurement hierarchical decision tree structure model. The hierarchical decision tree structure model aggregates daily settlement data into monthly costs by calendar month and maps procurement costs settled by project node to the corresponding budget period according to the project cycle, achieving time window alignment.
[0078] For the collected data, the hierarchical decision tree model detected that 3% of the overtime pay field in the human resources pool was missing. This was imputed using a weighted average of overtime pay over two consecutive months and the percentage of overtime pay for similar projects. One daily consumption record in the cloud computing resource pool was detected as exceeding the historical 99th percentile. After a source credibility assessment (this data came from a highly reliable official billing interface), it was marked as "retainable anomaly" and not deleted. The data quality score Q1 of the human resources pool was 0.88, and the data quality score Q2 of the cloud computing resource pool was 0.92. Both were used in the subsequent S3 model training sample weighting.
[0079] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and principle of the present invention shall be considered equivalent substitutions and shall be included within the protection scope of the present invention.
Claims
1. A multi-resource pool financial budgeting and cost estimation method based on constraint-enhanced hierarchical decision trees, characterized in that, Includes the following steps: Budget cost-related data is collected from data sources corresponding to multiple resource pools. Time window alignment, missing value handling, and outlier handling are performed on the budget cost-related data. A data quality score is generated for the budget cost-related data of each resource pool. Features of each resource pool are extracted from the budget cost-related data. These features include resource pool type identifier, resource capacity, resource utilization rate, resource unit price, fixed cost, variable cost, shared cost sharing ratio, historical cost volatility, historical budget deviation rate, budget item code, data quality score, resource pool business priority, and resource pool status identifier. The resource pool profile vector is constructed by combining these features. Construct a cross-resource pool coupling matrix, the matrix elements of which are used to describe the cost dependencies between different resource pools; A hierarchical decision tree structure model composed of resource pool-level decision trees and budget fusion-level decision trees is used for training. The resource pool-level decision trees are used to output the cost estimate, prediction confidence, budget deviation rate and resource pool weight of each resource pool based on the resource pool profile vector. The budget fusion-level decision trees are used to output the total budget estimate based on the output of each resource pool-level decision tree and the cross-resource pool coupling matrix. The node splitting of the hierarchical decision tree structure model adopts the constraint enhancement splitting criterion.
2. The multi-resource pool financial budgeting and cost estimation method according to claim 1, characterized in that, When collecting budget cost-related data, a unified key value is generated for each record of collected budget cost-related data. The unified key value includes at least the budget period, resource pool identifier, budget item, business project identifier, and data source identifier. The specific method for aligning budget cost-related data with time windows is as follows: For budget cost-related data with different settlement cycles, aggregate or split data of different granularities such as daily, weekly, monthly, and quarterly according to the target budget cycle; The specific method for handling missing values in budget cost-related data is as follows: for missing values that can be inferred from adjacent periods or similar resource pools, a weighted imputation method is used to generate substitute values; for fields that cannot be reliably imputed, missing value markers are retained and the data quality score is reduced. The specific method for handling outliers in budget cost-related data is as follows: based on the credibility of the source, the business approval status, and the fluctuation range of similar historical resource pools, they are marked as retained outliers, corrected outliers, or removed outliers. The specific method for generating data quality scores for budget cost-related data for each resource pool is as follows: calculation is based on missing rate, outlier ratio, update time lag, field consistency, and source credibility.
3. The multi-resource pool financial budgeting and cost estimation method according to claim 1, characterized in that, The cross-resource pool coupling matrix is generated through one or a combination of the following methods: reading the budget allocation rule table and filling the allocation ratio into the matrix; calculating the correlation or lag correlation between resource pools based on historical data and converting correlation coefficients exceeding the threshold into coupling weights; generating directed edges between resource pools based on the call chain, project affiliation, or resource dependency relationship in the business system; and manually correcting the automatically generated matrix. The cross-resource pool coupling matrix constraint is a row-normalized matrix. When the same shared cost source is allocated to multiple target resource pools, the sum of the weights of each target resource pool is 1. If the sum of the matrix weights does not meet the preset conditions, the allocation residual is automatically generated and used as a constraint penalty term when subsequent nodes split.
4. The multi-resource pool financial budgeting and cost estimation method according to claim 1, characterized in that, The hierarchical decision tree structure model traverses candidate splitting features and candidate thresholds at each node, calculates the loss of the left and right child nodes after splitting, and selects the features and thresholds that minimize the left and right child nodes as the splitting scheme.
5. The multi-resource pool financial budgeting and cost estimation method according to claim 1, characterized in that, It also includes the following steps: Continuously monitor the input feature distribution, prediction residuals, data quality scores, and cross-resource pool coupling matrices of each resource pool, calculate the budget drift index of each resource pool, and determine that the resource pool has experienced data drift when the budget drift index exceeds the drift threshold of the corresponding resource pool. The drift threshold is set according to the resource pool type, or automatically determined based on the quantiles on the historical validation set.
6. The multi-resource pool financial budgeting and cost estimation method according to claim 5, characterized in that, It also includes the following steps: When only a single or partial resource pool experiences budget drift, the resource pool-level decision tree corresponding to the resource pool that experienced budget drift is retrained, and the nodes related to that resource pool in the budget fusion-level decision tree are updated according to the output change of that resource pool-level decision tree. The incremental training set is composed of samples from the most recent N budget cycles of the resource pool where budget drift occurred and some historically stable samples. The incremental training set includes the latest samples after budget drift occurs, representative stable samples before budget drift occurs, and relevant resource pool samples with coupled weights to the resource pool where budget drift occurred. For updating the resource pool-level decision tree, when the budget drift is below the first threshold, the path from the root node to the intermediate node that meets the stability condition is retained, and only the leaf nodes or subtrees affected by the budget drift are replaced. When the budget drift is above the second threshold, the entire resource pool-level decision tree is retrained.
7. The multi-resource pool financial budgeting and cost estimation method according to claim 6, characterized in that, It also includes the following steps: When the cross-resource pool coupling matrix changes, the budget fusion level decision tree is updated while retaining the unaffected resource pool level decision tree, so that the total budget estimate can reflect the new sharing and allocation relationship. After the update is completed, record the model version, updated resource pool, reason for drift, verification metrics, and rollback flag.
8. The multi-resource pool financial budgeting and cost estimation method according to claim 1, characterized in that, It also includes the following steps: When a new resource pool is detected, the similarity between the new resource pool and existing resource pools is calculated based on the resource pool type, resource capacity, resource utilization rate, resource unit price, fixed cost, variable cost, shared cost sharing ratio, and historical cost volatility. If there is an existing resource pool with a similarity higher than the threshold, the decision tree structure of the existing resource pool is copied as the initial subtree of the new resource pool and adjusted using samples from the new resource pool. If there is no similar resource pool, a preset template subtree or rule model is used as the cold start model.
9. The multi-resource pool financial budgeting and cost estimation method according to claim 1, characterized in that, It also includes the following steps: The decision path is output simultaneously when the total budget estimate is output. The decision path includes the features that trigger the split, threshold conditions, leaf node statistics, constraint penalty terms, resource pool contribution rate, and sources of deviation.
10. A multi-resource pool financial budgeting and cost estimation device based on constraint-enhanced hierarchical decision trees, characterized in that, include: The data acquisition module is used to collect budget cost-related data from data sources corresponding to multiple resource pools, perform time window alignment, missing value handling, and outlier handling on the budget cost-related data, and generate a data quality score for each resource pool; the data acquisition module generates a unified key value for each budget cost-related data record, the unified key value including at least the budget period, resource pool identifier, budget item, business project identifier, and data source identifier; The profile generation module is used to extract features of each resource pool from the budget cost-related data, and to construct a resource pool profile vector by combining the features. And to generate a cross-resource pool coupling matrix based on the shared cost sharing relationship, business dependency relationship, common capacity bottleneck or resource substitution relationship between each resource pool; The model training module is used to train a hierarchical decision tree model using a constraint-enhanced splitting criterion. The hierarchical decision tree model includes a resource pool-level decision tree and a budget fusion-level decision tree. The budget forecasting module is used to input resource pool data for the new budget period into the trained hierarchical decision tree model and output resource pool-level cost estimates, total budget estimates, and budget deviation explanation information. The budget deviation explanation information includes the decision path of each resource pool in the resource pool-level decision tree, the contribution rate of each resource pool to the total budget, the model version number used, and the data fields recommended for review. The drift monitoring module is used to continuously monitor the input feature distribution, prediction residual, data quality score and cross-resource pool coupling matrix of each resource pool, calculate the budget drift index of each resource pool, and determine that the resource pool has experienced data drift when the budget drift index exceeds the drift threshold of the corresponding resource pool, triggering incremental retraining. The model version management module is used to compare the new model with the current old model on the validation set in multiple dimensions after the model is updated. The new version is only released when the new model meets the gating conditions; otherwise, it is rolled back to the old model and a manual review prompt is output. The gating conditions include that the mean square error of the validation set has not deteriorated beyond a preset threshold, the recognition rate of budget overrun samples has not decreased, the number of constraint violations has decreased or remained the same, and the prediction interpretation path is complete.
