A multi-level cloud resource intelligent charging method and device based on dynamic arrangement and risk assessment
By employing a multi-tiered intelligent billing method for cloud resources based on dynamic orchestration and risk assessment, and utilizing time-series decomposition and machine learning to predict resource demand, a credit risk model is constructed to optimize resource quotas. This addresses the issues of low resource utilization and insufficient credit risk assessment in cloud communication services, achieving efficient and stable intelligent billing and adaptability to business models.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XIAMEN XINGZONG DIGITAL TECH CO LTD
- Filing Date
- 2025-12-15
- Publication Date
- 2026-06-09
Smart Images

Figure CN122179250A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of cloud computing resource management, distributed systems and financial technology, and in particular to a multi-level cloud resource intelligent billing method and apparatus based on dynamic orchestration and risk assessment. Background Technology
[0002] In the cloud communication service sector, large service providers typically sell PBXs and related resources to end customers through multi-tiered distribution networks. Resource management under this business model faces significant challenges. Existing mainstream technical solutions have significant drawbacks: static quota allocation systems employ peak or average planning, leading to low resource utilization or resource shortages during peak periods, and their recycling mechanisms are rigid; auto-scaling systems based on simple thresholds suffer from lag and threshold oscillations, failing to cope with sudden demands; and prepaid resource package models result in poor user experience, tie up user funds, and cause fluctuations in supplier revenue.
[0003] The common shortcomings of existing technologies are: lack of forward-looking predictive capabilities, with decisions based on the past rather than the future; lack of quantitative assessment and control mechanisms for user credit risk when supporting the "use now, pay later" model; single optimization objectives, making it difficult to achieve dynamic balance among multiple objectives such as service level agreements, user experience, operator revenue, and fair cost sharing among complex distribution tiers; and poor system adaptability, unable to learn autonomously from historical data to cope with business changes.
[0004] Therefore, there is an urgent need in this field for a next-generation cloud resource management system that can achieve accurate demand forecasting, dynamic credit risk assessment, multi-objective optimization decision-making, and intelligent billing, in order to solve key issues of resource efficiency, business risk, and adaptation to complex business models.
[0005] Therefore, how to improve resource utilization and achieve intelligent billing with controllable risks while ensuring service quality is a problem that needs to be solved by those skilled in the art.
[0006] Application content This application provides a multi-level cloud resource intelligent billing method and apparatus based on dynamic orchestration and risk assessment, which can improve resource utilization and achieve risk-controllable intelligent billing while ensuring service quality.
[0007] The first aspect of this application provides a multi-tiered intelligent billing method for cloud resources based on dynamic orchestration and risk assessment, including: Continuously collect historical resource usage time-series data, historical recharge transaction data, and related business characteristic data from users at all levels of the cloud communication service system; Based on historical resource usage time series data, an integrated prediction model combining time series decomposition and machine learning is used to generate predicted resource demand values and uncertainty quantification ranges for each user within a specified future period. Based on historical resource usage time-series data and historical recharge transaction data, a dynamic credit risk model is constructed to calculate the probability of credit bankruptcy for each user in a future specified period. Using the predicted value of resource demand, the uncertainty quantification range, and the probability of credit bankruptcy as key inputs, a stochastic programming model with the total system cost, service quality, and credit risk as comprehensive optimization objectives is established and solved, and the output is the dynamic resource quota allocated to each user. Based on dynamic resource quotas, the available resource limits for each user in the resource pool are updated in real time, and the resource scheduler is driven to perform corresponding resource allocation, reservation and reclamation actions. Monitor the actual resource consumption of each user and calculate the billing through a billing function linked to the dynamic resource quota. The billing function applies a higher unit price to the portion of consumption exceeding the quota and provides a fee reduction for the portion of the quota that is not fully used.
[0008] Optionally, the method further includes: The system continuously monitors the credit bankruptcy probability of each user. When the credit bankruptcy probability of any user exceeds the preset warning threshold, the system automatically triggers the resource usage restriction process, including freezing the user's new resource applications and initiating the reclamation of idle resources.
[0009] Optionally, based on historical resource usage time-series data, an ensemble prediction model combining time-series decomposition and machine learning is used to generate predicted resource demand values and uncertainty quantification intervals for each user within a specified future period, including: The seasonal trend decomposition method was used to decompose the historical resource usage time series data into trend items, seasonal items, and residual items; Using machine learning models, with the decomposed trend term, seasonal term, residual term, and external business characteristic data as input, predict the future value of the residual term; Extrapolate the trend term and periodically replicate the seasonal term. Add the extrapolated trend term, the replicated seasonal term, and the predicted residual term to generate the predicted resource demand value. The quantile regression method is used to generate an uncertainty quantification interval to characterize the fluctuation range of the prediction results.
[0010] Optionally, based on historical resource usage time-series data and historical recharge transaction data, a dynamic credit risk model is constructed to calculate the probability of credit default for each user within a specified future period, including: The number of times a user consumes resources per unit of time is modeled as a Poisson process, where the strength parameter of the Poisson process is dynamically adjusted based on the predicted value of resource demand. Based on historical recharge transaction data, a nonparametric density estimation method is used to fit the probability distribution of user recharge amounts; Based on the user's initial credit limit, the consumption event sequence represented by the Poisson process, and the recharge event sequence represented by the empirical probability distribution, a composite stochastic process model describing the real-time changes in the user's credit balance is constructed. By solving the adjustment coefficient equation corresponding to the composite stochastic process model, the probability of a user's credit bankruptcy within a specified future period can be calculated.
[0011] Optionally, using the predicted resource demand, the uncertainty quantification range, and the probability of credit bankruptcy as key inputs, a stochastic programming model is established and solved with the total system cost, service quality, and credit risk as comprehensive optimization objectives. The output is a dynamic resource quota allocated to each user, including: A two-stage stochastic programming model is established. In the first stage, the decision variable is dynamic resource quota. In the second stage, the resource shortage or surplus caused by the realization of the demand stochasticity represented by the predicted value of resource demand and the uncertainty quantification range is compensated with corresponding penalty costs. The objective function of the two-stage stochastic programming model is set as minimizing the total expected cost. The total expected cost includes the baseline resource cost based on dynamic resource quotas, the expected penalty cost when resources are scarce, the expected idle cost when resources are abundant, and the risk exposure cost that is positively correlated with the probability of credit bankruptcy and dynamic resource quotas. By employing the sample average approximation method, a large number of demand stochastic scenarios are generated based on the predicted value of resource demand and the uncertainty quantification interval, thus transforming the two-stage stochastic programming model into a deterministic linear programming problem. A parallel optimization algorithm based on Benders decomposition is applied to solve a deterministic linear programming problem and output the dynamic resource quota for each user.
[0012] Optionally, the resource scheduler is driven to perform corresponding resource reclamation actions, including: When reclaiming allocated resources, the resource scheduler marks the target resource as pending reclamation and maintains the services currently being carried. While the target resource is in a pending reclamation state, continuously monitor and detect whether there are any active service sessions running on the target resource; When all active service sessions on the target resource are detected to have ended naturally, and after a preset security grace period, the resource scheduler performs a resource release operation to reclaim the target resource into the global resource pool.
[0013] Optionally, the method also includes: Assign a globally unique identifier to each resource consumption event to be billed, and verify the identifier before processing the event to ensure that the same event is not processed repeatedly. Before processing resource consumption events, persist the complete data of the resource consumption events to the write-ahead log store; The cumulative billing status is periodically saved as checkpoints; When the billing process resumes after being interrupted by a fault, the cumulative billing status is restored from the most recently saved checkpoint, and all unconfirmed events recorded in the write-ahead log after the checkpoint are replayed sequentially.
[0014] Optionally, billing calculations are performed using a billing function linked to dynamic resource quotas. This function applies a higher unit price to consumption exceeding the quota and provides fee reductions for unused portions of the quota. For the portion of a user's actual resource consumption that does not exceed their dynamic resource quota, the pre-set baseline unit price will be used for billing. For the portion of a user's actual resource consumption that exceeds their dynamic resource quota, a demand-based unit price higher than the baseline unit price will be charged. For the portion of dynamic resource quotas that users have been allocated but not actually consumed, the rebate amount is calculated based on a rebate unit price lower than the baseline unit price and deducted from the total cost.
[0015] The second aspect of this application provides a multi-level cloud resource intelligent billing device based on dynamic orchestration and risk assessment, comprising: The data acquisition unit is used to continuously collect historical resource usage time-series data, historical recharge transaction data, and related business characteristic data of users at all levels in the cloud communication service system. The demand forecasting unit is used to generate predicted resource demand values and uncertainty quantification ranges for each user within a specified future period based on historical resource usage time-series data and an integrated forecasting model that combines time-series decomposition and machine learning. The credit risk assessment unit is used to build a dynamic credit risk model based on historical resource usage time-series data and historical recharge transaction data, and to calculate the probability of credit bankruptcy for each user in a specified future period. The multi-objective optimization orchestration unit is used to establish and solve a stochastic programming model with total system cost, service quality and credit risk as comprehensive optimization objectives, using the predicted value of resource demand, the uncertainty quantification range and the probability of credit bankruptcy as key inputs, and outputs the dynamic resource quota allocated to each user. The resource quota execution unit is used to update the available resource limit of each user in the resource pool in real time according to the dynamic resource quota, and drive the resource scheduler to perform corresponding resource allocation, reservation and reclamation actions. The real-time billing unit is used to monitor the actual resource consumption of each user and perform billing calculations through a billing function linked to dynamic resource quotas. The billing function applies a higher unit price to the portion of consumption exceeding the quota and provides fee reductions for the portion of the quota that is not fully used.
[0016] A third aspect of this application provides an apparatus comprising: One or more processors; A memory on which one or more programs are stored; When the one or more programs are executed by the one or more processors, the one or more processors implement the multi-level cloud resource intelligent billing method based on dynamic orchestration and risk assessment as described in any of the above.
[0017] The fourth aspect of this application provides a computer storage medium for storing a program, which, when executed, is used to implement the multi-level cloud resource intelligent billing method based on dynamic orchestration and risk assessment as described in any of the preceding claims.
[0018] Compared with the prior art, this application has the following significant advantages: Revolutionary improvement in resource efficiency: Through accurate forecasting and multi-objective optimization, a paradigm shift has been achieved from "peak planning" to "dynamic average planning" and even "scientific over-sales", increasing the overall resource utilization rate of the system to near the theoretical limit, several times that of the static quota system.
[0019] Innovation in Business Model and Risk Control: For the first time, stochastic process models such as compound Poisson process and bankruptcy theory are deeply applied to cloud resource credit risk assessment, realizing dynamic quantification and proactive control of credit risk under the "use first, pay later" model, and expanding the feasibility boundaries of the business model.
[0020] Multi-objective dynamic optimal decision-making: By establishing a two-stage stochastic programming model with risk exposure, the system can achieve a global dynamic optimal balance in multiple dimensions such as cost, benefit, SLA compliance and credit risk, and the decision-making is highly scientific.
[0021] Incentive-compatible intelligent billing: The design incorporates a three-stage billing function (baseline price, excess high price, and idle rebate) that is linked to dynamic quotas. This not only guarantees supplier revenue but also incentivizes users to provide more accurate demand forecasts and fairly returns the value of idle resources, thus forming a virtuous cycle.
[0022] The system is highly reliable and available: Through resource security reclamation mechanisms, billing fault tolerance mechanisms (exact one-time semantics), and risk circuit breaker mechanisms, it ensures stable operation, service continuity, and data accuracy of the system in complex production environments, and has high engineering practical value.
[0023] Deep integration of technologies and high barriers to entry: This application organically integrates methods from multiple cutting-edge technology fields such as time series analysis, machine learning, stochastic processes, stochastic programming, and cooperative game theory, forming a unique technical solution for the specific scenario of cloud resource management, with significant technical barriers. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 A core architecture and data flow system architecture diagram of an intelligent closed-loop system provided in this application embodiment; Figure 2 A flowchart illustrating a multi-level cloud resource intelligent billing method based on dynamic orchestration and risk assessment, provided for an embodiment of this application; Figure 3 A schematic diagram of the structure of a multi-level cloud resource intelligent billing device based on dynamic orchestration and risk assessment provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of a device provided in an embodiment of this application. Detailed Implementation
[0026] This application provides a multi-level cloud resource intelligent billing method and apparatus based on dynamic orchestration and risk assessment, which can improve resource utilization and achieve risk-controllable intelligent billing while ensuring service quality.
[0027] To facilitate understanding, the application scenarios of the embodiments of this application will be introduced first.
[0028] In the cloud communications service sector, large ITSPs sell PBX services and related resources (number of extensions, concurrent connections, call recording capacity, etc.) to end customers through multi-tiered hosting user and reseller networks. This business model brings unprecedented complexity to resource management. The following section introduces existing technical solutions and their shortcomings: Static quota allocation systems pre-set fixed resource limits for each user, which are locked once allocated and cannot be dynamically adjusted. This approach suffers from low resource utilization. Its "peak planning" strategy results in resources being idle most of the time, while its "average planning" strategy leads to insufficient resources during peak business periods. It lacks flexibility, failing to cope with sudden business growth or cyclical fluctuations, making it difficult to balance user experience and resource efficiency. Furthermore, its rigid recycling mechanism relies on manual operation, resulting in slow response times and potential resource fragmentation.
[0029] An auto-scaling system based on a simple threshold automatically allocates additional resources when resource utilization exceeds a certain threshold. This approach suffers from several drawbacks: delayed response (always triggering expansion only after resources are exhausted, impacting service continuity); threshold oscillations (frequent scaling near the threshold leading to system instability and additional overhead); and a single-dimensional approach (considering only current utilization without comprehensively considering user credit, historical behavior, time periods, and other multi-dimensional information).
[0030] The prepaid resource package model involves users purchasing a certain amount of resources in advance, with costs deducted from usage. This approach suffers from poor user experience, requiring users to anticipate their business volume and leading to under-purchasing or over-purchasing; it also ties up capital, restricting users' working capital and hindering business expansion; and supplier revenue fluctuates, depending on the sale of new packages rather than the value of ongoing services.
[0031] The shortcomings of existing technologies can be summarized as follows: The system lacks predictive capabilities, failing to scientifically forecast future resource needs, and its decisions are based on the past and present rather than the future. Risk control is inadequate; when supporting the "use now, pay later" model, it lacks a quantitative assessment and control mechanism for user credit and overdraft risks. Optimization goals are singular, considering only resource utilization or single costs, failing to achieve a dynamic balance among multiple objectives such as service level agreements, user experience, operator revenue, and risk. The system has poor adaptability, unable to autonomously learn user behavior patterns from historical data to adapt to constantly changing business scenarios.
[0032] Therefore, this application proposes a multi-level cloud resource intelligent billing method and apparatus based on dynamic orchestration and risk assessment, which achieves elastic allocation, accurate metering, and risk control of cloud communication resources under complex multi-level distribution models, based on stochastic process prediction, stochastic programming, and online learning algorithms. Figure 1 As shown, Figure 1 This application provides a diagram of the core architecture and data flow system architecture of an intelligent closed-loop system. Figure 1 This diagram showcases the core architecture and data flow system architecture of the intelligent closed-loop system corresponding to the multi-level cloud resource intelligent billing method based on dynamic orchestration and risk assessment. It is divided into four layers: data perception layer, intelligent decision core, resource execution layer, and billing and control layer. The functions, modules, and data flow steps of each layer are as follows: The data perception layer is used for data input and preprocessing. As the system's data foundation layer, it is responsible for acquiring and processing raw data. The data flow steps are as follows: Multi-source data collection continuously acquires historical resource usage time-series data, historical recharge transaction data, and related business characteristic data of users at all levels in the cloud communication service system; The raw data is passed to the feature engineering engine, which performs feature extraction, cleaning, and structure transformation, and outputs the processed feature data to the intelligent decision-making core.
[0033] The intelligent decision-making core, used for logical calculations and decision output, serves as the central layer of the system. It receives feature data from the data perception layer and completes prediction, risk assessment, and resource allocation calculation. The data flow steps are as follows: Feature data is synchronously input into the demand forecasting engine (seasonal time series forecasting) and the credit and risk engine (stochastic processes and bankruptcy theory). The demand forecasting engine is based on a seasonal time series forecasting method to generate forecasts of resource demand for each user within a specified future period and the range of uncertainty. The credit and risk engine is based on stochastic processes and bankruptcy theory to build a model that calculates the probability of credit bankruptcy for each user in a specified future period. The demand forecast results, uncertainty quantification range, and credit bankruptcy probability are input into the multi-objective optimization engine (constrained stochastic programming). The multi-objective optimization model is solved by the constrained stochastic programming method, and the dynamic resource quota allocated to each user is output to the resource execution layer.
[0034] The resource execution layer is used for resource quota allocation and scheduling. As the system's resource operation layer, it receives dynamic resource quotas from the intelligent decision-making core, completes resource permission and scheduling actions, and the data flow steps are as follows: The dynamic credential management system receives dynamic resource quotas, updates the available resource limits for each user in the resource pool in real time, and synchronizes permission information to the billing and control layer. The resource reservation and scheduler receives dynamic resource quotas, performs resource allocation and reservation operations, and simultaneously synchronizes the resource scheduling status to the billing and control layer, and receives risk management instructions from that layer.
[0035] The billing and control layer is used for billing accounting and risk closure. As the system's closed-loop layer, it receives information from the resource execution layer and completes billing and risk management. The data flow steps are as follows: The real-time billing stream processing receives resource limit information synchronized from the dynamic voucher management system and combines it with the user's actual resource consumption to complete real-time billing calculations. The risk control and circuit breaker system receives resource status information from the resource reservation and scheduler, and also receives the credit bankruptcy probability output by the intelligent decision-making core. When the credit risk reaches the warning condition, it triggers the resource usage restriction process and feeds back the control instructions to the resource reservation and scheduler, forming a risk control closed loop.
[0036] See Figure 2 This figure is a flowchart illustrating a multi-tiered intelligent billing method for cloud resources based on dynamic orchestration and risk assessment, provided in an embodiment of this application. The multi-tiered intelligent billing method for cloud resources based on dynamic orchestration and risk assessment provided in this embodiment of the application combines... Figure 1 For example, this can be achieved through the following steps S201-206.
[0037] S201: Continuously collect historical resource usage time-series data, historical recharge transaction data, and related business characteristic data of users at all levels in the cloud communication service system.
[0038] S202: Based on historical resource usage time-series data, an integrated prediction model combining time-series decomposition and machine learning is used to generate predicted resource demand values and uncertainty quantification ranges for each user within a specified future period.
[0039] In this embodiment, a seasonal trend decomposition method is used to decompose historical resource usage time-series data into trend items, seasonal items, and residual items. A machine learning model is used to predict the future value of the residual items, taking the decomposed trend items, seasonal items, residual items, and external business characteristic data as input. The trend items are extrapolated, and the seasonal items are periodically replicated. The extrapolated trend items, replicated seasonal items, and predicted residual items are added to generate the predicted value of resource demand. A quantile regression method is used to generate an uncertainty quantification interval to characterize the fluctuation range of the prediction results.
[0040] Specifically, through a demand forecasting engine, it accurately predicts each user's needs in the future. resource demand An ensemble model combining STL (Seasonal and Trend decomposition using Loess) and XGBoost is employed. STL decomposition converts historical resource usage time series data... Decomposed into: ; in, The trend term is obtained by smoothing using local weighted regression. For seasonal items, it captures periodic patterns such as daily, weekly, and monthly cycles. This is the residual term, representing random fluctuations.
[0041] XGBoost prediction uses the decomposed components , , and external features (e.g., weekdays / holidays, marketing campaign logos, historical year-on-year growth rate) as input.
[0042] The historical year-on-year growth rate uses a weighted compound growth rate, expressed as follows:
[0043]
[0044] in, Indicates the same period period, such as 7 days (week-on-week) or 30 days (month-on-month); This represents the exponentially weighted moving average (EWMA) value calculated using the first M data points from the same period. To smooth out accidental fluctuations.
[0045] For ITSP (top level): Focus on macro trends. Typically set to 30 days, this analyzes the month-on-month growth rate. Smaller values (such as 0.3) emphasize long-term trends.
[0046] For Resellers (middle management): Focus on business fluctuations. Typically set to 7 days, this analysis focuses on week-on-week growth rates. The value should be moderate (e.g., 0.5).
[0047] For End-User (underlying layer): Focus on instantaneous changes. It can be set to 1 day to analyze the daily month-on-month growth rate. Larger values (e.g., 0.7) indicate a rapid response to changes.
[0048] The interaction logic between STL decomposition and XGBoost is as follows: Decomposition: Using STL to decompose the history sequence Decomposed into , , .
[0049] Extrapolation: Trend Item :right The sequence was extrapolated using Holt's Linear Trend model. This model captures both horizontal and trend levels, and its update equation is: Level:
[0050] Trend:
[0051]
[0052] in, To predict the step size.
[0053] Seasonal items Directly copy the seasonal item from the previous complete cycle. For example, for a daily cycle, .
[0054] Residual prediction: External features Together they serve as inputs to XGBoost to predict future residuals. .
[0055] Training XGBoost models To predict the future value of the residual term .
[0056] The final predicted value is: ;in, and It is obtained by extrapolation from STL decomposition.
[0057] Conventional STL performs only simple extrapolation, while this application entrusts the difficult-to-predict residual terms to the powerful XGBoost model, utilizing external features to improve prediction accuracy.
[0058] To quantify the uncertainty of the forecast, quantile regression forest is used to calculate the [10%, 90%] quantile interval of the predicted value. The uncertainty range of demand is represented by this value. The number of decision trees can be set to 500. This is based on the OOB error curve; when the number of trees exceeds 500, the error tends to plateau. The splitting criterion uses a custom quantile loss function instead of variance. For the ... quantiles, loss function is .
[0059] In the bootstrap sampling of the forest, recent data samples are given higher weights, making the model more attentive to recent changes. To address cloud resource requirements, in the splitting of each tree, features strongly correlated with time (such as time_of_day, day_of_week) are prioritized for splitting.
[0060] S203: Based on historical resource usage time-series data and historical recharge transaction data, construct a dynamic credit risk model to calculate the probability of credit bankruptcy for each user within a specified future period.
[0061] In this embodiment, the number of times a user consumes resources per unit time is modeled as a Poisson process, wherein the strength parameter of the Poisson process is dynamically adjusted according to the predicted value of resource demand; based on historical recharge transaction data, a nonparametric density estimation method is used to fit the probability distribution of the user's recharge amount; based on the user's initial credit limit, the consumption event sequence represented by the Poisson process, and the recharge event sequence represented by the empirical probability distribution, a composite stochastic process model describing the real-time changes in the user's credit balance is constructed; by solving the adjustment coefficient equation corresponding to the composite stochastic process model, the probability of the user's credit bankruptcy in a specified future period is calculated.
[0062] Specifically, a credit and risk engine dynamically assesses users' credit status and overdraft risk, providing a basis for resource allocation decisions. Users' resource consumption and recharge behavior is modeled as a composite Poisson process. The user's resource consumption and recharge behavior... Resource consumption per unit of time Follows Poisson distribution Among them, strength parameters Output from the demand forecasting engine Dynamic adjustment. This is the intensity parameter of the Poisson distribution, representing the average number of consumptions per unit time. It is then compared with the predicted demand. Dynamic binding via a linear association function: ; in, To minimize the intensity, the process should be prevented from terminating when the predicted value is 0. This scaling factor converts the predicted resource usage units (e.g., "concurrency") into the number of events per unit of time (e.g., "times / minute"). This factor is obtained by fitting historical data.
[0063] Viewing user top-up behavior as an update process, the top-up amount... These are independent and identically distributed random variables, following an empirical distribution. Kernel density estimation is used to fit a nonparametric empirical distribution from actual user recharge data. : in, For kernel functions (such as Gaussian kernels); For bandwidth, selection is made through cross-validation. This method uses historical recharge amount data to more accurately capture the complex characteristics of real recharge behavior, such as multi-peak and skewed patterns.
[0064] Risk model (Cramér-Lundberg model variant): Define the user's "surplus process". :
[0065] in, For initial credit limits (such as prepaid fees); This represents the number of times a user has recharged up to time t.
[0066] Bankruptcy probability is determined by the user's credit failure within a time frame T (i.e., The probability of ) The following inequality can be used for approximate estimation: ; in, It is an adjustment coefficient, and it is part of the equation. The correct answer is... yes The moment generating function. Traditional solution Solving complex equations is required. This application proposes an approximate solution method based on gradient descent: by defining a function... Use gradient descent to find The root. Gradient ,in It is the derivative of the moment generating function. Initialization. iteration The method provided in this application is computationally faster than numerical root-finding methods, and is particularly suitable for... until convergence. Complex distribution situations.
[0067] Dynamic credit limits, based on real-time calculated bankruptcy probabilities. Adjusting user soft quotas: ; When bankruptcy risk When the limit is raised, the soft limit is automatically tightened to control the risk of bad debts.
[0068] S204: Using the predicted value of resource demand, the uncertainty quantification range, and the probability of credit bankruptcy as key inputs, establish and solve a stochastic programming model with the total system cost, service quality, and credit risk as comprehensive optimization objectives, and output the dynamic resource quota allocated to each user.
[0069] In this embodiment, a two-stage stochastic programming model is established. The first-stage decision variable is dynamic resource quota. The second-stage model compensates for resource shortages or surpluses caused by the realization of demand randomness represented by the predicted resource demand and the uncertainty quantification interval, using corresponding penalty costs. The objective function of the two-stage stochastic programming model is set as minimizing the total expected cost, which includes the baseline resource cost based on the dynamic resource quota, the expected penalty cost during resource shortages, the expected idle cost during resource surpluses, and the risk exposure cost positively correlated with the probability of credit default and the dynamic resource quota. A sample averaging approximation method is used to generate a large number of demand random scenarios based on the predicted resource demand and the uncertainty quantification interval, transforming the two-stage stochastic programming model into a deterministic linear programming problem. A parallel optimization algorithm based on Benders decomposition is applied to solve the deterministic linear programming problem, outputting the dynamic resource quota for each user.
[0070] Specifically, through a multi-objective optimization engine, the optimal resource allocation strategy for each user is dynamically determined while satisfying system constraints. To balance multiple competing objectives, a two-stage stochastic programming model is established. The first stage is the decision-making stage (Here-and-Now), where uncertainty in demand is observed. Previously, the baseline amount of resources allocated to each user was determined. The second stage, recourse (Wait-and-See), addresses uncertain demand. If resource shortages occur after implementation or surplus Remedial measures (such as pay-as-you-go billing or performance degradation) will be taken, and corresponding costs will be incurred.
[0071] Differentiated constraints are set for different resource types of PBX services, such as the number of extensions and concurrent connections. The global constraint is... ; The minimum guarantee for users is .
[0072] Resource type differentiation constraints include: Number of extensions: It is an integer, and .
[0073] Concurrency: It must be an integer and satisfy the following conditions:
[0074] Among them, the function Determined by performance testing.
[0075] The objective function includes: Minimize is represented as follows:
[0076] in, Baseline cost per unit of resource; Unit penalty costs for resource shortages (such as SLA default costs); The unit idle cost of resources in surplus; Risk aversion coefficient; Risk exposure, and the probability of user bankruptcy. and allocation amount Positive correlation. This is expressed as follows: ; in, This represents the probability of bankruptcy, indicating the user's own risk. This represents the risk exposure resulting from the allocation amount. The logarithmic function is used to account for diminishing marginal returns; that is, when the allocation amount is large, the risk increase with each additional unit of allocation gradually decreases.
[0077] Solution: Due to requirements The distribution is complex, so a sample averaging approximation method is used to generate S demand scenarios from the prediction model. The original problem is transformed into a large-scale linear programming problem, and then solved efficiently using the interior point method or column generation method.
[0078] Set an allowable estimation error. (e.g., 0.5%) and confidence level (e.g., 95%), for example, initially generating a large scene set. (Based on various scenarios tested in R&D), the standard deviation of the objective function value under different S values is calculated using Bootstrap sampling, and the target function value that meets the requirements is selected. The minimum S value.
[0079] A parallel column generation algorithm based on Benders decomposition is adopted.
[0080] The solution is layered, decoupling the decision-making parts of ITSP, Hosting User, and Reseller, forming a main problem and multiple sub-problems.
[0081] Parallel computing allows for independent solving of the second-stage recourse problem for different users. For 90% of requests, the solution time can be kept within 1000 milliseconds, meeting real-time requirements.
[0082] In one implementation of this application, when the multi-objective optimization engine fails to solve the problem, a degradation scheme is executed. The first-level degradation (fast heuristic) involves using a greedy algorithm if convergence is not achieved within 1 second, based on the user's value density. Resources are allocated from high to low until they are exhausted. The second-level fallback (fixed rule) is to revert to a proportional allocation strategy if the heuristic also fails. .
[0083] In one implementation of this application, when the resource scheduler performs resource reclamation, in order to avoid affecting the user's ongoing PBX services (such as calls and recordings), a pre-occupied resource protection mechanism is set up, including: Resource marking: When the scheduler issues a reclamation command, the resource is not released immediately, but is marked as "pending reclamation".
[0084] Heartbeat detection: The system continuously checks whether there are still active sessions on this resource (such as a call in progress or a recording file being written).
[0085] Delayed release: The reclaimer will only perform the release operation after all active sessions on the resource have ended naturally (call ended, recording completed) and a safe grace period (e.g., 60 seconds) has elapsed.
[0086] Resource transfer: For high-priority services, the system will attempt to migrate them to other idle resources in real time before reclaiming them.
[0087] S205: Based on dynamic resource quotas, update the available resource limits for each user in the resource pool in real time, and drive the resource scheduler to perform corresponding resource allocation, reservation and reclamation actions.
[0088] In this embodiment of the application, when the allocated resources are reclaimed, the resource scheduler marks the target resource as pending reclamation and maintains the currently carried services; while the target resource is in the pending reclamation state, it continuously monitors and detects whether there are any active service sessions in progress on the target resource; when it is detected that all active service sessions on the target resource have ended naturally, and after a preset security grace period, the resource scheduler performs a resource release operation to reclaim the target resource into the global resource pool.
[0089] Specifically, dynamic credentials optimize the decision-making process of the engine output. The user's resource credentials will be updated in real time.
[0090]
[0091] in, It is a dynamic value, and the calculation formula is: ; Basic free quota; For credit scoring, ; Historical consumption frequency; The depth of the distribution hierarchy (ITSP is 1, its subordinate level is 2, and so on). , , The weighting coefficient is positive.
[0092] Resource credentials are updated in real time, and the user's available quota is adjusted to... .
[0093] The resource scheduler performs resource reservation, allocation, and reclamation based on the new quotas.
[0094] S206: Monitor the actual resource consumption of each user and perform billing calculations through a billing function linked to dynamic resource quotas.
[0095] In this embodiment, the billing function applies a higher unit price to the portion of consumption exceeding the quota, and provides a fee reduction for the portion of the quota that is not fully used.
[0096] Specifically, real-time billing and cost allocation include: Use a stream processing engine to calculate each user's actual resource consumption in real time. .
[0097] The billing formula is as follows:
[0098] in, Baseline resource unit price; On-demand resource unit price ( ); Rewards for idle resources (incentivizing users to provide accurate predictions) ).
[0099] Multi-tiered cost allocation uses the Shapley value algorithm to fairly distribute costs among ITSPs, Hosting Users, and Resellers. (Shapley value) The calculation formula is:
[0100] in It is an alliance Total cost It is the set of all participants. This method guarantees fairness and incentive compatibility in the allocation.
[0101] In one implementation of this application, the credit bankruptcy probability of each user is continuously monitored. When the credit bankruptcy probability of any user exceeds a preset warning threshold, a resource usage restriction process is automatically triggered, including freezing the user's new resource applications and initiating the recycling of idle resources.
[0102] Specifically, when the user's probability of bankruptcy... Exceeding the safety threshold (e.g.) When this happens, the execution flow is as follows: Identification: The risk engine calculates every 30 seconds. .
[0103] Decision: If It immediately sends a signal to the fuse controller.
[0104] Execution: Step 1 (instantaneous), immediately apply the user's... Set as New resource allocation is prohibited; The second step (asynchronous) involves sending instructions to the resource scheduler to gradually reclaim allocated but unused reserved resources.
[0105] Notification: Send alerts to users and administrators.
[0106] Total time: From risk identification to completion of the main limiting action, the total time is controlled within 1000 milliseconds.
[0107] When data loss or delay occurs in the stream processing engine, the "end-to-end exact once semantics" and "checkpoint and replay" mechanisms are used to ensure billing accuracy. The specific methods are as follows: Idempotency design: Each billing event carries a unique ID, and the processor checks whether the ID has been processed before to avoid duplicate billing.
[0108] WAL (Write-Ahead Log): Events are persisted to reliable distributed storage (such as HDFS) before being processed.
[0109] Periodic checkpoints: Stream processing tasks periodically save their status (such as cumulative usage) as checkpoints.
[0110] Fault recovery: When a task fails and restarts, restore the state from the most recent checkpoint and replay subsequent events from the WAL.
[0111] Through the above mechanisms, even if data loss or delay occurs, the final billing result can be guaranteed to be 100% accurate.
[0112] Beneficial Effects: From Passive Response to Proactive Prediction and Optimization: Through seasonal time series forecasting and constrained stochastic programming, the system can proactively make optimal resource allocation decisions, maximizing resource utilization and business benefits while ensuring SLA. Compared to the passive response model of the 'static quota allocation system,' the improvement in resource utilization in this application is an inevitable result of paradigm innovation, and its superiority lies in its fundamental mechanism: the shift from 'peak planning' to 'average planning.' Static systems must allocate enough resources to each user to cover their peak business hours, resulting in a large amount of idle resources during off-peak periods, which account for more than 95% of business time. Its theoretical utilization ceiling is extremely low; this application, based on prediction, dynamically allocates resources close to the real-time average demand of users. Through global optimization, the overall system resources serve the 'off-peak demand' of all users, thereby theoretically increasing resource utilization to nearly 100%. The leap from 'resource idleness' to 'resource overselling' stems from the fact that static system resources are monopolized by fixed users, failing to create a resource pool effect, essentially resulting in 'resource idleness'. This application uses a stochastic programming model to scientifically calculate the optimal overselling rate while satisfying the SLAs of all users. This is equivalent to an airline selling tickets, converting 'idle seats' into 'effective revenue,' which is the core of the qualitative change in utilization. The evolution from 'manual recycling' to 'automatic recycling' is also significant. Static system resource recycling relies on manual processes, which are time-consuming, prone to omissions, and create 'resource black holes.' This application uses an event-driven resource state flow to automate the entire lifecycle management of resources—'creation-reservation-use-release'—ensuring that resources are instantly recycled and returned to the pool as soon as they become idle, completely eliminating the window of resource idleness. Therefore, the resource utilization improvement brought about by this application is not a simple quantitative change, but a qualitative leap from 'inevitable idleness' to 'near-full utilization'.
[0113] Scientific credit and risk control: Through the compound Poisson process and bankruptcy theory, dynamic quantitative assessment of user credit risk is achieved, enabling the "use now, pay later" business model to be realized under the premise of controllable risk.
[0114] Multi-objective dynamic balance: The model simultaneously optimizes multiple objectives such as cost, revenue, risk and user experience, and achieves fair cost sharing in complex distribution networks through algorithms such as Shapley value, thus promoting the healthy development of the ecosystem.
[0115] Deep integration and innovation of technologies: This application deeply integrates advanced mathematical and statistical models such as time series analysis, stochastic processes, stochastic programming, and cooperative game theory into the specific business scenarios of cloud computing resource management, forming a scientific, rigorous, and efficient decision-making system with significant technological barriers.
[0116] Based on the methods provided in the above embodiments, this application also provides a multi-level cloud resource intelligent billing device based on dynamic orchestration and risk assessment. The following describes the multi-level cloud resource intelligent billing device based on dynamic orchestration and risk assessment in conjunction with the accompanying drawings.
[0117] See Figure 3 The figure is a schematic diagram of the structure of a multi-level cloud resource intelligent billing device based on dynamic orchestration and risk assessment provided in an embodiment of this application.
[0118] The multi-level cloud resource intelligent billing device 300 based on dynamic orchestration and risk assessment provided in this application includes: a data acquisition unit 301, a demand forecasting unit 302, a credit risk assessment unit 303, a multi-objective optimization orchestration unit 304, a resource quota execution unit 305, and a real-time billing unit 306.
[0119] The data acquisition unit 301 is used to continuously collect historical resource usage time-series data, historical recharge transaction data, and related business characteristic data of users at all levels in the cloud communication service system. Demand forecasting unit 302 is used to generate predicted resource demand values and uncertainty quantification ranges for each user within a specified future period based on historical resource usage time series data and an integrated forecasting model that combines time series decomposition and machine learning. Credit risk assessment unit 303 is used to construct a dynamic credit risk model based on historical resource usage time series data and historical recharge transaction data, and to calculate the probability of credit bankruptcy for each user in a specified future period. The multi-objective optimization orchestration unit 304 is used to establish and solve a stochastic programming model with total system cost, service quality and credit risk as comprehensive optimization objectives, using the predicted value of resource demand, the uncertainty quantification range and the probability of credit bankruptcy as key inputs, and output the dynamic resource quota allocated to each user. The resource quota execution unit 305 is used to update the available resource limit of each user in the resource pool in real time according to the dynamic resource quota, and drive the resource scheduler to perform corresponding resource allocation, reservation and reclamation actions. The real-time billing unit 306 is used to monitor the actual resource consumption of each user and perform billing calculations through a billing function linked to the dynamic resource quota. The billing function applies a higher unit price to the portion of consumption exceeding the quota and provides fee reductions for the portion of the quota that is not fully used.
[0120] In one possible implementation, the multi-level cloud resource intelligent billing device 300 based on dynamic orchestration and risk assessment further includes a risk monitoring and circuit breaker unit, used for: The system continuously monitors the credit bankruptcy probability of each user. When the credit bankruptcy probability of any user exceeds the preset warning threshold, the system automatically triggers the resource usage restriction process, including freezing the user's new resource applications and initiating the reclamation of idle resources.
[0121] In one possible implementation, the demand forecasting unit 302 is specifically used for: The seasonal trend decomposition method was used to decompose the historical resource usage time series data into trend items, seasonal items, and residual items; Using machine learning models, with the decomposed trend term, seasonal term, residual term, and external business characteristic data as input, predict the future value of the residual term; Extrapolate the trend term and periodically replicate the seasonal term. Add the extrapolated trend term, the replicated seasonal term, and the predicted residual term to generate the predicted resource demand value. The quantile regression method is used to generate an uncertainty quantification interval to characterize the fluctuation range of the prediction results.
[0122] In one possible implementation, the credit risk assessment unit 303 has the function of: The number of times a user consumes resources per unit of time is modeled as a Poisson process, where the strength parameter of the Poisson process is dynamically adjusted based on the predicted value of resource demand. Based on historical recharge transaction data, a nonparametric density estimation method is used to fit the probability distribution of user recharge amounts; Based on the user's initial credit limit, the consumption event sequence represented by the Poisson process, and the recharge event sequence represented by the empirical probability distribution, a composite stochastic process model describing the real-time changes in the user's credit balance is constructed. By solving the adjustment coefficient equation corresponding to the composite stochastic process model, the probability of a user's credit bankruptcy within a specified future period can be calculated.
[0123] In one possible implementation, the multi-objective optimization orchestration unit 304 has the following functions: A two-stage stochastic programming model is established. In the first stage, the decision variable is dynamic resource quota. In the second stage, the resource shortage or surplus caused by the realization of the demand stochasticity represented by the predicted value of resource demand and the uncertainty quantification range is compensated with corresponding penalty costs. The objective function of the two-stage stochastic programming model is set as minimizing the total expected cost. The total expected cost includes the baseline resource cost based on dynamic resource quotas, the expected penalty cost when resources are scarce, the expected idle cost when resources are abundant, and the risk exposure cost that is positively correlated with the probability of credit bankruptcy and dynamic resource quotas. By employing the sample average approximation method, a large number of demand stochastic scenarios are generated based on the predicted value of resource demand and the uncertainty quantification interval, thus transforming the two-stage stochastic programming model into a deterministic linear programming problem. A parallel optimization algorithm based on Benders decomposition is applied to solve a deterministic linear programming problem and output the dynamic resource quota for each user.
[0124] In one possible implementation, the resource quota execution unit 305 has the following functions: When reclaiming allocated resources, the resource scheduler marks the target resource as pending reclamation and maintains the services currently being carried. While the target resource is in a pending reclamation state, continuously monitor and detect whether there are any active service sessions running on the target resource; When all active service sessions on the target resource are detected to have ended naturally, and after a preset security grace period, the resource scheduler performs a resource release operation to reclaim the target resource into the global resource pool.
[0125] In one possible implementation, the device 300 further includes a fault repair unit for: Assign a globally unique identifier to each resource consumption event to be billed, and verify the identifier before processing the event to ensure that the same event is not processed repeatedly. Before processing resource consumption events, persist the complete data of the resource consumption events to the write-ahead log store; The cumulative billing status is periodically saved as checkpoints; When the billing process resumes after being interrupted by a fault, the cumulative billing status is restored from the most recently saved checkpoint, and all unconfirmed events recorded in the write-ahead log after the checkpoint are replayed sequentially.
[0126] In one possible implementation, the real-time billing unit 306 has features for: For the portion of a user's actual resource consumption that does not exceed their dynamic resource quota, the pre-set baseline unit price will be used for billing. For the portion of a user's actual resource consumption that exceeds their dynamic resource quota, a demand-based unit price higher than the baseline unit price will be charged. For the portion of dynamic resource quotas that users have been allocated but not actually consumed, the rebate amount is calculated based on a rebate unit price lower than the baseline unit price and deducted from the total cost.
[0127] Since the multi-level cloud resource intelligent billing device 300 based on dynamic orchestration and risk assessment is a device corresponding to the multi-level cloud resource intelligent billing method based on dynamic orchestration and risk assessment provided in the above method embodiments, the specific implementation of each unit of the multi-level cloud resource intelligent billing device 300 based on dynamic orchestration and risk assessment is based on the same concept as in the above method embodiments. Therefore, for the specific implementation of each unit of the multi-level cloud resource intelligent billing device 300 based on dynamic orchestration and risk assessment, please refer to the description of the multi-level cloud resource intelligent billing method based on dynamic orchestration and risk assessment in the above method embodiments, and will not be repeated here.
[0128] This application embodiment also provides a device, the device including: a processor and a memory; The memory is used to store instructions; The processor is used to execute the instructions in the memory to perform the multi-level cloud resource intelligent billing method based on dynamic orchestration and risk assessment mentioned in the above embodiments.
[0129] It should be noted that the hardware structure of the multi-level cloud resource intelligent billing device based on dynamic orchestration and risk assessment provided in this application embodiment can be as follows: Figure 4 The structure shown, Figure 4 This is a schematic diagram of the structure of a device provided in an embodiment of this application.
[0130] Please see Figure 4 As shown, device 400 includes: processor 410, communication interface 420, and memory 430. The number of processors 410 in device 400 can be one or more. Figure 4 Taking a processor as an example. In this embodiment, the processor 410, communication interface 420, and memory 430 can be connected via a bus system or other means, wherein, Figure 4 Taking the connection between China and Israel via the bus system 440 as an example.
[0131] Processor 410 may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and an NP. Processor 410 may further include hardware chips. These hardware chips may be application-specific integrated circuits (ASICs), programmable logic devices (PLDs), or combinations thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), generic array logic (GAL), or any combination thereof.
[0132] The memory 430 may include volatile memory, such as random-access memory (RAM); the memory 430 may also include non-volatile memory, such as flash memory, hard disk drive (HDD) or solid-state drive (SSD); the memory 430 may also include a combination of the above types of memory.
[0133] Optionally, the memory 430 stores an operating system and programs, executable modules, or data structures, or subsets thereof, or extended sets thereof. The programs may include various operation instructions for implementing various operations. The operating system may include various system programs for implementing various basic services and handling hardware-based tasks. The processor 410 can read the programs in the memory 430 to implement the multi-level cloud resource intelligent billing method based on dynamic orchestration and risk assessment provided in this embodiment.
[0134] The bus system 440 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus system 440 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0135] This application also provides a computer-readable storage medium including instructions that, when executed on a computer, cause the computer to perform the multi-level cloud resource intelligent billing method based on dynamic orchestration and risk assessment mentioned in the above embodiments.
[0136] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to execute the multi-level cloud resource intelligent billing method based on dynamic orchestration and risk assessment mentioned in the above embodiments.
[0137] Although this application has been specifically shown and described in conjunction with preferred embodiments, those skilled in the art should understand that various changes in form and detail may be made to this application without departing from the spirit and scope of this application as defined by the appended claims, and all such changes shall be within the scope of protection of this application.
Claims
1. A multi-tiered intelligent billing method for cloud resources based on dynamic orchestration and risk assessment, characterized in that, include: Continuously collect historical resource usage time-series data, historical recharge transaction data, and related business characteristic data from users at all levels of the cloud communication service system; Based on the historical resource usage time series data, an integrated prediction model combining time series decomposition and machine learning is used to generate predicted resource demand values and uncertainty quantification intervals for each user within a specified future period. Based on the historical resource usage time series data and the historical recharge transaction data, a dynamic credit risk model is constructed to calculate the credit bankruptcy probability of each user in the specified future period. Using the predicted resource demand, the uncertainty quantification range, and the credit bankruptcy probability as key inputs, a stochastic programming model with total system cost, service quality, and credit risk as comprehensive optimization objectives is established and solved, and the dynamic resource quota allocated to each user is output. Based on the dynamic resource quota, the available resource limit for each user in the resource pool is updated in real time, and the resource scheduler is driven to perform corresponding resource allocation, reservation and reclamation actions. The system monitors the actual resource consumption of each user and performs billing calculations using a billing function linked to the dynamic resource quota. The billing function applies a higher unit price to the portion of consumption exceeding the quota and provides fee reductions for the portion of the quota that is not fully utilized.
2. The method according to claim 1, characterized in that, The method further includes: The system continuously monitors the credit bankruptcy probability of each user. When the credit bankruptcy probability of any user exceeds a preset warning threshold, the system automatically triggers a resource usage restriction process, including freezing the user's new resource applications and initiating the reclamation of idle resources.
3. The method according to claim 1, characterized in that, The method, based on the historical resource usage time-series data, employs an ensemble prediction model combining time-series decomposition and machine learning to generate predicted resource demand values and uncertainty quantification intervals for each user within a specified future period, including: The historical resource usage time series data is decomposed into trend, seasonal and residual terms using the seasonal trend decomposition method. Using a machine learning model, with the decomposed trend term, seasonal term, residual term, and external business feature data as input, the future value of the residual term is predicted; Extrapolate the trend term, periodically replicate the seasonal term, and add the extrapolated trend term, the replicated seasonal term, and the predicted residual term to generate the predicted resource demand value. The uncertainty quantification interval is generated by using the quantile regression method to characterize the fluctuation range of the prediction results.
4. The method according to claim 1, characterized in that, The process of constructing a dynamic credit risk model based on the historical resource usage time-series data and the historical recharge transaction data to calculate the probability of credit default for each user within the specified future period includes: The number of times a user consumes resources per unit time is modeled as a Poisson process, wherein the intensity parameter of the Poisson process is dynamically adjusted according to the predicted value of resource demand. Based on the historical recharge transaction data, a nonparametric density estimation method is used to fit the probability distribution of user recharge amounts; Based on the user's initial credit limit, the consumption event sequence represented by the Poisson process, and the recharge event sequence represented by the empirical probability distribution, a composite stochastic process model describing the real-time changes in the user's credit balance is constructed. By solving the adjustment coefficient equation corresponding to the composite stochastic process model, the probability of the user's credit bankruptcy within the specified future period can be calculated.
5. The method according to claim 1, characterized in that, The method uses the predicted resource demand, the uncertainty quantification range, and the credit bankruptcy probability as key inputs to establish and solve a stochastic programming model with total system cost, service quality, and credit risk as comprehensive optimization objectives. The output is a dynamic resource quota allocated to each user, including: A two-stage stochastic programming model is established, wherein the decision variable in the first stage is the dynamic resource quota, and the second stage compensates for the resource shortage or surplus caused by the realization of the demand stochasticity represented by the predicted value of resource demand and the uncertainty quantification range with corresponding penalty costs. The objective function of the two-stage stochastic programming model is set as minimizing the total expected cost, which includes the baseline resource cost based on the dynamic resource quota, the expected penalty cost when resources are scarce, the expected idle cost when resources are abundant, and the risk exposure cost that is positively correlated with the credit bankruptcy probability and the dynamic resource quota. Using the sample average approximation method, a large number of demand stochastic scenarios are generated based on the predicted resource demand and the uncertainty quantification interval, transforming the two-stage stochastic programming model into a deterministic linear programming problem; The deterministic linear programming problem is solved by applying a parallel optimization algorithm based on Benders decomposition, and the dynamic resource quota for each user is output.
6. The method according to claim 1, characterized in that, The driving resource scheduler performs corresponding resource reclamation actions, including: When reclaiming allocated resources, the resource scheduler marks the target resource as pending reclamation and maintains the currently carried service; While the target resource is in a pending recovery state, continuously monitor and detect whether there are any active service sessions running on the target resource; When it is detected that all active service sessions on the target resource have ended naturally, and after a preset security grace period, the resource scheduler performs a resource release operation to reclaim the target resource into the global resource pool.
7. The method according to claim 1, characterized in that, The method also includes: Assign a globally unique identifier to each resource consumption event to be billed, and verify the identifier before processing the event to ensure that the same event is not processed repeatedly. Before processing resource consumption events, persist the complete data of the resource consumption events to the write-ahead log store; The cumulative billing status is periodically saved as checkpoints; When the billing process resumes after being interrupted by a fault, the cumulative billing status is restored from the most recently saved checkpoint, and all unconfirmed events recorded in the write-ahead log after the checkpoint are replayed sequentially.
8. The method according to claim 1, characterized in that, The billing calculation is performed through a billing function linked to the dynamic resource quota. This billing function applies a higher unit price to consumption exceeding the quota and provides fee reductions for unused portions of the quota. For the portion of a user's actual resource consumption that does not exceed their dynamic resource quota, the user will be charged at the preset baseline unit price. For the portion of a user's actual resource consumption that exceeds their dynamic resource quota, a charge will be applied at an on-demand unit price that is higher than the baseline unit price. For the portion of the dynamic resource quota that a user has been allocated but not actually consumed, a rebate amount is calculated at a rebate unit price lower than the baseline unit price and deducted from the total cost.
9. A multi-level cloud resource intelligent billing device based on dynamic orchestration and risk assessment, characterized in that, include: The data acquisition unit is used to continuously collect historical resource usage time-series data, historical recharge transaction data, and related business characteristic data of users at all levels in the cloud communication service system. The demand forecasting unit is used to generate predicted resource demand values and uncertainty quantification ranges for each user within a specified future period based on the historical resource usage time series data and an integrated forecasting model that combines time series decomposition and machine learning. The credit risk assessment unit is used to construct a dynamic credit risk model based on the historical resource usage time series data and the historical recharge transaction data, and to calculate the credit bankruptcy probability of each user in the specified future period. The multi-objective optimization orchestration unit is used to establish and solve a stochastic programming model with the predicted resource demand, the uncertainty quantification range and the credit bankruptcy probability as key inputs, and output the dynamic resource quota allocated to each user. The resource quota execution unit is used to update the available resource limit of each user in the resource pool in real time according to the dynamic resource quota, and drive the resource scheduler to perform corresponding resource allocation, reservation and reclamation actions. The real-time billing unit is used to monitor the actual resource consumption of each user and perform billing calculations through a billing function linked to the dynamic resource quota. The billing function applies a higher unit price to the portion of consumption exceeding the quota and provides fee reductions for the portion of the quota that is not fully used.
10. The apparatus according to claim 9, characterized in that, The device also includes a risk monitoring and circuit breaker unit, used for: The system continuously monitors the credit bankruptcy probability of each user. When the credit bankruptcy probability of any user exceeds a preset warning threshold, the system automatically triggers a resource usage restriction process, including freezing the user's new resource applications and initiating the reclamation of idle resources.