Cloud resource charging method, cloud resource management platform, computing device and medium
By obtaining the original consumption data of the cloud resource management platform, determining the billing strategy and calculating the billing data of each shared tenant, the billing tracking problem across tenants and cross-businesses is solved, and efficient resource billing management is achieved.
Patent Information
- Application Number
- CN202510426918.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-07
- Publication Date
- 2025-07-04
AI Technical Summary
The difficulty in tracking the billing of cloud resources across tenants and cross-businesses, and the lack of unified standards and management, making it difficult to achieve billing.
By obtaining the original consumption data of resources, including business identification and resource information from the preset storage area, determining the billing strategy, and calculating the billing data of each shared tenant based on this information, supporting the processing of timed polling and resource update events, and providing a billing data display page to view in multi-dimensional filtering.
It realizes resource billing tracking across tenants and cross-businesses, improves billing efficiency and accuracy, simplifies the complexity of the resource management platform, and reduces the difficulty of cost calculation for resource providers.
Smart Images

Figure CN120263572A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology, and particularly to a charging method for cloud resources, a cloud resource management platform, a computing device, and a medium. Background Art
[0002] Cloud computing refers to a system with extremely strong computing power formed through a computer network, which can store and aggregate relevant resources and can be configured on demand to provide personalized services to users. With the wide use of cloud computing technology, business scenarios have become more diverse and complex, and resources on the cloud have shown a more diverse customization and development trend. A variety of service products emerge in an endless stream, and traditional virtual machines, hard disks, networks, load balancers, as well as various new centralized and distributed databases and various widely used middleware services are constantly being moved to the cloud.
[0003] Cloud computing has various deployment methods, such as public cloud, private cloud, hybrid cloud, etc. Due to considerations of security and controllability, some enterprises will choose to build a private cloud by their own IT institutions or cloud providers for internal users of the enterprise or specific external users related to the enterprise. The enterprise centrally manages various resource products through a cloud resource management platform, making resource application and daily operation and maintenance faster and more convenient.
[0004] Each department or branch company in an enterprise usually deploys various services through resources on the private cloud. Due to the large variety of cloud resources managed by the cloud resource management platform, complex resource usage scenarios, and the fact that the resource usage process often involves cross-tenants and cross-services. Currently, there is a lack of unified standards and unified management for different tenants or services, resulting in difficulties in tracking the charging of cross-tenant and cross-service resources. Summary of the Invention
[0005] In view of this, the present application provides a charging method for cloud resources, a cloud resource management platform, a computing device, and a medium, which solves the problem of tracking the charging of cross-tenant and cross-service resources.
[0006] In a first aspect, the present application provides a charging method for cloud resources, including:
[0007] Obtain the original consumption data of resources from a first preset storage area, where the original consumption data includes the identifier of the service and resource information, and the service corresponds to at least one shared tenant;
[0008] Determine the charging policy for the resources;
[0009] Based on the resource information and the charging policy, determine the charging data of each shared tenant for the resources in the service.
[0010] In a possible implementation manner, determining the charging data of each shared tenant for the resource in the service based on the resource information and the charging policy includes:
[0011] Obtaining the charging sharing ratio of each shared tenant in the service preset according to the identifier;
[0012] Obtaining the bill calculation method corresponding to the charging policy;
[0013] Determining the charging data of each shared tenant for the resource in the service according to the charging sharing ratio, the bill calculation method, the charging policy, and the resource information.
[0014] In a possible implementation manner, different charging policies are pre-configured according to different time periods and / or tenants. Determining the charging policy of the resource includes:
[0015] Determining the charging policy for the resource from the pre-configured charging policies according to the usage time period corresponding to the original consumption data and / or the at least one shared tenant.
[0016] In a possible implementation manner, the method further includes:
[0017] When a new resource addition request is detected, outputting a new resource configuration page;
[0018] Obtaining new resource configuration information through the new resource configuration page, where the new resource configuration information includes one or more of the following: the identifier of the new resource, the charging policy of the new resource, the service associated with the new resource, and the bill calculation method matching the charging policy of the new resource.
[0019] In a possible implementation manner, obtaining the original consumption data of the resource from the first preset storage area includes:
[0020] Regularly polling to obtain the original consumption data of the resource from the first preset storage area.
[0021] In a possible implementation manner, the method further includes:
[0022] Detecting a resource update event, where the resource update event includes any one or more of the following: the charging cycle of any resource changes and a new resource is added;
[0023] When the resource update event includes that the charging cycle of any resource changes, updating the time interval for regularly polling the any resource based on the new charging cycle;
[0024] When the resource update event includes the addition of a new resource, determine a new time interval for polling the new resource based on the billing cycle corresponding to the new resource, so as to subsequently poll at the new time interval regularly to obtain the original consumption data of the new resource from the first preset storage area.
[0025] In a possible implementation manner, the method further includes:
[0026] Store the billing data in a second preset storage area;
[0027] When a billing data acquisition request is detected through the cloud resource management platform, obtain the user information of the logged-in user;
[0028] Obtain the target billing data matching the user information from the second preset storage area;
[0029] Output a billing data display page according to the target billing data, where the billing data display page supports the logged-in user to view the target billing data by filtering through different dimensions, and the different dimensions include one or more of the following: tenant dimension, time dimension, resource dimension, and service dimension.
[0030] In a second aspect, the present application provides a cloud resource management platform, including:
[0031] A data acquisition module, configured to obtain the original consumption data of a resource from a first preset storage area, where the original consumption data includes the identifier of a service and resource information, and the service corresponds to at least one shared tenant;
[0032] A processing module, configured to determine the billing policy of the resource, and determine the billing data of each shared tenant for the resource in the service based on the resource information and the billing policy.
[0033] In a third aspect, the present application provides a computing device, including:
[0034] At least one processor; and
[0035] At least one memory, on which instructions are stored, and when the instructions are executed alone or jointly by the at least one processor, the computing device is caused to execute the method as described in the first aspect.
[0036] In a fourth aspect, the present application provides a computer storage medium, on which instructions are stored, and when the instructions are executed alone or jointly by at least one processor of a computing device, the computing device is caused to execute the method as described in the first aspect.
[0037] The billing method provided by this application can obtain the original consumption data of resources from a first preset storage area. The original consumption data includes the identification of a service and resource information, and the service corresponds to at least one shared tenant. Further, a billing policy for the resources can be determined, and based on the resource information and the billing policy, the billing data of each shared tenant for the resources in the service can be determined. By implementing this application, the billing data of each tenant for various cloud resources in different services can be obtained, and cross-tenant and cross-service resource billing tracking can be achieved efficiently and conveniently. Description of the Drawings
[0038] The accompanying drawings are provided to further understand this application. They are incorporated into and constitute a part of this application. The drawings illustrate embodiments of this application and, together with this specification, serve to explain the principles of this application. In the drawings:
[0039] Figure 1 is a schematic diagram of a scenario of a cloud resource management platform provided by an embodiment of this application;
[0040] Figure 2 is a schematic flowchart of a billing method for cloud resources provided by an embodiment of this application;
[0041] Figure 3 is a schematic diagram of a billing policy configuration page provided by an embodiment of this application;
[0042] Figure 4 is a schematic flowchart of another billing method for cloud resources provided by an embodiment of this application;
[0043] Figure 5 is a schematic diagram of the structure of a cloud resource billing management platform provided by an embodiment of this application;
[0044] Figure 6 is a schematic diagram of the structure of a computing device provided by an embodiment of this application. Detailed Embodiments
[0045] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings required for the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some examples or embodiments of this application. For those of ordinary skill in the art, without creative efforts, this application can also be applied to other similar scenarios based on these drawings. Unless obvious from the language context or otherwise stated, the same reference numerals in the figures represent the same structure or operation.
[0046] As shown in this application, unless the context clearly indicates otherwise, words such as "a", "an", "one", and / or "the" are not specifically singular and may also include the plural. Generally speaking, the terms "comprising" and "including" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements.
[0047] At the same time, this application uses specific terms to describe the embodiments of this application. Terms such as "an embodiment", "one embodiment", and / or "some embodiments" mean a certain feature, structure, or characteristic related to at least one embodiment of this application. Therefore, it should be emphasized and noted that the "an embodiment" or "one embodiment" or "an alternative embodiment" mentioned twice or more at different positions in this specification is not necessarily referring to the same embodiment. In addition, certain features, structures, or characteristics in one or more embodiments of this application can be appropriately combined.
[0048] Unless otherwise specifically stated, the relative arrangements of the components and steps, numerical expressions, and numerical values set forth in these embodiments do not limit the scope of this application. At the same time, it should be understood that for the sake of convenience of description, the dimensions of the various parts shown in the drawings are not drawn in actual proportional relationships. Technologies, methods, and devices known to those of ordinary skill in the relevant art may not be discussed in detail, but where appropriate, the said technologies, methods, and devices should be regarded as part of the specification. In all the examples shown and discussed here, any specific value should be interpreted as merely exemplary and not as a limitation. Therefore, other examples of the exemplary embodiments may have different values. It should be noted that like reference numerals and letters denote like items in the following drawings, and thus, once an item is defined in one drawing, it does not need to be further discussed in subsequent drawings.
[0049] In addition, although the terms used in this application are selected from well-known and commonly used terms, some of the terms mentioned in the specification of this application may be selected by the applicant according to his or her judgment, and their detailed meanings are described in the relevant parts of this description. In addition, it is required to understand this application not only through the actual terms used, but also through the meaning implied by each term.
[0050] Flowcharts are used in this application to illustrate the operations performed by the devices or apparatuses according to the embodiments of this application. It should be understood that the operations before or below do not necessarily need to be performed precisely in sequence. On the contrary, they can be performed in reverse order or simultaneously. At the same time, other operations can be added to these processes, or one or several steps can be removed from these processes.
[0051] In recent years, with the rapid development of computer technology, the amount of information data has also increased explosively, which has promoted cloud computing to become a new research hotspot. Some enterprises or units will deploy cloud computing by building a private cloud and manage various resources (such as virtual machines, hard disks, networks, load balancers, various new centralized and distributed databases, etc.) on the private cloud through a cloud resource management platform. Taking a certain enterprise as an example, the enterprise includes 2 subsidiaries, see Figure 1 , in the private cloud scenario, this enterprise is equivalent to the resource provider, and each subsidiary acts as a tenant (such as Figure 1 Tenant A and Tenant B in
[0052] ) access the cloud resource management platform 100 through their own clients to apply for resources, and use the applied resources to deploy various services, such as developing various projects, etc. The resource provider can centrally and uniformly manage various resources through the cloud resource management platform, such as configuring the required resources for each tenant according to the applications of each tenant, metering and charging for various resources, etc. Figure 1 It can be understood that a cloud resource management platform can correspond to multiple tenants, for example, 3, 4, etc. Each tenant can refer to a department, institution or subsidiary, etc. An enterprise can configure and manage tenants according to its actual situation.
[0053] Based on this, see Figure 2 , this application proposes a billing method for cloud resources, which can be applied to the cloud resource management platform under a private cloud (such as Figure 1 The cloud resource management platform 100 shown in
[0054] S200: Obtain the original consumption data of resources from the first preset storage area. The original consumption data includes the identifier of the service and resource information, and the service corresponds to at least one shared tenant. Among them, the types of resources can include virtual machines, hard disks, databases, etc. This application does not make specific limitations on this, and can realize the monitoring and unified analysis of multiple resources.
[0055] Among them, when a certain service belongs to a single tenant, the service corresponds to one shared tenant; when the participants of a certain service include multiple tenants, the service corresponds to multiple shared tenants. The first preset storage area can be the database of the cloud resource management platform, or other areas or devices that can store data, such as a certain block in a blockchain network, etc. This application does not make specific limitations on this.
[0056] As a feasible implementation, before deploying any service, a tenant can apply for resources through the cloud resource management platform. When applying for resources, it is necessary to clarify which service is involved and which tenants participate. When the cloud resource management platform configures the required resources for it, it can establish and store the correspondence between resources and services, the correspondence between tenants and services, and the billing sharing ratio of each tenant in the service. Among them, this billing sharing ratio can be 100% for a single tenant or a certain proportion for multiple tenants, and this ratio can be queried using the identifier of the service (such as the software project name).
[0057] S201: Determine the billing policy for the resources.
[0058] S202: Based on the resource information and the billing policy, determine the billing data of each shared tenant for the resources in this service.
[0059] As a feasible implementation, different billing policies can be set according to the resource type and resource specification. Each billing policy corresponds to a billing calculation method. The resource type can include, for example, virtual machines, hard disks, etc. The billing objects corresponding to virtual machines include CPU and memory, the resource specification is X-core CPU and XGB memory, the billing objects corresponding to hard disks include storage, and the resource specification is hard disk XGB. Exemplarily, the billing policies can be as shown in Table 1:
[0060] Table 1
[0061] Billing Policy Number Policy Content Bill Calculation Method a 1-core CPU, 2GB memory, 20 per day Billing Policy * Usage Duration b 2-core CPU, 4GB memory, 35 per day Billing Policy * Usage Duration c Hard Disk: 1.5 yuan / 1GB / day Billing Policy * Usage Duration
[0062] As a feasible implementation, the resource information in the original consumption data includes the resource type and resource specification. After the cloud resource management platform obtains the original consumption data of the resources, it analyzes the resource type and resource specification in the original message data, and determines the billing policy matching the resource type and resource specification as the billing policy for this resource.
[0063] As a feasible implementation, the specific implementation of step S202 can be: obtain the billing sharing ratio of each shared tenant in the pre-set service according to the identifier of the service, obtain the billing calculation method corresponding to the billing policy, and determine the billing data of each shared tenant for the resources in the service according to the billing sharing ratio, the billing calculation method, the billing policy, and the resource information.
[0064] For example, the pre-set charging policy is shown in Table 1. The resource in step S200 is virtual machine 1, and the obtained original consumption data shows that: for the service - software project 1, the resource type - virtual machine, the resource identifier - virtual machine 1, the resource specification - 1-core CPU and 2GB memory, the usage time period is from July 21, 2024 to July 22, 2024. The shared tenants corresponding to software project 1 are tenant A and tenant B, and the pre-set sharing ratios for tenant A and tenant B in this project are 60% and 40% respectively. In this case, since charging policy a matches the resource type and resource rules of the virtual machine, charging policy a is determined as the charging policy for virtual machine 1. Further, the cloud resource management platform can determine, based on the pre-stored correspondence between the tenant and software project 1, and the sharing ratios of each shared tenant in software project 1, that the shared tenants involved in virtual machine 1 are tenant A and tenant B, with sharing ratios of 60% and 40% respectively, and calculate the charging data of tenant A and tenant B for virtual machine 1 in software project 1 according to the billing calculation method corresponding to charging policy a as follows:
[0065]
[0066]
[0067] As a feasible implementation manner, in order to adapt to the charging problem of dynamically adjusting resource specifications during business deployment, for example, in a certain project, the resource specification of virtual machine 1 is temporarily adjusted from 1-core CPU and 2GB memory to 2-core CPU and 4GB memory. The embodiments of the present application can record in the original consumption data: the resource specification of virtual machine 1 before adjustment (hereinafter referred to as the old resource specification), the usage time period of the old resource specification, the adjusted resource specification (hereinafter referred to as the new resource specification), and the usage time period of the new resource specification. Subsequently, after the cloud resource management platform obtains the original consumption data, different charging policies are determined based on the resource specifications and usage time periods before and after the adjustment, so as to complete the charging of virtual machine 1 under the two old and new resource specifications based on different charging policies.
[0068] As a feasible implementation manner, the resource information further includes the usage time period. The present application pre-configures different charging policies according to different time periods and / or tenants. The implementation manner of the above step S201 can be: determining the charging policy for the resource from the pre-configured charging policies according to the usage time period corresponding to the original consumption data and / or at least one shared tenant. Subsequently, the corresponding charging policy can be dynamically adjusted according to different time periods and / or different tenants, which can more flexibly adapt to the dynamic demand changes of resources compared with the existing method that only supports the unified pricing adjustment of resource prices.
[0069] Exemplarily, the billing policies preset according to different time periods and tenants are shown in Table 2. Assume that the resource in step S200 is virtual machine 1, and the obtained original consumption data shows that the service is software project 1, the resource type is virtual machine, the resource specification is 1-core CPU and 2GB memory, the usage time period is from July 21, 2024 to July 22, 2024, and the shared tenants corresponding to software project 1 are tenant A and tenant B. According to the usage time period and tenants, the billing policies for virtual machine 1 determined from the pre-configured billing policies include: billing policy 1 for tenant A (1-core CPU, 2GB memory, 20 yuan per day) and billing policy 2 for tenant B (1-core CPU, 2GB memory, 24 yuan per day).
[0070] Table 2
[0071]
[0072]
[0073] As a feasible implementation manner, the way for the cloud resource management platform to execute step S200 can be: regularly polling to obtain the original consumption data of resources from the first preset storage area. The original consumption data is actively polled and collected. Compared with the automatic reporting method, since automatic reporting will add redundant code to the resource application or change code, and the reporting is generally only done once. If not received, it's gone. Every time there is a resource application or resource change, the corresponding code may accidentally operate the relevant buried point code for billing, resulting in reporting failure. On the one hand, polling is that the billing actively looks for and regularly takes the data actively without missing any; on the other hand, it can avoid a large number of costly intrusions into the code of the resource provider, resulting in code changes affecting billing.
[0074] As a feasible implementation manner, the cloud resource management platform can also detect resource update events, and the resource update events include any one or more of the following: the billing cycle of any resource changes and a new resource is added. When the resource update event includes the billing cycle of any resource changing, based on the new billing cycle, update the time interval for regularly polling the any resource. Specifically, the time interval for regularly polling the any resource can be adjusted to be less than or equal to the new billing cycle. For example, if any resource is virtual machine 1 and the original billing cycle of virtual machine 1 is monthly, and it is detected that the current billing cycle has changed to daily, then the time interval for regularly polling virtual machine 1 can also be adjusted to daily, and the original consumption data of virtual machine 1 is regularly obtained every day.
[0075] Or, when the resource update event includes a new resource being added, determine a new time interval for polling the new resource based on the billing cycle corresponding to the new resource, so as to subsequently regularly poll to obtain the original consumption data of the new resource from the first preset storage area according to the new time interval.
[0076] As a feasible implementation manner, a cloud resource billing method proposed in this application may further include: when a new resource addition request is detected, output a new resource configuration page, and obtain new resource configuration information through the new resource configuration page. The new resource configuration information includes one or more of the following: the identifier of the new resource, the new resource billing policy, the service associated with the new resource, and the bill calculation method matching the new resource billing policy.
[0077] To help readers better understand the embodiments of this application, the above method will be further described below with specific examples. Suppose the service is a software project, and each subsidiary of the enterprise uses the resources on the cloud as a tenant for software project development. The original consumption data obtained by the cloud resource management platform from the first preset storage area at regular intervals of time T (T>0) is shown in Table 3, and the pre-configured billing policy is shown in Table 2. The bill calculation method is: billing policy * usage duration. Project 1 is jointly participated by Tenant A and Tenant B, and the billing sharing ratio is: Tenant A 60%, Tenant B 40%. Project 2 is solely invested by Tenant A at 100%.
[0078] Table 3
[0079]
[0080] In this case, it is queried according to the software project name that Project 1 is jointly participated by Tenant A and Tenant B, and the billing sharing ratio is: Tenant A 60%, Tenant B 40%. Project 2 is solely invested by Tenant A at 100%. Further combined with the usage time period of each virtual machine, the billing policy matching each resource is determined, and the specific matching situation is shown in Table 4:
[0081] Table 4
[0082]
[0083] Then, according to the statistical period, the billing data of each tenant for different resources in different projects is determined. Suppose the statistics are carried out according to the natural month, and the billing data for September is counted. Then the billing data for September (20240901 - 20240930) is shown in Table 5:
[0084] Table 5
[0085]
[0086]
[0087] It can be understood that in some feasible embodiments, different tenants are pre-set with different billing policies. For a service corresponding to multiple shared tenants (hereinafter referred to as a shared service), there will be a situation where two different billing policies need to be applied to the same service. For example, in Table 4, for the virtual machine 1 in project 1, it needs to be billed according to billing policy number 1 for tenant A and according to billing policy number 2 for tenant B. This way will increase the complexity of the cloud resource management platform and lead to an increase in the difficulty of cost calculation for the resource provider.
[0088] To avoid this problem, as a feasible implementation method, in this application, when configuring the billing policy, an additional billing policy applicable to all tenants (hereinafter referred to as the general billing policy) can be set for resources of different specifications. After obtaining the original consumption data of a certain resource in step S201, query whether the service corresponding to this resource is a shared service through the service identifier in the original consumption data. If it is a shared service, then preferentially determine the general billing policy that matches the resource information (resource identifier, resource specification, service identifier, usage time period, etc.) in the original message data as the final billing policy for this resource. If it is not a shared service, then preferentially determine the exclusive billing policy that matches the resource information as the final billing policy for this resource. The exclusive billing policy is a billing policy exclusive to a certain tenant, such as billing policy number 1 in Table 2.
[0089] Exemplarily, taking the virtual machine 2 as an example, assume that the pre-configured billing policy is as shown in Table 2, and the original consumption data of the virtual machine 2 obtained by executing step S201 is as shown in Table 6:
[0090] Table 6
[0091]
[0092] By querying the name of the software project to which it belongs (i.e., the identifier of the service) in the original consumption data, it is found that project 2 belongs to a shared project (i.e., a shared service), and the corresponding shared tenants include tenant A and tenant B. In this case, preferentially determine billing policy number 10 in Table 2 as the billing policy for the virtual machine 1.
[0093] Or, in another feasible implementation method, assume that the pre-configured billing policy is as shown in Table 2, still taking the original consumption data in Table 6 as an example. Assume that it is found through the name of the software project to which it belongs (i.e., the identifier of the service) in the original consumption data that project 2 does not belong to a shared project, and the corresponding shared tenant only includes tenant A. In this case, preferentially determine billing policy number 1 in Table 2 as the billing policy for the virtual machine 1.
[0094] As a feasible implementation, when executing the billing policy for determining resources, if the billing policy for the resource cannot be queried in the pre-set billing policy, for example, the operation and maintenance personnel missed setting the billing policy for the resource. In response to this situation, the resource management platform can output a message indicating that the billing policy is missing. The message indicating that the billing policy is missing carries the original consumption data of the resource, so that the operation and maintenance personnel can quickly configure a billing policy that matches the resource based on the original consumption data, enabling the current billing process to proceed normally.
[0095] Among them, the message indicating that the billing policy is missing can be sent through various social communication software, such as text messages, WeChat, emails, or by popping up a reminder message on the resource management platform, etc. The message indicating that the billing policy is missing can also include a quick link for configuring the billing policy. When the operation and maintenance personnel click on the quick link, they can quickly enter the billing policy configuration page, and the original consumption data can be displayed on the billing policy configuration page. Exemplarily, the billing policy configuration page can be as Figure 3 shown.
[0096] Alternatively, in order to be compatible with shared services (for example, to be compatible with the situation mentioned above where in order to simplify the computational complexity of the resource management platform, shared services prefer to use the general billing policy for billing), to enable the operation and maintenance personnel to quickly understand the situation of the business to which the resource belongs, it is also possible to query whether the business is a shared business based on the identifier of the business in the original consumption data. If so, an additional piece of information indicating that the business corresponding to the resource is a shared business is carried in the message indicating that the billing policy is missing. Or, if this piece of information is not carried additionally in the message indicating that the billing policy is missing, as another feasible implementation, the operation and maintenance personnel can also query whether the business corresponding to the resource is a shared business based on the identifier of the business in the original consumption data by themselves.
[0097] By implementing the embodiments of the present application, the cloud resource management platform can obtain the original consumption data of the resource from the first preset storage area. The original consumption data includes the identifier of the business and resource information, and the business corresponds to at least one shared tenant. Further, the billing policy of the resource can be determined, and based on the resource information and the billing policy, the billing data of each shared tenant for the resource in the business can be determined. In this way, the billing data of each tenant for various cloud resources in different businesses can be obtained, and cross-tenant and cross-business resource billing tracking can be efficiently and conveniently realized.
[0098] See Figure 4 , the embodiments of the present application propose another billing method for cloud resources. Based on the execution of steps S200 to S201, the method further includes the following steps:
[0099] S400: Store the charging data in a second preset storage area. The second preset storage area may be the database of the cloud resource management platform, or other areas or devices capable of storing data, such as a certain block in a blockchain network, etc. The second preset storage area may be the same as or different from the above-mentioned first preset storage area. This application does not make specific limitations on this.
[0100] S401: When a charging data acquisition request is detected through the cloud resource management platform, acquire the user information of the logged-in user. Among them, the user may be a tenant or a resource provider, and the user information may be the account number of the user logging in to the resource management platform, etc.
[0101] S402: Acquire the target charging data matching the user information from the second preset storage area.
[0102] S403: Output a charging data display page according to the target charging data. The charging data display page supports the logged-in user to filter and view the target charging data through different dimensions. Among them, different dimensions include one or more of the following: tenant dimension, resource dimension, time dimension, and business dimension.
[0103] As a feasible implementation method, the user can log in to the resource management platform through an account and password, initiate a charging data acquisition request through the resource management platform. The resource management platform can respond to the charging data acquisition request, acquire the target charging data of the user from the second preset storage area according to the account number of the user's login, and display the target charging data through the charging data display page. Different users can see the target charging data related to themselves through the charging data display page, which is convenient for users to check and audit item by item. By analyzing the data, users can master the specific usage of various resources and guide business development.
[0104] Exemplarily, assume that the charging data stored in the second preset storage area is shown in Table 5, and the user is tenant A. Then the target charging data matching the user information may be shown in Table 7:
[0105] Table 7
[0106]
[0107] The cloud resource management platform can directly display Table 7 on the charging data display page, or convert the data in Table 7 into other display forms, such as bar charts, pie charts, bills, etc. Tenant A can filter and view from the tenant dimension that the total resource cost in September for itself is: 876 yuan; filter and view from the business dimension that the consumption of Project 1 in September for itself is 372 yuan, and the consumption of Project 2 is 504 yuan; filter and view from the resource dimension that the consumption of resources such as virtual machines in September for itself is 876 yuan.
[0108] Alternatively, if the user is a resource provider, then the target billing data matching the user information described above can be all the billing data stored in the second preset storage area. The resource provider can view the billing situations of all tenants for different resources under different services, which is convenient for the resource provider to conduct unified summary analysis of all resources and achieve unified management. Still taking the billing data stored in the second preset storage area as shown in Table 5 as an example, the target billing data matching the resource provider can be:
[0109]
[0110] The resource provider can filter and view from the tenant dimension through the billing data display page: the total consumption of Tenant A in September is 876 yuan, and the total consumption of Tenant B in September is 628.8 yuan; filter and view from the service dimension, the consumption of Project 1 in September is 664.8 yuan, and the consumption of Project 2 is 840 yuan; filter and view from the resource dimension, the consumption of resources such as virtual machines in September is 1504.8 yuan.
[0111] By implementing the embodiments of the present application, after the cloud resource management platform calculates the billing data of each tenant for various cloud resources in different services, it stores these data in the second preset storage area. Subsequently, when a billing data acquisition request is detected through the cloud resource management platform, it acquires the user information of the logged-in user, obtains the target billing data matching the user information from the second preset storage area, and outputs a billing data display page according to the target billing data. This billing data display page supports the logged-in user to filter and view the target billing data through different dimensions. In this way, on the one hand, different tenants can only see their own relevant billing information, which is convenient for tenants to check and audit item by item; on the other hand, for the resource provider, it can also analyze the data to master the specific resource usage situation and guide the overall business development.
[0112] Figure 5 It is a schematic structural diagram of a billing management platform for cloud resources provided by the embodiments of the present application. As Figure 5 shown, the cloud resource management platform includes:
[0113] A data acquisition module 500, configured to acquire the original consumption data of resources from a first preset storage area, where the original consumption data includes the identifier of the service and resource information, and the service corresponds to at least one shared tenant;
[0114] A processing module 501, configured to determine the billing policy of the resources, and determine the billing data of each shared tenant for the resources in the service based on the resource information and the billing policy.
[0115] In a possible implementation, the processing module 501 is specifically configured to obtain the charging sharing ratios of each shared tenant in the service set in advance according to the identifier; obtain the bill calculation method corresponding to the charging policy; and determine the charging data of each shared tenant for the resource in the service according to the charging sharing ratio, the bill calculation method, the charging policy, and the resource information.
[0116] In a possible implementation, the processing module 501 is specifically configured to determine the charging policy for the resource from the pre-configured charging policies according to the usage time period corresponding to the original consumption data and / or the at least one shared tenant.
[0117] In a possible implementation, the processing module 501 is further configured to, when detecting a new resource addition request, output a new resource configuration page; and obtain new resource configuration information through the new resource configuration page, where the new resource configuration information includes one or more of the following: the identifier of the new resource, the new resource charging policy, the service associated with the new resource, and the bill calculation method matching the new resource charging policy.
[0118] In a possible implementation, the data acquisition module 500 is specifically configured to periodically poll and obtain the original consumption data of the resource from the first preset storage area.
[0119] In a possible implementation, the processing module 501 is further configured to detect a resource update event, where the resource update event includes any one or more of the following: a change in the charging cycle of any resource and the addition of a new resource; when the resource update event includes a change in the charging cycle of any resource, update the time interval for periodically polling the any resource based on the new charging cycle; when the resource update event includes the addition of a new resource, determine a new time interval for polling the new resource based on the charging cycle corresponding to the new resource, so as to subsequently periodically poll and obtain the original consumption data of the new resource from the first preset storage area according to the new time interval.
[0120] In a possible implementation, the processing module 501 is further configured to store the charging data in the second preset storage area through the storage module 502; when detecting a charging data acquisition request through the cloud resource management platform, obtain the user information of the logged-in user; obtain the target charging data matching the user information from the second preset storage area; and output a charging data display page according to the target charging data, where the charging data display page supports the logged-in user to filter and view the target charging data through different dimensions, and the different dimensions include one or more of the following: tenant dimension, time dimension, resource dimension, and service dimension.
[0121] The cloud resource management platform provided in this embodiment is used to implement the foregoing resource charging method. Therefore, the specific implementation of the cloud resource management platform can be seen in the embodiment part of the charging method in the previous text, and will not be elaborated here.
[0122] Figure 6 It is a schematic structural diagram of a computing device provided by an embodiment of the present application. As Figure 6 shown, the computing device includes one or more processors 601, one or more memories 602 coupled to the processor 601, and one or more communication modules 600 coupled to the processor 601.
[0123] The communication module 600 is used for two-way communication. The communication module 600 has at least one antenna for facilitating communication. The communication interface can represent any interface necessary for communicating with other network elements.
[0124] The processor 601 can be of any type suitable for the local technical network, and as a non-limiting example, can include one or more of the following: general-purpose computer, dedicated computer, microprocessor, digital signal processor (DSP), and a processor based on a multi-core processor architecture. The computing device 900 can have multiple processors, such as an application-specific integrated circuit chip, which is clocked in time to synchronize with the main processor.
[0125] The memory 602 can include one or more non-volatile memories and one or more volatile memories. Examples of non-volatile memories include, but are not limited to, read-only memory (ROM) 6021, electrically programmable read-only memory (EPROM), flash memory, hard disk, optical disc (CD), digital video disc (DVD), and other magnetic and / or optical memories. Examples of volatile memories include, but are not limited to, random access memory (RAM) 6020 and other volatile memories that do not persist during a power outage.
[0126] The computer program 603 includes computer-executable instructions executed by the relevant processor 601. The computer program 603 can be stored in the ROM 6021. The processor 601 can perform any appropriate actions and processes by loading the computer program 603 into the RAM 6020.
[0127] The embodiments of the present application can be implemented by the computer program 603, such that the computing device can execute any of the disclosed processes discussed with reference to Figure 2 and Figure 4 The embodiments of the present application can also be implemented by hardware or by a combination of software and hardware.
[0128] In some embodiments, the computer program 603 may be tangibly embodied in a computer-readable medium, which may be included in a computing device (e.g., the memory 602) or other storage devices accessible to the computing device. The computing device may load the computer program 603 from the computer-readable medium into the RAM 6020 for execution. The computer-readable medium may include any type of tangible non-volatile memory, such as ROM, EPROM, flash memory, hard disk, CD, DVD, etc. The program 603 is stored on the computer-readable medium.
[0129] Generally, the various embodiments of the present application may be implemented in hardware or dedicated circuits, software, logic, or any combination thereof. Certain aspects may be implemented in hardware, while other aspects may be implemented in firmware or software, which may be executed by a controller, a microprocessor, or other computing devices. Although the various aspects of the embodiments of the present application are shown and described as block diagrams, flowcharts, or using some other graphical representation, it should be understood that, by way of non-limiting example, the blocks, devices, management platforms, technologies, or methods described herein may be implemented in hardware, software, firmware, dedicated circuits or logic, general hardware or a controller or other computing devices, or some combination thereof.
[0130] The present application also provides at least one computer program product tangibly stored on a non-transitory computer-readable storage medium. The computer program product includes computer-executable instructions, such as instructions included in program modules, which are executed in a device on a target real or virtual processor to perform the methods described above with reference to Figure 2 and Figure 4 the methods described. Generally, program modules include routines, programs, libraries, objects, classes, components, data structures, etc. that perform specific tasks or implement specific abstract data types. In various embodiments, the functions of the program modules may be combined or separated as needed among the program modules. The machine-executable instructions for the program modules may be executed within a local or distributed device. In a distributed device, the program modules may be located in local and remote storage media.
[0131] The program code for performing the methods of the present application may be written in any combination of one or more programming languages. The program code may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the program code is executed by the processor or controller, the functions / operations specified in the flowchart and / or block diagram are implemented. The program code may be executed entirely on the machine as an independent software package, partially on the machine, partially on a remote machine, partially on a remote machine, or entirely on a remote machine or server.
[0132] In the context of the present application, the computer program code or related data can be carried by any suitable carrier to enable a device, apparatus, or processor to perform the various processes and operations described above. Examples of carriers include signals, computer-readable media, etc.
[0133] The computer-readable media can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable media may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor management platforms, devices, or apparatuses, or any suitable combination of the foregoing. More specific examples of the computer-readable storage media include electrical connections with one or more wires, portable computer floppy disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above.
[0134] Furthermore, although the operations are described in a particular order, this should not be construed as requiring that the operations be performed in the particular order shown or in sequential order, or that all of the illustrated operations be performed to obtain the desired result. In some cases, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these details should not be construed as limitations on the scope of the present application, but rather as descriptions of features specific to particular embodiments. Certain features described in the context of separate embodiments may also be implemented in combination in a single embodiment. Conversely, the various features described in the context of a single embodiment may also be implemented separately or in any suitable sub-combination in multiple embodiments.
[0135] Although the present application has been described in language specific to structural features and / or methodological acts, it should be understood that the application defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.
Claims
1. A billing method for cloud resources, characterized in that, The method includes: Obtaining the original consumption data of resources from a first preset storage area, where the original consumption data includes the identifier of a service and resource information, and the service corresponds to at least one shared tenant; Determining the charging policy for the resources; Based on the resource information and the charging policy, determining the charging data of each shared tenant for the resources in the service.
2. The method according to claim 1, wherein The determining the charging data of each shared tenant for the resources in the service based on the resource information and the charging policy includes: Obtaining the charging sharing ratio of each shared tenant in the service preset according to the identifier; Obtaining the bill calculation method corresponding to the charging policy; Based on the charging sharing ratio, the bill calculation method, the charging policy, and the resource information, determining the charging data of each shared tenant for the resources in the service.
3. The method according to claim 1 or 2, characterized in that, According to different time periods and / or tenants, different charging policies are preconfigured. The determining the charging policy for the resources includes: Determining the charging policy for the resources from the preconfigured charging policies according to the usage time period corresponding to the original consumption data and / or the at least one shared tenant.
4. The method according to claim 1, wherein The method further includes: When a new resource addition request is detected, outputting a new resource configuration page; Obtaining new resource configuration information through the new resource configuration page, where the new resource configuration information includes one or more of the following: the identifier of the new resource, the charging policy of the new resource, the service associated with the new resource, and the bill calculation method matching the charging policy of the new resource.
5. The method according to claim 1, characterized in that Wherein, The obtaining the original consumption data of resources from a first preset storage area includes: Periodically polling to obtain the original consumption data of resources from a first preset storage area.
6. The method according to claim 5, characterized in that The method further includes: Detecting a resource update event, where the resource update event includes any one or more of the following: the charging cycle of any resource changes and a new resource is added; When the resource update event includes that the charging cycle of any resource changes, updating the time interval for periodically polling the any resource based on the new charging cycle; When the resource update event includes that a new resource is added, determining a new time interval for polling the new resource based on the charging cycle corresponding to the new resource, so as to subsequently periodically poll from the first preset storage area to obtain the original consumption data of the new resource according to the new time interval.
7. The method according to claim 1, wherein The method further includes: Storing the charging data in a second preset storage area; When a charging data acquisition request is detected through a cloud resource management platform, obtaining the user information of the logged-in user; Obtaining target charging data matching the user information from the second preset storage area; Outputting a charging data display page according to the target charging data, where the charging data display page supports the logged-in user to filter and view the target charging data through different dimensions, and the different dimensions include any one or more of the following: tenant dimension, time dimension, resource dimension, and service dimension.
8. A cloud resource management platform, characterized in that, Including: A data acquisition module, configured to obtain the original consumption data of resources from a first preset storage area, where the original consumption data includes the identifier of a service and resource information, and the service corresponds to at least one shared tenant; A processing module, configured to determine a charging policy for the resource, and determine charging data for each shared tenant for the resource in the service based on the resource information and the charging policy.
9. A computing device, characterized in that, Comprising: At least one processor; And At least one memory storing instructions which, when executed alone or jointly by the at least one processor, cause the computing device to execute the method according to any one of claims 1-7.
10. A computer storage medium, characterized in that, Instructions are stored on the computer storage medium which, when executed alone or jointly by at least one processor of a computing device, cause the computing device to execute the method according to any one of claims 1-7.