Resource charging method and system, electronic equipment and medium
By responding to resource billing instructions in the data center, obtaining and processing target resource data, and calculating target resource expenses, the problem of resource billing management of multi-vendors has been solved, and the intensive management and automation level of resource billing has been improved.
Patent Information
- Application Number
- CN202411755503.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-03-11
AI Technical Summary
The multi-manufacturer procurement strategy leads to a huge scale of data center resources, and different types of resources have different billing methods, which leads to the operator being unable to effectively manage resource billing and the use of resources is unable to quickly and accurately bill.
By responding to the resource billing instruction, the target resource data of the target resource is obtained, the target resource usage data and operation data are processed based on the preset price factor, the target resource usage is calculated, and the target resource expense is inputted into the resource billing model to calculate the target resource expense.
It realizes intensive management of resource billing, improves the automation level of resource management, optimizes data collection and processing processes, realizes accurate measurement and billing of the use of basic resources by different manufacturers, and reduces the overall cost of basic resources.
Smart Images

Figure CN119603645A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of resource billing, and in particular to a resource billing method, system, electronic equipment and medium. Background Art
[0002] In data centers, resource billing is mainly for computing resources, network resources, and storage resources. In order to achieve effective resource integration, data centers usually adopt a multi-vendor procurement strategy. The purpose of this practice is to avoid the risks that may arise from dependence on a single vendor, ensure flexible switching when encountering problems, and ensure the continuous and stable operation of the data center.
[0003] However, the multi-vendor procurement strategy has led to a large scale of data center resources. Different types of resources may have different billing methods, which makes it impossible for data center operators to effectively manage various types of resources from different vendors, and thus unable to quickly and accurately bill for resource usage. Summary of the invention
[0004] The present invention provides a resource billing method, system, electronic device and medium, which are used to solve the defect in the prior art that different types of resources correspond to different billing methods, resulting in the inability of data center operators to effectively manage resource billing, and realize efficient resource management to complete unified resource metering and billing.
[0005] The present invention provides a resource charging method, comprising: In response to a resource charging instruction, obtaining target resource data corresponding to the target resource to be charged, wherein the resource charging instruction includes a preset price factor and identification information corresponding to the target resource to be charged, and the target resource data includes a target resource type, target resource usage data, and target resource operation data; Based on the preset price factor, the acquired target resource usage data and target resource operation data are processed to obtain a target resource usage amount corresponding to the preset price factor; The target resource type and target resource usage are input into a resource billing model, and the target resource fee is calculated by the resource billing model.
[0006] In a possible implementation, the method further includes: configuring a target resource acquisition task in response to a resource charging instruction; Configure a data collection interface based on the target resource collection task, and query resource list data corresponding to the target resource through the data collection interface; The target resource data is obtained from the resource list data.
[0007] In a possible implementation, the method further includes: Determining a billing cycle based on the preset price factor; The acquired target resource usage data and target resource operation data are processed according to the billing cycle to obtain the target resource usage corresponding to the billing cycle.
[0008] In a possible implementation, the method further includes: Acquire a virtual machine state attribute of the virtual machine where the target resource is located, wherein the virtual machine state attribute includes a trial period state and a normal use state; A target charging policy for the target resource is determined based on a virtual machine state attribute of the virtual machine where the target resource is located.
[0009] In a possible implementation, the method further includes: If the virtual machine state attribute of the virtual machine where the target resource is located is in a trial period state, determining that the target billing policy is preferential billing; If the virtual machine state attribute of the virtual machine where the target resource is located is in a normal use state, then the target charging policy is determined to be charging based on the preset price factor.
[0010] In a possible implementation, the method further includes: Query the corresponding pre-design fee unit price based on the target resource type; If the target charging strategy is preferential charging, determining the target charging unit price based on the preferential charging coefficient and the pre-designed charging unit price; If the target charging strategy is to charge based on the preset price factor, then determining the target charging unit price based on the preset price factor and the pre-designed charging unit price; The target resource fee is calculated based on the target billing unit price and the target resource usage.
[0011] The present invention also provides a resource billing system, comprising the following modules: a response acquisition module, configured to acquire target resource data corresponding to the target resource to be charged in response to a resource charging instruction, wherein the resource charging instruction includes a preset price factor and identification information corresponding to the target resource to be charged, and the target resource data includes a target resource type, target resource usage data, and target resource operation data; A data processing module, configured to process the acquired target resource usage data and target resource operation data based on the preset price factor to obtain a target resource usage amount corresponding to the preset price factor; The resource billing module is used to input the target resource type and target resource usage into a resource billing model, and calculate the target resource fee through the resource billing model.
[0012] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the resource charging methods described above when executing the computer program.
[0013] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the resource billing method described in any one of the above is implemented.
[0014] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the resource charging method as described above is implemented.
[0015] The resource billing method, system, electronic device and medium provided by the present invention obtain target resource data corresponding to the target resource to be billed by responding to a resource billing instruction, wherein the resource billing instruction contains a preset price factor and identification information corresponding to the target resource to be billed, and the target resource data includes a target resource type, target resource usage data and target resource operation data; based on the preset price factor, the obtained target resource usage data and target resource operation data are processed to obtain the target resource usage corresponding to the preset price factor; the target resource type and target resource usage are input into a resource billing model, and the target resource fee is calculated by the resource billing model. Compared with the existing technology in which different types of resources correspond to different billing methods, which leads to the problem that data center operators cannot effectively manage resource billing, this solution realizes intensive resource billing management through a resource billing model, improves the automation level of resource management, and optimizes data collection and processing processes; accurately measures and bills the use of basic resources from different manufacturers to achieve efficient resource management and differentiated billing processing; accurately measures and bills the use of basic resources to reduce the overall cost of basic resource use, and can also facilitate viewing of the use of related resources of each organization / project. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 This is one of the flow charts of the resource billing method provided by the present invention.
[0018] Figure 2 This is the second flow chart of the resource billing method provided by the present invention.
[0019] Figure 3 It is a structural diagram of the resource billing system provided by the present invention.
[0020] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0022] To facilitate understanding of the embodiments of the present invention, specific embodiments will be further explained below in conjunction with the accompanying drawings. The embodiments do not constitute a limitation on the embodiments of the present invention.
[0023] Figure 1 This is one of the flow charts of the resource billing method provided by the present invention, such as Figure 1 As shown, the method includes the following: S11. In response to a resource charging instruction, obtain target resource data corresponding to a target resource to be charged.
[0024] In a data center, resource billing is mainly for the following three types of basic resources: Computing resources: including servers, virtual machines, containers, etc., are the core resources of the data center. Billing is usually based on indicators such as CPU usage time and memory usage.
[0025] Network resources: including bandwidth, network traffic, IP addresses, etc. Billing is usually based on indicators such as network bandwidth usage and data transmission volume.
[0026] Storage resources: including hard disk space, solid-state disk (SSD), object storage, etc. Billing is usually based on storage space usage and the number of data read and write operations.
[0027] The embodiment of the present invention provides a flexible and accurate resource billing method, the core of which is to dynamically calculate the cost of the target resource based on the preset price factor in the resource billing instruction and the identification information of the target resource. First, real-time data collection can be performed on various resources in the data center, including data such as operating status, performance indicators and usage (such as CPU, memory, storage).
[0028] Further, the resource billing instruction input by the user through the user terminal is obtained, and in response to the resource billing instruction, the target resource data corresponding to the target resource to be billed is obtained. Among them, the resource billing instruction contains the preset price factor and the identification information corresponding to the target resource to be billed; the target resource data includes the target resource type, the target resource usage data and the target resource operation data. The preset price factor is not limited to the set single price, but can also be a rate based on time changes (such as different rates during peak and trough periods), a tiered pricing based on usage, or a differentiated pricing based on resource type. In addition to the basic resource ID, the identification information corresponding to the target resource can also include the region where the resource is located (such as the location of the data center), the user or tenant to whom it belongs, the project or business line to which the resource belongs, etc., to support a more fine-grained billing strategy. Resource usage data may include the usage time of the resource, the number of requests, the amount of data transmission, etc.; the operation data can cover the CPU usage rate, the memory occupancy rate, the number of I / O operations, etc., which provide a basis for accurate billing.
[0029] S12. Based on the preset price factor, the acquired target resource usage data and target resource operation data are processed to obtain a target resource usage amount corresponding to the preset price factor.
[0030] In an embodiment of the present invention, the preset price factor may also include the resource usage time period that the user wants to calculate, and the billing cycle is determined based on the resource usage time period; the acquired target resource usage data and target resource operation data are processed according to the billing cycle, and this processing process may include steps such as data cleaning, conversion, and aggregation to ensure the accuracy and consistency of the data. At the same time, the system will also perform corresponding weighting, discounts, or adjustments on the data according to the requirements of the price factor to calculate the target resource usage that matches the price factor. This target resource usage will serve as the basis for calculating resource costs to ensure the accuracy and rationality of the costs.
[0031] Examples of data processing methods include: Data cleaning and deduplication: Check whether there is duplicate data in the target resource usage data and target resource operation data, and delete the duplicates to avoid billing errors.
[0032] Handling missing values: For missing data, you can choose to fill in default values, use the mean, median, mode, or use interpolation methods to complete.
[0033] Correct bad data: Identify and correct errors or outliers in a dataset, for example, converting an incorrect date format to the correct format.
[0034] Data conversion, unit conversion: Convert data into a uniform unit, for example, converting time from hours to minutes, for comparison and aggregation.
[0035] Data type conversion: Convert data into a format suitable for analysis, such as converting a string type date to a date type.
[0036] Encoding conversion: Convert text data to numeric data to facilitate mathematical operations, such as converting a resource name to a unique numeric ID.
[0037] Data validation, consistency check: Ensure that the data is logically consistent, for example, resource usage should not exceed the total capacity of the resource.
[0038] Reasonableness check: Check whether the data is within a reasonable range, for example, resource usage should not have negative values.
[0039] This resource billing system can also support real-time billing (such as billing by the second) and periodic batch billing (such as daily, weekly, and monthly settlement), which requires the data processing module to efficiently process large amounts of data while ensuring accuracy. Optionally, when processing target resource data, the system can also identify and process outliers (such as a sudden increase in resource usage), which may be caused by incorrect operations or attacks, to avoid unfair billing.
[0040] S13: Input the target resource type and target resource usage into a resource billing model, and calculate the target resource fee through the resource billing model.
[0041] Resource billing models can calculate, predict, and optimize resource costs based on machine learning algorithms, such as regression models, time series analysis models, etc. This helps to more accurately reflect resource costs while providing users with a more predictable billing environment. The model can also dynamically adjust billing parameters based on market changes, cost changes, or user feedback.
[0042] The target resource type and target resource usage obtained above are input into the resource billing model, and the virtual machine state attributes of the virtual machine where the target resource is located are obtained at the same time. The virtual machine state attributes include the trial period state and the normal use state; the target billing strategy is determined based on the virtual machine state attributes of the virtual machine where the target resource is located. For example, in the trial period state, the target billing strategy is preferential billing; in the normal use state, billing is based on the preset price factor.
[0043] Furthermore, the corresponding pre-designed fee unit price is queried based on the target resource type. If the target billing strategy is preferential billing, the preferential billing coefficient and the pre-designed fee unit price are multiplied to determine the target billing unit price; if the target billing strategy is to charge based on a preset price factor, the product of the preset price factor (for example, the peak period coefficient becomes 1.2) and the pre-designed fee unit price is used as the target billing unit price.
[0044] Furthermore, the target billing unit price and the target resource usage are multiplied to calculate the target resource fee.
[0045] Optionally, users can also view resource usage. This billing system supports displaying the usage of resources related to each organization and project, such as CPU, memory, storage, etc. This billing system also provides a data export function, allowing users to export statistical information into a viewable format for further analysis and use. For example, the management platform can generate relevant operation reports, such as virtual machine asset statistics reports, virtual machine resource metering reports, organization resource metering reports, etc., and can set filtering conditions based on tags, departments, projects, status and time, and support report export.
[0046] The resource billing method provided by the present invention obtains the target resource data corresponding to the target resource to be billed by responding to the resource billing instruction, wherein the resource billing instruction contains a preset price factor and identification information corresponding to the target resource to be billed, and the target resource data includes a target resource type, target resource usage data and target resource operation data; based on the preset price factor, the obtained target resource usage data and target resource operation data are processed to obtain the target resource usage corresponding to the preset price factor; the target resource type and target resource usage are input into the resource billing model, and the target resource fee is calculated by the resource billing model. Compared with the problem in the prior art that different types of resources correspond to different billing methods, resulting in the inability of the data center operator to effectively manage resource billing, this method realizes accurate measurement and billing for the use of basic resources of different manufacturers through the resource billing model, and realizes efficient resource management and differentiated billing processing.
[0047] Figure 2This is the second flow chart of the resource billing method provided by the present invention, such as Figure 2 As shown, the method includes the following: S21. Configure a target resource acquisition task in response to a resource charging instruction.
[0048] In a data center, resource billing is mainly for the following three types of basic resources: Computing resources: including servers, virtual machines, containers, etc., are the core resources of the data center. Billing is usually based on indicators such as CPU usage time and memory usage.
[0049] Network resources: including bandwidth, network traffic, IP addresses, etc. Billing is usually based on indicators such as network bandwidth usage and data transmission volume.
[0050] Storage resources: including hard disk space, solid-state disk (SSD), object storage, etc. Billing is usually based on storage space usage and the number of data read and write operations.
[0051] The embodiment of the present invention provides a flexible and accurate resource billing method, the core of which is to dynamically calculate the cost of the target resource based on the preset price factor in the resource billing instruction and the identification information of the target resource. First, real-time data collection can be performed on various resources in the data center, including data such as operating status, performance indicators and usage (such as CPU, memory, storage).
[0052] Further, the resource billing instruction input by the user through the user terminal is obtained, and in response to the resource billing instruction, the target resource data corresponding to the target resource to be billed is obtained. Among them, the resource billing instruction contains the preset price factor and the identification information corresponding to the target resource to be billed; the target resource data includes the target resource type, the target resource usage data and the target resource operation data. The preset price factor is not limited to the set single price, but can also be a rate based on time changes (such as different rates during peak and trough periods), a tiered pricing based on usage, or a differentiated pricing based on resource type. In addition to the basic resource ID, the identification information corresponding to the target resource can also include the region where the resource is located (such as the location of the data center), the user or tenant to whom it belongs, the project or business line to which the resource belongs, etc., to support a more fine-grained billing strategy. Resource usage data may include the usage time of the resource, the number of requests, the amount of data transmission, etc.; the operation data can cover the CPU usage rate, the memory occupancy rate, the number of I / O operations, etc., which provide a basis for accurate billing.
[0053] Specifically, a target resource collection task is configured according to the information in the instruction (such as resource type, resource ID, etc.). This task is intended to determine which resources need to be monitored and charged.
[0054] S22: configuring a data collection interface based on the target resource collection task, and querying resource list data corresponding to the target resource through the data collection interface.
[0055] According to the requirements of the target resource collection task, configure the corresponding data collection interface. These interfaces may be API calls, database queries or other types of data acquisition methods. After the configuration is completed, the system will query the resource list data corresponding to the target resource through these interfaces. This data usually includes basic information such as the resource ID, name, type, and location.
[0056] S23. Acquire the target resource data from the resource list data.
[0057] Filter the target resource data related to the target resource acquisition task from the resource list data. This data will be used for subsequent billing calculations.
[0058] S24. Determine a billing cycle based on the preset price factor.
[0059] The billing cycle is determined based on preset price factors. Price factors may include factors such as the type of resource, usage, and time, which affect the determination of the billing cycle. For example, some resources may be billed by the hour, while others may be billed by the day or month. Charging standards can be flexibly set for various types of resources based on minutes / hours, allowing very flexible billing time unit settings. Users or administrators can choose different billing cycles for different resources, such as per minute or per hour, to accommodate different usage scenarios and billing needs. Such flexibility helps to more accurately reflect the cost of resource usage, while also providing users with more choices, which may help optimize costs.
[0060] S25. Process the acquired target resource usage data and target resource operation data according to the billing cycle to obtain a target resource usage amount corresponding to the billing cycle.
[0061] After the billing cycle is determined, the usage and operation data of the target resources are collected and processed according to the billing cycle. The processing may include steps such as data cleaning, conversion, and aggregation to ensure the accuracy and consistency of the data. Finally, the target resource usage corresponding to the billing cycle is obtained.
[0062] S26. Obtain virtual machine status attributes of the virtual machine where the target resource is located, where the virtual machine status attributes include a trial period status and a normal use status.
[0063] In order to calculate resource costs more accurately, the system needs to know the status attributes of the virtual machine where the target resource is located. These attributes can include trial status and normal use status. Trial status usually means that the virtual machine is enjoying a free or preferential use period, while normal use status means that the virtual machine has exceeded the trial period and needs to be charged at the normal rate.
[0064] S27: Determine a target charging policy for the target resource based on a virtual machine state attribute of the virtual machine where the target resource is located.
[0065] Determine the corresponding target billing policy based on the state attributes of the virtual machine. For example, if the virtual machine is in the trial period, a more favorable rate or free policy can be applied; if the virtual machine is in normal use, a normal rate can be applied.
[0066] S28. Query the corresponding pre-design fee unit price based on the target resource type.
[0067] Query the corresponding pre-design fee unit price according to the type of target resource. These unit prices are pre-defined and used to guide the calculation of resource costs. Different types of resources may have different unit prices, which depends on the cost structure of the resource, the market supply and demand relationship, and the pricing strategy of the service provider.
[0068] S29: Determine a target billing unit price based on the pre-designed billing unit price and the target billing strategy.
[0069] After determining the pre-designed unit price and target billing strategy, calculate the final target billing unit price, which will be used for subsequent resource cost calculations.
[0070] S210. Calculate a target resource fee based on the target billing unit price and the target resource usage.
[0071] Finally, the target resource fee is calculated based on the target billing unit price and the target resource usage. This fee is the resource usage fee that the user needs to pay, which reflects the cost incurred by the user during the use of the resource.
[0072] Optionally, users can also view resource usage. This billing system supports displaying the usage of resources related to each organization and project, such as CPU, memory, storage, etc. This billing system also provides a data export function, allowing users to export statistical information into a viewable format for further analysis and use. For example, the management platform can generate relevant operation reports, such as virtual machine asset statistics reports, virtual machine resource metering reports, organization resource metering reports, etc., and can set filtering conditions based on tags, departments, projects, status and time, and support report export.
[0073] The resource billing method provided by the present invention obtains the target resource data corresponding to the target resource to be billed by responding to the resource billing instruction, wherein the resource billing instruction contains a preset price factor and the identification information corresponding to the target resource to be billed, and the target resource data includes the target resource type, target resource usage data and target resource operation data; based on the preset price factor, the obtained target resource usage data and target resource operation data are processed to obtain the target resource usage corresponding to the preset price factor; the target resource type and target resource usage are input into the resource billing model, and the target resource fee is calculated by the resource billing model. According to the method, the use of basic resources of different manufacturers is accurately measured and billed in a code manner, and differentiated billing processing is realized; the usage of related resources at different time points is counted, which can be viewed at any time and supported to be exported in the form of reports; the intensive management of resource billing of the data center is realized, and the accurate measurement and billing of the use of basic resources can reduce the overall use cost of basic resources.
[0074] The resource billing system provided by the present invention is described below. The resource billing system described below and the resource billing method described above can be referenced to each other.
[0075] Figure 3 It is a structural diagram of the resource billing system provided by the present invention, which specifically includes: The response acquisition module 301 is used to respond to the resource billing instruction and acquire the target resource data corresponding to the target resource to be billed, wherein the resource billing instruction includes a preset price factor and identification information corresponding to the target resource to be billed, and the target resource data includes the target resource type, target resource usage data and target resource operation data. For detailed description, please refer to the relevant description corresponding to the above method embodiment, which will not be repeated here.
[0076] The data processing module 302 is used to process the acquired target resource usage data and target resource operation data based on the preset price factor to obtain the target resource usage corresponding to the preset price factor. For detailed description, please refer to the relevant description corresponding to the above method embodiment, which will not be repeated here.
[0077] The resource charging module 303 is used to input the target resource type and target resource usage into the resource charging model, and calculate the target resource fee through the resource charging model. For detailed description, please refer to the relevant description corresponding to the above method embodiment, which will not be repeated here.
[0078] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication interface 820 and the memory 830 complete mutual communication through the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute the resource charging method, which includes: in response to the resource charging instruction, obtaining the target resource data corresponding to the target resource to be charged, wherein the resource charging instruction includes a preset price factor and the identification information corresponding to the target resource to be charged, and the target resource data includes the target resource type, the target resource usage data and the target resource operation data; based on the preset price factor, the obtained target resource usage data and the target resource operation data are processed to obtain the target resource usage corresponding to the preset price factor; the target resource type and the target resource usage are input into the resource charging model, and the target resource fee is calculated by the resource charging model.
[0079] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0080] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the resource billing method provided by the above methods, which method includes: in response to a resource billing instruction, obtaining target resource data corresponding to the target resource to be billed, wherein the resource billing instruction contains a preset price factor and identification information corresponding to the target resource to be billed, and the target resource data includes a target resource type, target resource usage data and target resource operation data; based on the preset price factor, processing the acquired target resource usage data and target resource operation data to obtain the target resource usage corresponding to the preset price factor; inputting the target resource type and target resource usage into a resource billing model, and calculating the target resource fee through the resource billing model.
[0081] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the resource billing method provided by the above-mentioned methods, the method comprising: in response to a resource billing instruction, obtaining target resource data corresponding to the target resource to be billed, wherein the resource billing instruction contains a preset price factor and identification information corresponding to the target resource to be billed, and the target resource data includes a target resource type, target resource usage data and target resource operation data; based on the preset price factor, processing the acquired target resource usage data and target resource operation data to obtain the target resource usage corresponding to the preset price factor; inputting the target resource type and target resource usage into a resource billing model, and calculating the target resource fee through the resource billing model.
[0082] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0083] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0084] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A resource charging method, characterized in that: include: In response to a resource charging instruction, obtaining target resource data corresponding to a target resource to be charged, wherein the resource charging instruction includes a preset price factor and identification information corresponding to the target resource to be charged, and the target resource data includes a target resource type, target resource usage data, and target resource operation data; Based on the preset price factor, the acquired target resource usage data and target resource operation data are processed to obtain a target resource usage amount corresponding to the preset price factor; The target resource type and target resource usage are input into a resource billing model, and the target resource fee is calculated by the resource billing model.
2. The method according to claim 1, characterized in that: The step of obtaining target resource data corresponding to the target resource to be charged in response to the resource charging instruction includes: configuring a target resource acquisition task in response to a resource charging instruction; Configure a data collection interface based on the target resource collection task, and query resource list data corresponding to the target resource through the data collection interface; The target resource data is obtained from the resource list data.
3. The method according to claim 2, characterized in that The step of processing the acquired target resource usage data and target resource operation data based on the preset price factor to obtain the target resource usage amount corresponding to the preset price factor includes: Determining a billing cycle based on the preset price factor; The acquired target resource usage data and target resource operation data are processed according to the billing cycle to obtain the target resource usage corresponding to the billing cycle.
4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Acquire a virtual machine state attribute of the virtual machine where the target resource is located, wherein the virtual machine state attribute includes a trial period state and a normal use state; A target charging policy for the target resource is determined based on a virtual machine state attribute of the virtual machine where the target resource is located.
5. The method according to claim 4, characterized in that The determining the target charging policy of the target resource based on the virtual machine state attribute of the virtual machine where the target resource is located includes: If the virtual machine state attribute of the virtual machine where the target resource is located is in a trial period state, determining that the target billing policy is preferential billing; If the virtual machine state attribute of the virtual machine where the target resource is located is in a normal use state, then the target charging policy is determined to be charging based on the preset price factor.
6. The method according to claim 5, characterized in that The step of inputting the target resource type and the target resource usage into a resource charging model and calculating the target resource fee through the resource charging model includes: Query the corresponding pre-design fee unit price based on the target resource type; If the target charging strategy is preferential charging, determining the target charging unit price based on the preferential charging coefficient and the pre-designed charging unit price; If the target charging strategy is to charge based on the preset price factor, then determining the target charging unit price based on the preset price factor and the pre-designed charging unit price; The target resource fee is calculated based on the target billing unit price and the target resource usage.
7. A resource billing system, characterized in that: include: a response acquisition module, configured to acquire target resource data corresponding to the target resource to be charged in response to a resource charging instruction, wherein the resource charging instruction includes a preset price factor and identification information corresponding to the target resource to be charged, and the target resource data includes a target resource type, target resource usage data, and target resource operation data; A data processing module, configured to process the acquired target resource usage data and target resource operation data based on the preset price factor to obtain a target resource usage amount corresponding to the preset price factor; The resource billing module is used to input the target resource type and target resource usage into a resource billing model, and calculate the target resource fee through the resource billing model.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the resource charging method according to any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the resource charging method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the resource charging method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Resource charging method, device and platform
CN107566133A
Cloud resource metering and charging device and method, equipment and storage medium
CN115134179A
Virtualized resource charging method oriented to application service level target
CN115439113A
Cited By
Resource metering method and device, electronic equipment and storage medium
CN120750683A