[go: up one dir, main page]

CN104468136B - Charging method, analysis center and charging center - Google Patents

Charging method, analysis center and charging center Download PDF

Info

Publication number
CN104468136B
CN104468136B CN201410855958.9A CN201410855958A CN104468136B CN 104468136 B CN104468136 B CN 104468136B CN 201410855958 A CN201410855958 A CN 201410855958A CN 104468136 B CN104468136 B CN 104468136B
Authority
CN
China
Prior art keywords
resource
tenant
usage
type
price
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201410855958.9A
Other languages
Chinese (zh)
Other versions
CN104468136A (en
Inventor
严永福
曾宪军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201410855958.9A priority Critical patent/CN104468136B/en
Publication of CN104468136A publication Critical patent/CN104468136A/en
Application granted granted Critical
Publication of CN104468136B publication Critical patent/CN104468136B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Facsimiles In General (AREA)

Abstract

本发明实施例提供一种计费方法、分析中心和计费中心,包括:分析中心根据租户的标识,查询每个租户对应的分区以及每个分区中的对应该租户的可用区,得到每个租户对应的至少一个可用区,根据租户的标识查询每个租户对应的工程,在每个租户对应的至少一个可用区下查询该租户所使用的资源的资源信息,而后再对每个资源的使用量进行统计,最终得到每个租户的资源使用信息,生成资源使用统计总表,并将该资源使用统计总表发送给计费中心,该计费中心根据资源使用统计总表获取每个租户的资源使用信息,根据资源定价表以及每个租户的资源使用信息确定每个租户的费用。能够实现对多种云服务的资源使用进行混合计费,以及对多分区多云平台进行混合计费。

An embodiment of the present invention provides a billing method, an analysis center, and a billing center, including: the analysis center queries the partition corresponding to each tenant and the availability zone corresponding to the tenant in each partition according to the identifier of the tenant, and obtains each At least one availability zone corresponding to the tenant, query the project corresponding to each tenant according to the identity of the tenant, query the resource information of the resources used by the tenant under at least one availability zone corresponding to each tenant, and then use each resource Finally, the resource usage information of each tenant is obtained, the resource usage statistics summary table is generated, and the resource usage statistics summary table is sent to the billing center, and the billing center obtains the resource usage statistics summary table of each tenant. Resource usage information, the cost of each tenant is determined according to the resource pricing table and the resource usage information of each tenant. It can realize hybrid billing for resource usage of multiple cloud services, and hybrid billing for multi-partition and multi-cloud platforms.

Description

计费方法、分析中心和计费中心Billing method, analysis center and billing center

技术领域technical field

本发明实施例涉及互联网技术领域,尤其涉及一种计费方法、分析中心和计费中心。The embodiment of the present invention relates to the technical field of the Internet, in particular to a charging method, an analysis center and a charging center.

背景技术Background technique

开源基础设施即服务(英文:Infrastructure as a Service,简称:IaaS)云平台OpenStack是一个美国国家航空航天局和著名的云计算公司Rackspace合作开发的自由软件和开放源代码项目,OpenStack并不是一个软件,而是一个开源云平台的管理项目,OpenStack支持几乎所有类型的云环境,项目目标是提供实施简单、可大规模扩展、丰富、标准统一的云计算管理平台,它为公有云、私有云提供了可扩展、灵活的云计算平台。目前OpenStack的发展非常迅速,它的社区已经拥有超过170家企业以及3000位开发者。这些机构与开发者都选择使用OpenStack创建自己的私有云平台。Open source infrastructure as a service (English: Infrastructure as a Service, referred to as: IaaS) cloud platform OpenStack is a free software and open source project jointly developed by NASA and the famous cloud computing company Rackspace. OpenStack is not a software , but an open source cloud platform management project. OpenStack supports almost all types of cloud environments. The goal of the project is to provide a cloud computing management platform that is simple to implement, scalable on a large scale, rich, and unified in standards. It provides public and private clouds with A scalable and flexible cloud computing platform. At present, OpenStack is developing very rapidly, and its community already has more than 170 companies and 3,000 developers. These institutions and developers have chosen to use OpenStack to create their own private cloud platforms.

但是随着云计算逐渐进入学术研究和商业应用相结合的阶段,云计算的商业应用逐渐成为云计算发展新的方向。在这个大的发展趋势的作用下,OpenStack也会逐渐的向商业化方向发展。但是目前OpenStack的关注点一直集中在虚拟化、网络、安全等领域,还没有针对OpenStack的计费机制,而一些现有的计费机制只能对单一的云服务或单一的云平台进行计费,不支持对多种云服务的资源使用进行混合计费,也不支持对多分区(Region)多云平台进行混合计费。However, as cloud computing gradually enters the stage of combining academic research and commercial applications, the commercial application of cloud computing has gradually become a new direction for the development of cloud computing. Under the influence of this major development trend, OpenStack will gradually develop towards commercialization. However, the current focus of OpenStack has been on virtualization, network, security and other fields. There is no billing mechanism for OpenStack, and some existing billing mechanisms can only bill a single cloud service or a single cloud platform. , does not support hybrid billing for the resource usage of multiple cloud services, nor does it support hybrid billing for multi-region (Region) multi-cloud platforms.

发明内容Contents of the invention

本发明实施例提供一种计费方法、分析中心和计费中心,用以提供一种适用于OpenStack的计费机制,能够解决现有技术不支持对多种云服务的资源使用进行混合计费,也不支持对多分区多云平台进行混合计费的问题。The embodiment of the present invention provides a billing method, an analysis center and a billing center, which are used to provide a billing mechanism suitable for OpenStack, which can solve the problem that the existing technology does not support mixed billing for resource usage of multiple cloud services , and does not support hybrid billing for multi-partition and multi-cloud platforms.

第一方面,提供一种计费方法,适用于云计算下对云服务的资源使用进行计费,所述方法包括:In the first aspect, a charging method is provided, which is suitable for charging cloud service resource usage under cloud computing, and the method includes:

根据第一租户的标识查询所述第一租户对应的分区,并查询所述第一租户对应的每个分区中的与所述第一租户对应的可用区,得到所述第一租户对应的至少一个可用区;其中所述第一租户为所有租户中的任一个租户;Query the partition corresponding to the first tenant according to the identifier of the first tenant, and query the availability zone corresponding to the first tenant in each partition corresponding to the first tenant, and obtain at least An availability zone; wherein the first tenant is any one of all tenants;

根据所述第一租户的标识查询所述第一租户对应的工程,得到所述第一租户对应的至少一个工程;Querying the project corresponding to the first tenant according to the identifier of the first tenant to obtain at least one project corresponding to the first tenant;

根据所述至少一个工程的标识在所述至少一个可用区下查询所述至少一个工程中每个工程所使用的资源的资源信息,得到所述第一租户所使用的至少一个资源的资源信息;Query resource information of resources used by each project in the at least one project in the at least one availability zone according to the identifier of the at least one project, and obtain resource information of at least one resource used by the first tenant;

根据所述至少一个资源的资源信息对每个资源的使用量进行统计,得到所述第一租户的资源使用信息;Counting the usage of each resource according to the resource information of the at least one resource to obtain the resource usage information of the first tenant;

根据所述所有租户的资源使用信息生成资源使用统计总表;Generate a resource usage statistics summary table according to the resource usage information of all tenants;

将所述资源使用统计总表发送至计费中心,以便计费中心根据所述资源使用统计总表获取每个租户的资源使用信息,并根据资源定价表以及每个租户的资源使用信息确定每个租户的费用。Send the resource usage statistics summary table to the billing center, so that the billing center can obtain the resource usage information of each tenant according to the resource usage statistics summary table, and determine the resource usage information of each tenant according to the resource pricing table and the resource usage information of each tenant. tenant's fees.

结合第一方面,在第一种可能的实现方式中,所述至少一个资源的资源信息包括:所述至少一个资源的资源标识和资源类型;With reference to the first aspect, in a first possible implementation manner, the resource information of the at least one resource includes: a resource identifier and a resource type of the at least one resource;

其中,所述资源类型包括:实例,镜像,简单存储服务S3,弹性块存储EBS,弹性负载均衡ELB,以及流量中的一种。Wherein, the resource type includes: one of instance, image, simple storage service S3, elastic block storage EBS, elastic load balancing ELB, and traffic.

结合第一方面的第一种可能的实现方式,在第二种可能的实现方式中,所述根据所述至少一个资源的资源信息对每个资源的使用量进行统计包括:With reference to the first possible implementation manner of the first aspect, in a second possible implementation manner, the counting the usage of each resource according to the resource information of the at least one resource includes:

若所述至少一个资源中的任一资源的资源类型为实例,则根据所述任一资源的资源标识统计所述任一资源对应的虚拟机使用时长作为所述任一资源的使用量;If the resource type of any resource in the at least one resource is an instance, count the usage time of the virtual machine corresponding to the any resource as the usage amount of the any resource according to the resource identifier of the any resource;

若所述任一资源的资源类型为镜像,则根据所述任一资源的资源标识将所述任一资源所属实例对应的虚拟机使用时长作为所述任一资源的使用量;If the resource type of any resource is a mirror image, then according to the resource identifier of any resource, the usage time of the virtual machine corresponding to the instance to which any resource belongs is taken as the usage amount of any resource;

若所述任一资源的资源类型为EBS,则根据所述任一资源的资源标识统计所述任一资源的使用空间大小和使用时长作为所述任一资源的使用量;If the resource type of any resource is EBS, count the usage space size and usage duration of any resource as the usage amount of any resource according to the resource identifier of any resource;

若所述任一资源的资源类型为S3,则根据所述任一资源的资源标识统计所述任一资源的使用空间大小和使用时长作为所述任一资源的使用量;If the resource type of any resource is S3, count the usage space size and usage duration of any resource as the usage amount of any resource according to the resource identifier of any resource;

若所述任一资源的资源类型为ELB,则根据所述任一资源的资源标识统计所述任一资源的使用时长作为所述任一资源的使用量;If the resource type of any resource is ELB, count the usage time of any resource as the usage amount of any resource according to the resource identifier of any resource;

若所述任一资源的资源类型为流量,则将所述任一资源对应的根据所述任一资源的资源标识统计所述任一资源的流量值作为所述任一资源的使用量。If the resource type of the any resource is traffic, count the traffic value of the any resource corresponding to the any resource according to the resource identifier of the any resource as the usage amount of the any resource.

结合第一方面或其上述可能的实现方式中的任一种,在第三种可能的实现方式中,所述根据第一租户的标识查询所述第一租户对应的分区以及每个所述分区中所述第一租户对应的可用区至所述将所述资源使用统计总表发送至计费中心为一个查询批次;With reference to the first aspect or any of the above possible implementation manners, in a third possible implementation manner, the querying the partition corresponding to the first tenant and each of the partitions according to the identifier of the first tenant From the availability zone corresponding to the first tenant to the sending of the resource usage statistics summary table to the billing center is a query batch;

在所述将所述资源使用统计总表发送至计费中心之后,间隔预设时长后执行下一个查询批次。After the resource usage statistics summary table is sent to the billing center, the next query batch is executed after a preset period of time.

结合第一方面的第三种可能的实现方式,在第四种可能的实现方式中,在所述资源使用统计总表中,每个资源对应一个条目;其中,任一资源对应的条目包括:租户标识、资源类型、资源标识、资源使用量、查询时间戳;With reference to the third possible implementation of the first aspect, in a fourth possible implementation, in the resource usage statistics summary table, each resource corresponds to an entry; wherein, the entry corresponding to any resource includes: Tenant ID, resource type, resource ID, resource usage, query timestamp;

其中,所述租户标识为使用所述任一资源的租户的标识,所述资源类型为所述任一资源的资源类型,所述资源标识为所述任一资源的资源标识,所述资源使用量为所述租户标识对应的租户使用所述任一资源的使用量,所述查询时间戳为查询所述资源使用量的时间点,其中,在同一查询批次中,每个资源对应的条目中的查询时间戳相同。Wherein, the tenant ID is the ID of the tenant using the any resource, the resource type is the resource type of the any resource, the resource ID is the resource ID of the any resource, and the resource uses The amount is the usage amount of any resource used by the tenant corresponding to the tenant ID, and the query timestamp is the time point when the resource usage amount is queried, wherein, in the same query batch, the entry corresponding to each resource The query timestamps in are the same.

第二方面,提供一种计费方法,适用于云计算下对云服务的资源使用进行计费,所述方法包括:In the second aspect, a charging method is provided, which is suitable for charging cloud service resource usage under cloud computing, and the method includes:

接收分析中心发送的资源使用统计总表;Receive the summary table of resource usage statistics sent by the analysis center;

根据所述资源使用统计总表获取每个租户的资源使用信息;Obtain resource usage information of each tenant according to the resource usage statistics table;

根据资源定价表以及每个租户的资源使用信息获取每个租户的费用;Obtain the cost of each tenant according to the resource pricing table and the resource usage information of each tenant;

所述资源的资源类型包括:实例,镜像,简单存储服务S3,弹性块存储EBS,弹性负载均衡ELB,以及流量中的一种。The resource type of the resource includes: one of instance, image, simple storage service S3, elastic block storage EBS, elastic load balance ELB, and traffic.

结合第二方面,在第一种可能的实现方式中,在所述资源使用统计总表中每个资源对应一个条目;其中,任一资源对应的条目包括:租户标识、资源类型、资源标识、资源使用量、查询时间戳;With reference to the second aspect, in a first possible implementation manner, each resource in the resource usage statistics summary table corresponds to an entry; wherein, the entry corresponding to any resource includes: tenant identifier, resource type, resource identifier, Resource usage, query timestamp;

其中,所述租户标识为使用所述任一资源的租户的标识,所述资源类型为所述任一资源的资源类型,所述资源标识为所述任一资源的资源标识,所述资源使用量为所述租户标识对应的租户使用所述任一资源的使用量,所述查询时间戳为查询所述资源使用量的时间点,其中,在同一查询批次中,每个资源对应的条目中的查询时间戳相同。Wherein, the tenant ID is the ID of the tenant using the any resource, the resource type is the resource type of the any resource, the resource ID is the resource ID of the any resource, and the resource uses The amount is the usage amount of any resource used by the tenant corresponding to the tenant ID, and the query timestamp is the time point when the resource usage amount is queried, wherein, in the same query batch, the entry corresponding to each resource The query timestamps in are the same.

结合第二方面的第一种可能的实现方式,在第二种可能的实现方式中,所述根据所述资源使用统计总表获取每个租户的资源使用信息包括:With reference to the first possible implementation manner of the second aspect, in the second possible implementation manner, the obtaining the resource usage information of each tenant according to the resource usage statistics table includes:

根据所述资源使用统计总表中每个条目中的所述租户标识确定每条条目所属的租户;determining the tenant to which each entry belongs according to the tenant identifier in each entry in the resource usage statistics summary table;

根据每个租户的所有条目获取每个租户的资源使用信息,每个租户的资源使用信息包括每个租户所使用的每个资源的使用量。The resource usage information of each tenant is obtained according to all entries of each tenant, and the resource usage information of each tenant includes the usage amount of each resource used by each tenant.

结合第二方面的第二种可能的实现方式,在第三种可能的实现方式中,所述根据资源定价表以及每个租户的资源使用信息获取每个租户的费用包括:With reference to the second possible implementation of the second aspect, in a third possible implementation, the obtaining the cost of each tenant according to the resource pricing table and the resource usage information of each tenant includes:

查询所述资源定价表获取每个租户所使用的每个资源的单位价格;Query the resource pricing table to obtain the unit price of each resource used by each tenant;

按照每个租户所使用的每个资源的单位价格,根据每个租户所使用的每个资源的使用量以及预设的计费策略计算每个租户所使用的每个资源的费用;According to the unit price of each resource used by each tenant, calculate the cost of each resource used by each tenant according to the usage of each resource used by each tenant and the preset billing policy;

根据每个租户所使用的每个资源的费用计算每个租户的总费用。Calculates the total cost per tenant based on the cost per resource used by each tenant.

结合第二方面的第三种可能的实现方式,在第四种可能的实现方式中,每个租户所使用的每个资源的使用量包括:In combination with the third possible implementation of the second aspect, in the fourth possible implementation, the usage of each resource used by each tenant includes:

对于任一租户,若所述任一租户所使用的任一资源的资源类型为实例,则所述任一资源的使用量为所述任一资源对应的虚拟机使用时长;For any tenant, if the resource type of any resource used by the any tenant is an instance, the usage amount of the any resource is the usage time of the virtual machine corresponding to the any resource;

若所述任一租户所使用的任一资源的资源类型为镜像,则所述任一资源的使用量为所述任一资源所属实例对应的虚拟机使用时长;If the resource type of any resource used by any of the tenants is mirroring, the usage of any of the resources is the usage time of the virtual machine corresponding to the instance to which any of the resources belongs;

若所述任一租户所使用的任一资源的资源类型为EBS,则所述任一资源的使用量为所述任一资源的使用空间大小和使用时长;If the resource type of any resource used by any of the tenants is EBS, then the amount of usage of any of the resources is the size and duration of usage of any of the resources;

若所述任一租户所使用的任一资源的资源类型为S3,则所述任一资源的使用量为所述任一资源的使用空间大小和使用时长;If the resource type of any resource used by any of the tenants is S3, then the amount of usage of any of the resources is the usage space and duration of usage of any of the resources;

若所述任一租户所使用的任一资源的资源类型为ELB,则所述任一资源的使用量为所述任一资源的使用时长;If the resource type of any resource used by any of the tenants is ELB, the usage amount of any of the resources is the usage time of any of the resources;

若所述任一租户所使用的任一资源的资源类型为流量,则所述任一资源的使用量为所述任一资源的流量值。If the resource type of any resource used by any tenant is traffic, the usage amount of any resource is the traffic value of any resource.

结合第二方面的第四种可能的实现方式,在第五种可能的实现方式中,所述预设的计费策略包括:With reference to the fourth possible implementation of the second aspect, in a fifth possible implementation, the preset charging policy includes:

若所述任一租户所使用的任一资源的资源类型为实例,则所述任一租户使用所述任一资源的费用为所述任一资源对应的虚拟机使用时长*所述任一资源的单位价格;If the resource type of any resource used by any of the tenants is an instance, the fee for any of the resources used by any of the tenants is the virtual machine usage time corresponding to the any of the resources * the time of use of the any of the resources unit price;

若所述任一租户所使用的任一资源的资源类型为镜像,则所述任一租户使用所述任一资源的费用为所述任一资源所属实例对应的虚拟机使用时长*所述任一资源的单位价格;If the resource type of any resource used by any of the tenants is mirror image, the cost for any of the resources used by any of the tenants is the usage time of the virtual machine corresponding to the instance to which any of the resources belongs * the duration of any of the resources the unit price of a resource;

若所述任一租户所使用的任一资源的资源类型为EBS,则所述任一租户使用所述任一资源的费用为所述任一资源的使用空间大小*使用时长*所述任一资源的单位价格;If the resource type of any resource used by any of the tenants is EBS, then the fee for any of the resources used by any of the tenants is the size of the space used by any of the resources * the duration of use * the the unit price of the resource;

若所述任一租户所使用的任一资源的资源类型为S3,则所述任一租户使用所述任一资源的费用为所述任一资源的使用空间大小*使用时长*所述任一资源的单位价格;If the resource type of any resource used by any of the tenants is S3, then the fee for any of the resources used by any of the tenants is the size of the space used by any of the resources * the duration of use * the the unit price of the resource;

若所述任一租户所使用的任一资源的资源类型为ELB,则所述任一租户使用所述任一资源的费用为所述任一资源的使用时长*所述任一资源的单位价格;If the resource type of any resource used by any tenant is ELB, the cost for any resource used by any tenant is the usage time of any resource * the unit price of any resource ;

若所述任一租户所使用的任一资源的资源类型为流量,则所述任一租户使用所述任一资源的费用为所述任一资源的流量值*所述任一资源的单位价格;If the resource type of any resource used by any of the tenants is traffic, then the cost for any of the resources used by any of the tenants is the traffic value of any of the resources * the unit price of any of the resources ;

其中,所述任一资源的单位价格是根据所述任一资源的资源价格、价格单位和度量单位确定的。Wherein, the unit price of any resource is determined according to the resource price, price unit and measurement unit of any resource.

结合第二方面或其上述任一种可能的实现方式,在第六种实现方式中,还包括:In combination with the second aspect or any of the above-mentioned possible implementation manners, in a sixth implementation manner, it also includes:

获取所述分析中心统计的每类资源的使用率;Obtain the utilization rate of each type of resource counted by the analysis center;

根据每类资源的使用率,以及预设的每类资源的使用率对应的价格调整策略对该类资源的资源价格进行调整。The resource price of this type of resource is adjusted according to the usage rate of each type of resource and the preset price adjustment strategy corresponding to the usage rate of each type of resource.

第三方面,提供一种分析中心,适用于云计算下对云服务的资源使用进行计费,所述分析中心包括:In a third aspect, an analysis center is provided, which is suitable for billing cloud service resource usage under cloud computing, and the analysis center includes:

查询模块,用于根据第一租户的标识查询所述第一租户对应的分区,并查询所述第一租户对应的每个分区中的与所述第一租户对应的可用区,得到所述第一租户对应的至少一个可用区;其中所述第一租户为所有租户中的任一个租户;A query module, configured to query the partition corresponding to the first tenant according to the identifier of the first tenant, and query the availability zone corresponding to the first tenant in each partition corresponding to the first tenant, to obtain the first tenant At least one availability zone corresponding to a tenant; wherein the first tenant is any one of all tenants;

所述查询模块,还用于根据所述第一租户的标识查询所述第一租户对应的工程,得到所述第一租户对应的至少一个工程;The query module is further configured to query the project corresponding to the first tenant according to the identifier of the first tenant, and obtain at least one project corresponding to the first tenant;

采集模块,用于根据所述至少一个工程的标识在所述至少一个可用区下查询所述至少一个工程中每个工程所使用的资源的资源信息,得到所述第一租户所使用的至少一个资源的资源信息;A collection module, configured to query resource information of resources used by each project in the at least one project in the at least one availability zone according to the identifier of the at least one project, and obtain at least one resource used by the first tenant. resource information of the resource;

分析模块,用于根据所述至少一个资源的资源信息对每个资源的使用量进行统计,得到所述第一租户的资源使用信息;An analysis module, configured to count the usage of each resource according to the resource information of the at least one resource, and obtain the resource usage information of the first tenant;

所述分析模块,用于根据所述所有租户的资源使用信息生成资源使用统计总表;The analysis module is configured to generate a summary table of resource usage statistics according to the resource usage information of all tenants;

接口模块,用于将所述资源使用统计总表发送至计费中心,以便计费中心根据所述资源使用统计总表获取每个租户的资源使用信息,并根据资源定价表以及每个租户的资源使用信息确定每个租户的费用。An interface module, configured to send the resource usage summary table to the billing center, so that the billing center can obtain the resource usage information of each tenant according to the resource usage statistics table, and according to the resource pricing table and each tenant's Resource usage information determines the cost per tenant.

结合第三方面,在第一种可能的实现方式中,所述至少一个资源的资源信息包括:所述至少一个资源的资源标识和资源类型;With reference to the third aspect, in a first possible implementation manner, the resource information of the at least one resource includes: a resource identifier and a resource type of the at least one resource;

其中,所述资源类型包括:实例,镜像,简单存储服务S3,弹性块存储EBS,弹性负载均衡ELB,以及流量中的一种。Wherein, the resource type includes: one of instance, image, simple storage service S3, elastic block storage EBS, elastic load balancing ELB, and traffic.

结合第三方面的第一种可能的实现方式,在第二种可能的实现方式中,所述分析模块具体用于:With reference to the first possible implementation of the third aspect, in a second possible implementation, the analysis module is specifically configured to:

若所述至少一个资源中的任一资源的资源类型为实例,则根据所述任一资源的资源标识统计所述任一资源对应的虚拟机使用时长作为所述任一资源的使用量;If the resource type of any resource in the at least one resource is an instance, count the usage time of the virtual machine corresponding to the any resource as the usage amount of the any resource according to the resource identifier of the any resource;

若所述任一资源的资源类型为镜像,则根据所述任一资源的资源标识将所述任一资源所属实例对应的虚拟机使用时长作为所述任一资源的使用量;If the resource type of any resource is a mirror image, then according to the resource identifier of any resource, the usage time of the virtual machine corresponding to the instance to which any resource belongs is taken as the usage amount of any resource;

若所述任一资源的资源类型为EBS,则根据所述任一资源的资源标识统计所述任一资源的使用空间大小和使用时长作为所述任一资源的使用量;If the resource type of any resource is EBS, count the usage space size and usage duration of any resource as the usage amount of any resource according to the resource identifier of any resource;

若所述任一资源的资源类型为S3,则根据所述任一资源的资源标识统计所述任一资源的使用空间大小和使用时长作为所述任一资源的使用量;If the resource type of any resource is S3, count the usage space size and usage duration of any resource as the usage amount of any resource according to the resource identifier of any resource;

若所述任一资源的资源类型为ELB,则根据所述任一资源的资源标识统计所述任一资源的使用时长作为所述任一资源的使用量;If the resource type of any resource is ELB, count the usage time of any resource as the usage amount of any resource according to the resource identifier of any resource;

若所述任一资源的资源类型为流量,则将所述任一资源对应的根据所述任一资源的资源标识统计所述任一资源的流量值作为所述任一资源的使用量。If the resource type of the any resource is traffic, count the traffic value of the any resource corresponding to the any resource according to the resource identifier of the any resource as the usage amount of the any resource.

结合第三方面或其上述可能的实现方式中的任一种,在第三种可能的实现方式中,从所述查询模块根据第一租户的标识查询所述第一租户对应的分区以及每个所述分区中所述第一租户对应的可用区至所述接口模块将所述资源使用统计总表发送至计费中心为一个查询批次;With reference to the third aspect or any of the above possible implementations, in a third possible implementation, the query module queries the partition corresponding to the first tenant and each The availability zone corresponding to the first tenant in the partition to the interface module sends the resource usage statistics summary table to the billing center as a query batch;

在所述接口模块将所述资源使用统计总表发送至计费中心之后,间隔预设时长后执行下一个所述查询批次。After the interface module sends the resource usage statistics summary table to the billing center, the next query batch is executed after a preset period of time.

结合第三方面的第三种可能的实现方式,在第四种可能的实现方式中,在所述资源使用统计总表中,每个资源对应一个条目;其中,任一资源对应的条目包括:租户标识、资源类型、资源标识、资源使用量、查询时间戳;With reference to the third possible implementation of the third aspect, in a fourth possible implementation, in the resource usage statistics summary table, each resource corresponds to an entry; wherein, the entry corresponding to any resource includes: Tenant ID, resource type, resource ID, resource usage, query timestamp;

其中,所述租户标识为使用所述任一资源的租户的标识,所述资源类型为所述任一资源的资源类型,所述资源标识为所述任一资源的资源标识,所述资源使用量为所述租户标识对应的租户使用所述任一资源的使用量,所述查询时间戳为查询所述资源使用量的时间点,其中,在同一查询批次中,每个资源对应的条目中的查询时间戳相同。Wherein, the tenant ID is the ID of the tenant using the any resource, the resource type is the resource type of the any resource, the resource ID is the resource ID of the any resource, and the resource uses The amount is the usage amount of any resource used by the tenant corresponding to the tenant ID, and the query timestamp is the time point when the resource usage amount is queried, wherein, in the same query batch, the entry corresponding to each resource The query timestamps in are the same.

第四方面,提供一种计费中心,适用于云计算下对云服务的资源使用进行计费,所述计费中心包括:In a fourth aspect, a billing center is provided, which is suitable for billing resource usage of cloud services under cloud computing, and the billing center includes:

接口模块,用于接收分析中心发送的资源使用统计总表;The interface module is used to receive the summary table of resource usage statistics sent by the analysis center;

获取模块,用于根据所述资源使用统计总表获取每个租户的资源使用信息;An acquisition module, configured to acquire resource usage information of each tenant according to the resource usage statistics table;

计费模块,用于根据资源定价表以及每个租户的资源使用信息获取每个租户的费用;The billing module is used to obtain the cost of each tenant according to the resource pricing table and the resource usage information of each tenant;

所述资源的资源类型包括:实例,镜像,简单存储服务S3,弹性块存储EBS,弹性负载均衡ELB,以及流量中的一种。The resource type of the resource includes: one of instance, image, simple storage service S3, elastic block storage EBS, elastic load balance ELB, and traffic.

结合第四方面,在第一种可能的实现方式中,在所述资源使用统计总表中每个资源对应一个条目;其中,任一资源对应的条目包括:租户标识、资源类型、资源标识、资源使用量、查询时间戳;With reference to the fourth aspect, in a first possible implementation manner, each resource corresponds to an entry in the resource usage statistics summary table; wherein, the entry corresponding to any resource includes: tenant identifier, resource type, resource identifier, Resource usage, query timestamp;

其中,所述租户标识为使用所述任一资源的租户的标识,所述资源类型为所述任一资源的资源类型,所述资源标识为所述任一资源的资源标识,所述资源使用量为所述租户标识对应的租户使用所述任一资源的使用量,所述查询时间戳为查询所述资源使用量的时间点,其中,在同一查询批次中,每个资源对应的条目中的查询时间戳相同。Wherein, the tenant ID is the ID of the tenant using the any resource, the resource type is the resource type of the any resource, the resource ID is the resource ID of the any resource, and the resource uses The amount is the usage amount of any resource used by the tenant corresponding to the tenant ID, and the query timestamp is the time point when the resource usage amount is queried, wherein, in the same query batch, the entry corresponding to each resource The query timestamps in are the same.

结合第四方面的第一种可能的实现方式,在第二种可能的实现方式中,所述获取模块具体用于:With reference to the first possible implementation of the fourth aspect, in the second possible implementation, the acquiring module is specifically configured to:

根据所述资源使用统计总表中每个条目中的所述租户标识确定每条条目所属的租户;determining the tenant to which each entry belongs according to the tenant identifier in each entry in the resource usage statistics summary table;

根据每个租户的所有条目获取每个租户的资源使用信息,每个租户的资源使用信息包括每个租户所使用的每个资源的使用量。The resource usage information of each tenant is obtained according to all entries of each tenant, and the resource usage information of each tenant includes the usage amount of each resource used by each tenant.

结合第四方面的第二种可能的实现方式,在第三种可能的实现方式中,所述计费模块包括:With reference to the second possible implementation of the fourth aspect, in a third possible implementation, the billing module includes:

单价查询模块,用于查询所述资源定价表获取每个租户所使用的每个资源的单位价格;A unit price query module, configured to query the resource pricing table to obtain the unit price of each resource used by each tenant;

资源计费模块,用于按照每个租户所使用的每个资源的单位价格,根据每个租户所使用的每个资源的使用量以及预设的计费策略计算每个租户所使用的每个资源的费用;The resource billing module is used to calculate the unit price of each resource used by each tenant, according to the usage of each resource used by each tenant and the preset billing policy. resource costs;

租户计费模块,用于根据每个租户所使用的每个资源的费用计算每个租户的总费用。The tenant billing module is used to calculate the total cost of each tenant according to the cost of each resource used by each tenant.

结合第四方面的第三种可能的实现方式,在第四种可能的实现方式中,每个租户所使用的每个资源的使用量包括:In combination with the third possible implementation of the fourth aspect, in the fourth possible implementation, the usage of each resource used by each tenant includes:

对于任一租户,若所述任一租户所使用的任一资源的资源类型为实例,则所述任一资源的使用量为所述任一资源对应的虚拟机使用时长;For any tenant, if the resource type of any resource used by the any tenant is an instance, the usage amount of the any resource is the usage time of the virtual machine corresponding to the any resource;

若所述任一租户所使用的任一资源的资源类型为镜像,则所述任一资源的使用量为所述任一资源所属实例对应的虚拟机使用时长;If the resource type of any resource used by any of the tenants is mirroring, the usage of any of the resources is the usage time of the virtual machine corresponding to the instance to which any of the resources belongs;

若所述任一租户所使用的任一资源的资源类型为EBS,则所述任一资源的使用量为所述任一资源的使用空间大小和使用时长;If the resource type of any resource used by any of the tenants is EBS, then the amount of usage of any of the resources is the size and duration of usage of any of the resources;

若所述任一租户所使用的任一资源的资源类型为S3,则所述任一资源的使用量为所述任一资源的使用空间大小和使用时长;If the resource type of any resource used by any of the tenants is S3, then the amount of usage of any of the resources is the usage space and duration of usage of any of the resources;

若所述任一租户所使用的任一资源的资源类型为ELB,则所述任一资源的使用量为所述任一资源的使用时长;If the resource type of any resource used by any of the tenants is ELB, the usage amount of any of the resources is the usage time of any of the resources;

若所述任一租户所使用的任一资源的资源类型为流量,则所述任一资源的使用量为所述任一资源的流量值。If the resource type of any resource used by any tenant is traffic, the usage amount of any resource is the traffic value of any resource.

结合第四方面的第四种可能的实现方式,在第五种可能的实现方式中,所述预设的计费策略包括:With reference to the fourth possible implementation of the fourth aspect, in a fifth possible implementation, the preset charging policy includes:

若所述任一租户所使用的任一资源的资源类型为实例,则所述任一租户使用所述任一资源的费用为所述任一资源对应的虚拟机使用时长*所述任一资源的单位价格;If the resource type of any resource used by any of the tenants is an instance, the fee for any of the resources used by any of the tenants is the virtual machine usage time corresponding to the any of the resources * the time of use of the any of the resources unit price;

若所述任一租户所使用的任一资源的资源类型为镜像,则所述任一租户使用所述任一资源的费用为所述任一资源所属实例对应的虚拟机使用时长*所述任一资源的单位价格;If the resource type of any resource used by any of the tenants is mirror image, the cost for any of the resources used by any of the tenants is the usage time of the virtual machine corresponding to the instance to which any of the resources belongs * the duration of any of the resources the unit price of a resource;

若所述任一租户所使用的任一资源的资源类型为EBS,则所述任一租户使用所述任一资源的费用为所述任一资源的使用空间大小*使用时长*所述任一资源的单位价格;If the resource type of any resource used by any of the tenants is EBS, then the fee for any of the resources used by any of the tenants is the size of the space used by any of the resources * the duration of use * the the unit price of the resource;

若所述任一租户所使用的任一资源的资源类型为S3,则所述任一租户使用所述任一资源的费用为所述任一资源的使用空间大小*使用时长*所述任一资源的单位价格;If the resource type of any resource used by any of the tenants is S3, then the fee for any of the resources used by any of the tenants is the size of the space used by any of the resources * the duration of use * the the unit price of the resource;

若所述任一租户所使用的任一资源的资源类型为ELB,则所述任一租户使用所述任一资源的费用为所述任一资源的使用时长*所述任一资源的单位价格;If the resource type of any resource used by any tenant is ELB, the cost for any resource used by any tenant is the usage time of any resource * the unit price of any resource ;

若所述任一租户所使用的任一资源的资源类型为流量,则所述任一租户使用所述任一资源的费用为所述任一资源的流量值*所述任一资源的单位价格;If the resource type of any resource used by any of the tenants is traffic, then the cost for any of the resources used by any of the tenants is the traffic value of any of the resources * the unit price of any of the resources ;

其中,所述任一资源的单位价格是根据所述任一资源的资源价格、价格单位和度量单位确定的。Wherein, the unit price of any resource is determined according to the resource price, price unit and measurement unit of any resource.

结合第四方面或其上述任一种可能的实现方式,在第六种实现方式中,所述计费中心还包括:价格调整模块,所述价格调整模块用于:With reference to the fourth aspect or any of the above-mentioned possible implementation manners, in a sixth implementation manner, the billing center further includes: a price adjustment module, and the price adjustment module is used for:

获取所述分析中心统计的每类资源的使用率;Obtain the utilization rate of each type of resource counted by the analysis center;

根据每类资源的使用率,以及预设的每类资源的使用率对应的价格调整策略对该类资源的资源价格进行调整。The resource price of this type of resource is adjusted according to the usage rate of each type of resource and the preset price adjustment strategy corresponding to the usage rate of each type of resource.

本发明实施例提供一种计费方法、分析中心和计费中心,首先由分析中心根据租户的标识,查询每个租户对应的分区,并查询每个租户对应每个分区中的对应该租户的可用区,得到每个租户对应的至少一个可用区,还根据租户的标识查询每个租户对应的工程,从而在每个租户对应的至少一个可用区下查询该租户所使用的至少一个资源的资源信息,而后再对每个资源的使用量进行统计,最终得到每个租户的资源使用信息,生成资源使用统计总表,并将该资源使用统计总表发送给计费中心,该计费中心能够根据资源使用统计总表获取每个租户的资源使用信息,根据资源定价表以及每个租户的资源使用信息确定每个租户的费用。能够实现对多种云服务的资源使用进行混合计费,并实现对多分区多云平台进行混合计费。An embodiment of the present invention provides a billing method, an analysis center, and a billing center. First, the analysis center queries the partition corresponding to each tenant according to the identifier of the tenant, and queries the corresponding tenant in each partition corresponding to each tenant. Availability zone, get at least one availability zone corresponding to each tenant, and also query the project corresponding to each tenant according to the identifier of the tenant, so as to query the resources of at least one resource used by the tenant under at least one availability zone corresponding to each tenant Information, and then count the usage of each resource, finally get the resource usage information of each tenant, generate a resource usage statistics summary table, and send the resource usage statistics summary table to the billing center, the billing center can The resource usage information of each tenant is obtained according to the resource usage statistics table, and the cost of each tenant is determined according to the resource pricing table and the resource usage information of each tenant. It can realize hybrid billing for resource usage of multiple cloud services, and realize hybrid billing for multi-partition and multi-cloud platforms.

附图说明Description of drawings

为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings that need to be used in the description of the embodiments. Obviously, the drawings in the following description are some embodiments of the present invention. For those skilled in the art, other drawings can also be obtained based on these drawings without any creative effort.

图1为现有技术中Openstack的架构示意图;FIG. 1 is a schematic diagram of the architecture of Openstack in the prior art;

图2为本发明实施例提供的计费系统的结构示意图;FIG. 2 is a schematic structural diagram of a billing system provided by an embodiment of the present invention;

图3为本发明实施例提供的一种计费方法的流程示意图;FIG. 3 is a schematic flowchart of a billing method provided by an embodiment of the present invention;

图4为本发明实施例提供的另一种计费方法的流程示意图;FIG. 4 is a schematic flowchart of another billing method provided by an embodiment of the present invention;

图5为本发明实施例提供的另一种计费方法的流程示意图;FIG. 5 is a schematic flowchart of another billing method provided by an embodiment of the present invention;

图6为本发明实施例提供的另一种计费方法中的资源使用量统计方法的流程示意图;FIG. 6 is a schematic flowchart of a resource usage statistics method in another charging method provided by an embodiment of the present invention;

图7为本发明实施例提供的另一种计费方法中的租户费用统计方法的流程示意图;FIG. 7 is a schematic flowchart of a tenant fee statistics method in another charging method provided by an embodiment of the present invention;

图8为本发明实施例提供的另一种计费方法中的设定资源定价操作的流程示意图;FIG. 8 is a schematic flowchart of an operation of setting resource pricing in another charging method provided by an embodiment of the present invention;

图9为本发明实施例提供的另一种计费方法中的对设定资源定价操作进行记录的流程示意图;FIG. 9 is a schematic flowchart of recording the operation of setting resource pricing in another billing method provided by an embodiment of the present invention;

图10为本发明实施例提供的另一种计费方法中的管理员查询费用的流程示意图;FIG. 10 is a schematic flowchart of an administrator querying fees in another charging method provided by an embodiment of the present invention;

图11为本发明实施例提供的另一种计费方法中的租户查询费用的流程示意图;Fig. 11 is a schematic flow chart of a tenant query fee in another charging method provided by an embodiment of the present invention;

图12为本发明实施例提供的另一种计费方法中的对资源价格进行调整的流程示意图;FIG. 12 is a schematic flowchart of adjusting resource prices in another charging method provided by an embodiment of the present invention;

图13为本发明实施例提供的一种分析中心的结构示意图;Fig. 13 is a schematic structural diagram of an analysis center provided by an embodiment of the present invention;

图14为本发明实施例提供的一种计费中心的结构示意图;Fig. 14 is a schematic structural diagram of a billing center provided by an embodiment of the present invention;

图15为本发明实施例提供的另一种计费中心的结构示意图;Fig. 15 is a schematic structural diagram of another billing center provided by an embodiment of the present invention;

图16为本发明实施例提供的计费模块的结构示意图;FIG. 16 is a schematic structural diagram of a billing module provided by an embodiment of the present invention;

图17为本发明实施例提供的另一种计费中心的结构示意图;Fig. 17 is a schematic structural diagram of another billing center provided by an embodiment of the present invention;

图18为本发明实施例提供的另一种计费中心的结构示意图;FIG. 18 is a schematic structural diagram of another billing center provided by an embodiment of the present invention;

图19为本发明实施例提供的另一种计费中心的结构示意图;FIG. 19 is a schematic structural diagram of another billing center provided by an embodiment of the present invention;

图20为本发明实施例提供的另一种计费中心的结构示意图;FIG. 20 is a schematic structural diagram of another billing center provided by an embodiment of the present invention;

图21为本发明实施例提供的另一种分析中心的结构示意图;Fig. 21 is a schematic structural diagram of another analysis center provided by an embodiment of the present invention;

图22为本发明实施例提供的另一种计费中心的结构示意图。Fig. 22 is a schematic structural diagram of another billing center provided by an embodiment of the present invention.

具体实施方式detailed description

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

应理解,本发明实施例的技术方案可以应用于OpenStack云环境,适用于云计算下对云服务的资源使用进行计费,OpenStack的系统架构可以如图1所示,OpenStack云环境可以包括多个分区(Region),或者也可以称为数据中心(Data Center,简称:DC),分区可以理解为一种地理区域,是物理概念,例如北京设一个分区。武汉设一个分区,一般运营商会在不同区域部署一套OpenStack系统(即一套云平台)。可用区(英文:Availability Zone,简称:AZ)是在分区范围内的再次切分,一个区域内可以包括多个AZ,AZ实际可以理解为OpenStack系统的内部可用区域,一个OpenStack系统可对应1个或多个AZ。本发明实施例的技术方案所应用的系统架构可以如图2所示,包括:计费系统,以及计费系统所要统计的多个分区,该计费系统包括计费中心和分析中心,该分析中心用于负责原始计量数据采集,通过从不同分区获取不同OpenStack系统的云服务的资源使用情况的原始数据,并存入分析数据库(Analysis Data),再根据该分析数据库中的原始数据进行分析统计,生成基于租户的消费行为的关键绩效指标(英文:Key Performance Indicator,简称:KPI),该KPI提供给计费中心(Billing Center),该KPI可以例如是各个租户的对(云服务)资源的使用量。计费中心从计费数据库(Billing Data)获取各个资源的价格,从而根据该KPI对各个租户的消费行为进行计费,计费中心还可以根据该KPI对各种资源的价格进行调整。It should be understood that the technical solution of the embodiment of the present invention can be applied to the OpenStack cloud environment, and is suitable for charging the resource usage of cloud services under cloud computing. The system architecture of OpenStack can be shown in Figure 1, and the OpenStack cloud environment can include multiple Region, or also called Data Center (DC for short), region can be understood as a geographical area, which is a physical concept, for example, a region is set up in Beijing. One district is set up in Wuhan, and operators generally deploy a set of OpenStack systems (that is, a set of cloud platforms) in different regions. Availability Zone (English: Availability Zone, referred to as: AZ) is a subdivision within the partition range. Multiple AZs can be included in one area. AZ can actually be understood as the internal availability area of the OpenStack system. One OpenStack system can correspond to one or multiple AZs. The system architecture applied by the technical solution of the embodiment of the present invention can be shown in Figure 2, including: a billing system, and a plurality of partitions to be counted by the billing system, the billing system includes a billing center and an analysis center, the analysis The center is responsible for the collection of raw metering data. It obtains the raw data of resource usage of cloud services of different OpenStack systems from different partitions, stores them in the analysis database (Analysis Data), and then performs analysis and statistics based on the raw data in the analysis database. , to generate a key performance indicator (English: Key Performance Indicator, KPI for short) based on the consumption behavior of the tenant. The KPI is provided to the billing center (Billing Center). Usage amount. The billing center obtains the price of each resource from the billing database (Billing Data), so as to charge the consumption behavior of each tenant according to the KPI, and the billing center can also adjust the price of various resources according to the KPI.

本发明实施例提供一种计费方法,适用于云计算下对云服务的资源使用进行计费,如图3所示,该方法包括:An embodiment of the present invention provides a charging method, which is suitable for charging cloud service resource usage under cloud computing. As shown in FIG. 3, the method includes:

步骤101、根据第一租户的标识查询所述第一租户对应的分区,并查询所述第一租户对应的每个分区中的与所述第一租户对应的可用区,得到所述第一租户对应的至少一个可用区;其中所述第一租户为所有租户中的任一个租户。Step 101: Query the partition corresponding to the first tenant according to the identifier of the first tenant, and query the availability zone corresponding to the first tenant in each partition corresponding to the first tenant, and obtain the first tenant Corresponding to at least one availability zone; wherein the first tenant is any one of all tenants.

步骤102、根据所述第一租户的标识查询所述第一租户对应的工程,得到所述第一租户对应的至少一个工程。Step 102: Query the project corresponding to the first tenant according to the identifier of the first tenant, and obtain at least one project corresponding to the first tenant.

步骤103、根据所述至少一个工程的标识在所述至少一个可用区下查询所述至少一个工程中每个工程所使用的资源的资源信息,得到所述第一租户所使用的至少一个资源的资源信息。Step 103: Query the resource information of the resources used by each project in the at least one project in the at least one availability zone according to the identifier of the at least one project, and obtain the information of the at least one resource used by the first tenant resource information.

步骤104、根据所述至少一个资源的资源信息对每个资源的使用量进行统计,得到所述第一租户的资源使用信息。Step 104: Count the usage of each resource according to the resource information of the at least one resource to obtain the resource usage information of the first tenant.

步骤105、根据所述所有租户的资源使用信息生成资源使用统计总表。Step 105, generating a resource usage statistics table according to the resource usage information of all tenants.

步骤106、将所述资源使用统计总表发送至计费中心,以便计费中心根据所述资源使用统计总表获取每个租户的资源使用信息,并根据资源定价表以及每个租户的资源使用信息确定每个租户的费用。Step 106: Send the resource usage summary table to the billing center, so that the billing center can obtain the resource usage information of each tenant according to the resource usage statistics table, and according to the resource pricing table and the resource usage information of each tenant Information to determine the cost per tenant.

另一方面,本发明实施例还提供另一种计费方法,适用于云计算下对云服务的资源使用进行计费,如图4所示,该方法包括:On the other hand, the embodiment of the present invention also provides another charging method, which is suitable for charging cloud service resource usage under cloud computing. As shown in FIG. 4 , the method includes:

步骤201、接收分析中心发送的资源使用统计总表。Step 201, receiving the resource usage statistics summary table sent by the analysis center.

步骤202、根据所述资源使用统计总表获取每个租户的资源使用信息。Step 202. Obtain the resource usage information of each tenant according to the resource usage statistics summary table.

步骤203、根据资源定价表以及每个租户的资源使用信息获取每个租户的费用。Step 203, obtaining the cost of each tenant according to the resource pricing table and the resource usage information of each tenant.

所述资源的资源类型包括:实例(Instance),镜像(Image),简单存储服务(英文:Simple Storage Service,简称:S3),弹性块存储(英文:Elastic Block Store,简称:EBS),弹性负载均衡(英文:Elastic Load Balancing,简称:ELB),以及流量(Traffic)中的一种。The resource types of the resources include: instance (Instance), image (Image), simple storage service (English: Simple Storage Service, abbreviated: S3), elastic block storage (English: Elastic Block Store, abbreviated: EBS), elastic load Balance (English: Elastic Load Balancing, referred to as: ELB), and one of the traffic (Traffic).

本发明实施例提供一种计费方法,由分析中心根据租户的标识,查询每个租户对应的分区,并查询每个租户对应每个分区中对应该租户的可用区,得到每个租户对应的至少一个可用区,还根据租户的标识查询每个租户对应的工程,从而在每个租户对应的至少一个可用区下查询该租户所使用的至少一个资源的资源信息,而后再对每个资源的使用量进行统计,最终得到每个租户的资源使用信息,生成资源使用统计总表,并将该资源使用统计总表发送给计费中心,该计费中心能够根据资源使用统计总表获取每个租户的资源使用信息,根据资源定价表以及每个租户的资源使用信息确定每个租户的费用。能够实现对多种云服务的资源使用进行混合计费,并实现对多分区多云平台进行混合计费。The embodiment of the present invention provides a billing method. The analysis center queries the partition corresponding to each tenant according to the identifier of the tenant, and queries the available area corresponding to the tenant in each partition corresponding to each tenant, and obtains the corresponding partition of each tenant. At least one availability zone, and query the project corresponding to each tenant according to the identifier of the tenant, so as to query the resource information of at least one resource used by the tenant under at least one availability zone corresponding to each tenant, and then check the resource information of each resource The usage is counted, and finally the resource usage information of each tenant is obtained, the resource usage statistics summary table is generated, and the resource usage statistics summary table is sent to the billing center, which can obtain each tenant according to the resource usage statistics summary table The resource usage information of tenants, the cost of each tenant is determined according to the resource pricing table and the resource usage information of each tenant. It can realize hybrid billing for the resource usage of multiple cloud services, and realize hybrid billing for multi-partition and multi-cloud platforms.

为了使本领域技术人员能够更清楚地理解本发明实施例提供的技术方案,下面通过具体的实施例,对本发明的实施例提供的计费方法进行详细说明,为了方便说明,下面以第一租户为例,该第一租户可以是所有租户中的任意一个租户,如图5所示,该方法包括:In order to enable those skilled in the art to more clearly understand the technical solutions provided by the embodiments of the present invention, the billing method provided by the embodiments of the present invention will be described in detail below through specific embodiments. For the convenience of description, the first tenant For example, the first tenant can be any tenant in all tenants, as shown in Figure 5, the method includes:

步骤301、分析中心根据第一租户的标识查询所述第一租户对应的分区并查询所述第一租户对应每个分区中的与所述第一租户对应的可用区,得到所述第一租户对应的至少一个可用区。Step 301: The analysis center queries the partition corresponding to the first tenant according to the identifier of the first tenant and queries the availability zone corresponding to the first tenant in each partition corresponding to the first tenant, and obtains the first tenant corresponding to at least one availability zone.

示例性的,在数据开始采集前,分析中心可以调用KeyStone(认证鉴权模块)的接口Get/v3/domains来查询Domains(域)列表(域列表中包括各个分区的信息),根据Domains列表建立各个租户、分区以及可用区之间的关系,根据该关系可以查询到各租户对应的分区、每个分区中对应该租户的可用区。Exemplarily, before the data collection starts, the analysis center can call the interface Get/v3/domains of KeyStone (authentication and authentication module) to query the Domains (domain) list (the domain list includes the information of each partition), and establish The relationship between each tenant, partition, and availability zone. According to the relationship, you can query the partition corresponding to each tenant and the availability zone corresponding to the tenant in each partition.

故利用上述关系,根据第一租户的标识(例如租户ID)查询第一租户对应的分区,以及查询第一租户对应的每个分区中的与第一租户对应的可用区,可得到第一租户对应的至少一个可用区,可以为该至少一个可用区生成一个可用区列表。其中,该第一租户的标识可以是该第一租户的租户ID,该租户ID例如可以是Token(接入)ID。Therefore, using the above relationship, query the partition corresponding to the first tenant according to the identity of the first tenant (for example, tenant ID), and query the availability zone corresponding to the first tenant in each partition corresponding to the first tenant, you can get the first tenant Corresponding to at least one availability zone, an availability zone list may be generated for the at least one availability zone. Wherein, the identifier of the first tenant may be a tenant ID of the first tenant, and the tenant ID may be, for example, a Token (access) ID.

步骤302、分析中心根据所述第一租户的标识查询所述第一租户对应的工程,得到所述第一租户对应的至少一个工程。Step 302: The analysis center searches for projects corresponding to the first tenant according to the identifier of the first tenant, and obtains at least one project corresponding to the first tenant.

示例性的,分析中心可以根据每个租户的标识调用KeyStone的接口Get/v3/projects查询该租户对应的工程(projects),因此根据第一租户的标识查询第一租户对应的工程,就可以得到第一租户对应的至少一个工程,可以为该至少一个工程生成工程列表。Exemplarily, the analysis center can call the interface Get/v3/projects of KeyStone according to the identity of each tenant to query the projects corresponding to the tenant, so according to the identity of the first tenant to query the project corresponding to the first tenant, you can get For at least one project corresponding to the first tenant, a project list may be generated for the at least one project.

步骤303、分析中心根据所述至少一个工程的标识在所述至少一个可用区下查询所述至少一个工程中每个工程所使用的资源的资源信息,得到所述第一租户所使用的至少一个资源的资源信息。Step 303: The analysis center queries the resource information of the resources used by each project in the at least one project under the at least one availability zone according to the identifier of the at least one project, and obtains at least one resource used by the first tenant. Resource information for the resource.

示例性的,分析中心可以调用Ceilometer(统计模块)的接口Get/v2/meters?q.op=eq&q.value={value}&q.field={field}查询度量对象,该度量对象就是每个工程所使用的资源及其资源信息。Exemplarily, the analysis center can call the interface Get/v2/meters of Ceilometer (statistical module)? q.op=eq&q.value={value}&q.field={field} query measurement object, the measurement object is the resource used by each project and its resource information.

故根据该至少一个工程的标识(例如工程ID)调用接口Get/v2/meters?q.op=eq&q.value={value}&q.field={field}就可以统计出第一租户所使用的至少一个资源的资源信息,并且可以为该至少一个资源的资源信息生成一个资源列表,该列表可以存储在分析数据库中以便后续统计时调用。Therefore, call the interface Get/v2/meters according to the at least one project identifier (for example, project ID)? q.op=eq&q.value={value}&q.field={field} can count the resource information of at least one resource used by the first tenant, and can generate a resource list for the resource information of the at least one resource, This list can be stored in the analysis database for subsequent recall in statistics.

其中,每个资源的资源信息可以包括:该资源的资源标识和资源类型。示例性的,资源类型可以为:实例,镜像,S3,EBS,ELB,以及流量中的一种。其中,若某一资源的资源类型为实例,则该资源的资源标识为实例ID,可以是虚拟机规格名称(VM SpecName),其中VM表示虚拟机(Virtual Machine),Spec表示规格(Specification),若某一资源的资源类型为镜像,则该资源的资源标识为镜像ID,若某一资源的资源类型为EBS,则该资源的资源标识为卷(volume)ID或快照(Snapshot)ID,若某一资源的资源类型为ELB,则该资源的资源标识为桶ELB名称(Name),若某一资源的资源类型为S3,则该资源的资源标识为桶ID。Wherein, the resource information of each resource may include: a resource identifier and a resource type of the resource. Exemplarily, the resource type may be one of: instance, image, S3, EBS, ELB, and traffic. Wherein, if the resource type of a resource is an instance, the resource identifier of the resource is an instance ID, which may be a virtual machine specification name (VM SpecName), where VM represents a virtual machine (Virtual Machine), and Spec represents a specification (Specification), If the resource type of a resource is mirror image, the resource ID of the resource is mirror ID; if the resource type of a resource is EBS, the resource ID of the resource is volume ID or snapshot ID; if If the resource type of a resource is ELB, the resource identifier of the resource is the bucket ELB name (Name). If the resource type of a resource is S3, the resource identifier of the resource is the bucket ID.

步骤304、分析中心根据所述至少一个资源的资源信息对每个资源的使用量进行统计,得到所述第一租户的资源使用信息。Step 304, the analysis center collects statistics on the usage of each resource according to the resource information of the at least one resource, and obtains the resource usage information of the first tenant.

示例性的,分析中心对某一资源调用Ceilometer的接口Get/v2/meters/{meter_name}/statistics?period={value}&q.op=eq&q.value={value}&q.field={field}&groupby={value}进行统计可获得该资源的使用量,因此循环调用该接口第一租户的资源列表中的每个资源进行统计,就能够获得第一租户所使用的每个资源的使用量,将第一租户所使用的每个资源的使用量可以作为第一租户的资源使用信息。Exemplarily, the analysis center calls the interface Get/v2/meters/{meter_name}/statistics of Ceilometer for a certain resource? period={value}&q.op=eq&q.value={value}&q.field={field}&groupby={value} can be used to obtain the usage of this resource by making statistics, so the resource list of the first tenant of this interface is called cyclically By making statistics on each resource of the first tenant, the usage amount of each resource used by the first tenant can be obtained, and the usage amount of each resource used by the first tenant can be used as the resource usage information of the first tenant.

其中,对于不同类型的资源,其资源使用量的度量也不同,例如:Among them, for different types of resources, the measurement of their resource usage is also different, for example:

若任一资源的资源类型为实例,则根据该资源的资源标识(VMSpecName)统计该资源对应的虚拟机使用时长作为该资源的使用量。其中,统计虚拟机使用时长时,可以以小时作为度量单位,使用时长不足一小时的按一小时算。If the resource type of any resource is an instance, count the usage time of the virtual machine corresponding to the resource as the usage amount of the resource according to the resource identifier (VMSpecName) of the resource. Wherein, when counting the usage time of a virtual machine, hours can be used as a measurement unit, and the usage time of less than one hour is counted as one hour.

若该任一资源的资源类型为镜像,则根据该资源的资源标识(镜像ID)将该资源所属实例对应的虚拟机使用时长作为该资源的使用量。需要说明的是,由于镜像是实例的子资源,所以对于镜像的使用量不做单独统计,以其所属的实例对应的虚拟机使用时长作为该镜像的使用量。If the resource type of any resource is a mirror image, the usage time of the virtual machine corresponding to the instance to which the resource belongs is taken as the usage amount of the resource according to the resource identifier (mirror ID) of the resource. It should be noted that since the image is a sub-resource of the instance, the usage of the image is not counted separately, and the usage time of the virtual machine corresponding to the instance to which it belongs is used as the usage of the image.

若该任一资源的资源类型为EBS,则根据该资源的资源标识(卷ID或快照ID)统计该资源的使用空间大小和使用时长作为该资源的使用量。其中,统计时长可以以小时作为度量单位,使用时长不足一小时的按一小时算,统计使用空间大小可以以GB作为度量单位,需要说明的是,由于Openstack的限制,可能无法查询到每个卷或者快照的使用量,只能查询到每个工程的总的EBS使用量,此时在只需统计每个工程所使用的EBS的使用量即可。If the resource type of any resource is EBS, the usage space size and usage duration of the resource are counted according to the resource identifier (volume ID or snapshot ID) of the resource as the usage amount of the resource. Among them, the statistical time can be measured in hours. If the usage time is less than one hour, it will be counted as one hour. The statistical usage space can be measured in GB. It should be noted that due to the limitation of Openstack, it may not be possible to query each volume. Or the usage of snapshots, only the total EBS usage of each project can be queried. At this time, it is only necessary to count the usage of EBS used by each project.

若该任一资源的资源类型为S3,则根据该资源的资源标识(桶ID)统计该资源的使用空间大小和使用时长作为该资源的使用量。其中,统计时长可以以小时作为度量单位,使用时长不足一小时的按一小时算,统计使用空间大小可以以GB(千兆字节)作为度量单位。需要说明的是,在统计S3的使用量时,只需要记录该S3属于哪个分区即可,不需要记录该S3属于哪个可用区。If the resource type of any resource is S3, the usage space size and usage duration of the resource are counted as the usage amount of the resource according to the resource identifier (bucket ID) of the resource. Among them, the statistical duration can be measured in hours, and the usage duration of less than one hour is counted as one hour, and the statistical used space size can be measured in GB (gigabytes). It should be noted that when counting the usage of S3, it is only necessary to record which partition the S3 belongs to, and it is not necessary to record which availability zone the S3 belongs to.

若所述任一资源的资源类型为ELB,则根据该资源的资源标识(ELB名称)统计该任一资源的使用时长作为该资源的使用量。同样的,统计时长可以以小时作为度量单位,使用时长不足一小时的按一小时算。If the resource type of any resource is ELB, count the usage time of any resource as the usage amount of the resource according to the resource identifier (ELB name) of the resource. Similarly, the statistical duration can be measured in hours, and the usage duration of less than one hour is counted as one hour.

若该任一资源的资源类型为流量,则将该资源对应的根据该资源的资源标识统计该资源的流量值作为该资源的使用量。其中,流量值可以以GB/每小时为度量单位。If the resource type of any resource is traffic, the traffic value of the resource corresponding to the resource is counted according to the resource identifier of the resource as the usage amount of the resource. Wherein, the traffic value may be measured in GB/hour.

这样就完成了对第一租户的资源使用信息的统计,对于其他租户的资源使用信息,统计方法与第一租户完全相同,通过反复执行步骤301~步骤304就可以获得所有租户的资源使用信息。In this way, the statistics of the resource usage information of the first tenant is completed. For the resource usage information of other tenants, the statistical method is exactly the same as that of the first tenant. By repeatedly executing steps 301 to 304, the resource usage information of all tenants can be obtained.

步骤305、分析中心根据所有租户的资源使用信息生成资源使用统计总表。Step 305, the analysis center generates a resource usage statistics summary table according to the resource usage information of all tenants.

具体的,分析中心将所有租户的资源使用信息进行汇总就可以得到资源使用统计总表,该资源使用统计总表可以称为t_resource_meter表,该表中记录有每个租户所使用的每个资源的使用量。Specifically, the analysis center summarizes the resource usage information of all tenants to obtain a resource usage statistics summary table. The resource usage statistics summary table can be called the t_resource_meter table, and the table records the information of each resource used by each tenant. Usage amount.

在该资源使用统计总表中,每个资源对应一个条目,任一资源对应的条目中可以包括租户标识、资源类型、资源标识、资源使用量、查询时间戳,其中,租户标识为使用该任一资源的租户的标识,资源类型为该任一资源的资源类型,所述资源标识为该任一资源的资源标识,所述资源使用量为该租户标识对应的租户使用该任一资源的使用量,查询时间戳为查询该资源使用量的时间点,其中,在同一查询批次中,每个资源对应的条目中的查询时间戳相同。除此之外,还可以包括其他信息,例如,资源所述的分区和可用区。另外,上述租户标识可以为租户ID,也可以为工程ID,使用量可以细分为用量和时长,其中时长可以细分为使用时长(分钟)和新增小时数,该新增小时数是用来对使用时长进行进位的,用于将使用时长不足一小时的按一小时统计,可为后续的费用计算提供依据。示例性的,资源使用统计总表的一个条目可以如表1所示:In the resource usage statistics summary table, each resource corresponds to an entry, and the entry corresponding to any resource may include the tenant ID, resource type, resource ID, resource usage, and query timestamp. The tenant identifier of a resource, the resource type is the resource type of any resource, the resource identifier is the resource identifier of any resource, and the resource usage is the usage of any resource by the tenant corresponding to the tenant identifier The query time stamp is the point in time when the resource usage is queried. In the same query batch, the query time stamps in the entries corresponding to each resource are the same. In addition, other information can also be included, such as the partition and availability zone described by the resource. In addition, the above-mentioned tenant ID can be a tenant ID or a project ID. The usage can be subdivided into usage and duration, and the duration can be subdivided into usage duration (minutes) and added hours. The added hours are used It is used to round up the usage time, and is used to count the usage time of less than one hour as one hour, which can provide a basis for subsequent fee calculations. Exemplarily, an entry of the resource usage statistics summary table may be as shown in Table 1:

表1Table 1

表1中的“VARCHAR”表示可变长字符串,“NUMERIC”表示数值,“M”表示必须(Must),TIME_STAMP的格式可以设置为“YYYYDDMMHH:MM”,其中,YYYYDDMM表示年日月,HH:MM表示小时和分钟。在一次采集任务中获得该资源使用统计总表中的所有条目的TIME_STAMP相同,预留字段的是指其他可能的资源类型。另外,关于新增小时数的使用,例如,第一次采集,USETIME=15分钟,NEW_ADDED_HOUR=1,计费按照1小时计算;第二次采集,USETIME=30,NEW_ADDED_HOUR=0,因为15分钟的时候,已经按照1小时计费了,所以30分钟的时候不会重复计费,待到USETIME=75的时候,NEW_ADDED_HOUR=1,依次类推。"VARCHAR" in Table 1 means a variable-length character string, "NUMERIC" means a value, "M" means a must (Must), and the format of TIME_STAMP can be set to "YYYYDDMMHH:MM", where YYYYDDMM means year, day, month, HH :MM indicates hours and minutes. The TIME_STAMP of all entries in the resource usage statistics table obtained in one collection task are the same, and the reserved fields refer to other possible resource types. In addition, regarding the use of newly added hours, for example, for the first collection, USETIME=15 minutes, NEW_ADDED_HOUR=1, billing is calculated according to 1 hour; for the second collection, USETIME=30, NEW_ADDED_HOUR=0, because 15 minutes At that time, it has been billed according to 1 hour, so there will be no repeated billing at 30 minutes, and when USETIME=75, NEW_ADDED_HOUR=1, and so on.

另外,可以对资源使用统计总表进行定期备份,例如可以每月进行备份,具体的每月初可以将已有的资源使用统计总表进行重命名后作为历史表保存,再生成最新的资源使用统计总表,例如假设当前月份为12月,可将已有的表命名为t_resource_meter_201412,而后再根据最新统计的数据创建t_resource_meter。除此之外,还可以设置,该历史表的保存时间,超过该保存时间后自动删除该历史表。In addition, the resource usage statistics summary table can be backed up regularly, for example, it can be backed up every month. Specifically, at the beginning of each month, the existing resource usage statistics summary table can be renamed and saved as a history table, and then the latest resource usage statistics can be generated. For the general table, for example, assuming that the current month is December, you can name the existing table t_resource_meter_201412, and then create t_resource_meter based on the latest statistical data. In addition, you can also set the storage time of the history table, and automatically delete the history table after the storage time exceeds.

步骤306、分析中心将所述资源使用统计总表发送至计费中心。Step 306, the analysis center sends the resource usage statistics summary table to the billing center.

从步骤301至步骤306就完成了一个查询批次,可以在间隔预设时长后再次执行步骤301至步骤306来进行下一个查询批次。One query batch is completed from step 301 to step 306, and steps 301 to 306 can be executed again after a preset time interval to perform the next query batch.

步骤307、计费中心接收分析中心发送的资源使用统计总表。Step 307, the billing center receives the resource usage statistics summary table sent by the analysis center.

步骤308、计费中心根据所述资源使用统计总表获取每个租户的资源使用信息。具体的,如图6所示,可以包括以下步骤:Step 308, the billing center obtains the resource usage information of each tenant according to the resource usage statistics table. Specifically, as shown in Figure 6, the following steps may be included:

步骤3081、根据所述资源使用统计总表中每个条目中的所述租户标识确定每条条目所属的租户。Step 3081: Determine the tenant to which each entry belongs according to the tenant identifier in each entry in the resource usage statistics summary table.

步骤3082、根据每个租户的所有条目获取每个租户的资源使用信息,每个租户的资源使用信息包括每个租户所使用的每个资源的使用量。Step 3082: Obtain the resource usage information of each tenant according to all the entries of each tenant, and the resource usage information of each tenant includes the usage amount of each resource used by each tenant.

具体的,根据步骤305所述,每个条目中都有租户标识(TENANT_ID),根据该租户标识就能知道该条目是属于哪个租户的,从而根据每个租户的所有条目就可以知道每个租户的资源所使用的每个资源的使用量。Specifically, according to step 305, there is a tenant identification (TENANT_ID) in each entry, which tenant the entry belongs to can be known according to the tenant identification, so that each tenant can be known according to all entries of each tenant The usage of each resource used by the resource.

步骤309、计费中心根据资源定价表以及每个租户的资源使用信息确定每个租户的费用。具体的,如图7所示,可以包括以下步骤:Step 309, the billing center determines the fee for each tenant according to the resource pricing table and the resource usage information of each tenant. Specifically, as shown in Figure 7, the following steps may be included:

步骤3091、查询所述资源定价表获取每个租户所使用的每个资源的单位价格。Step 3091, query the resource pricing table to obtain the unit price of each resource used by each tenant.

示例性的,资源定价表可以是预先设置好的,存储在计费数据库中,计费中心在计费时,访问计费数据库就可以查询该资源定价表中的信息。其中,资源定价表中的一个价格条目可以如表2所示。Exemplarily, the resource pricing table may be preset and stored in the billing database, and the billing center may query the information in the resource pricing table by accessing the billing database when billing. Wherein, a price entry in the resource pricing table may be as shown in Table 2.

表2Table 2

表2中的“VARCHAR”表示可变长字符串,“NOT NULL”表示非空,在同一分区下,相同类型但属于不同AZ的资源的价格不同。"VARCHAR" in Table 2 indicates a variable-length character string, and "NOT NULL" indicates that it is not empty. Under the same partition, resources of the same type but belonging to different AZs have different prices.

步骤3092、按照每个租户所使用的每个资源的单位价格,根据每个租户所使用的每个资源的使用量以及预设的计费策略计算每个租户所使用的每个资源的费用。Step 3092: Calculate the cost of each resource used by each tenant according to the unit price of each resource used by each tenant, according to the usage amount of each resource used by each tenant and the preset charging policy.

示例性的,根据表2中的Unit和MeasurementUnit可以获得该价格条目对应资源的单位价格。因此,查询资源定价表可以获得每个租户所使用的每个资源的单位价格,再根据步骤3082中获得的每个租户所使用的每个资源的使用量,利用预设的计费策略就可以计算出每个租户所使用的每个资源的费用。Exemplarily, according to the Unit and MeasurementUnit in Table 2, the unit price of the resource corresponding to the price item can be obtained. Therefore, the unit price of each resource used by each tenant can be obtained by querying the resource pricing table, and then according to the usage amount of each resource used by each tenant obtained in step 3082, the preset billing policy can be used. Calculate the cost per resource used by each tenant.

其中,预设的计费策略可以包括:Among them, the preset billing policy may include:

若所述任一租户所使用的任一资源的资源类型为实例,则该租户使用该资源的费用为该资源对应的虚拟机使用时长*该资源的单位价格;If the resource type of any resource used by any of the tenants is an instance, the cost for the tenant to use the resource is the usage time of the virtual machine corresponding to the resource * the unit price of the resource;

若所述任一租户所使用的任一资源的资源类型为镜像,则该租户使用该资源的费用为该资源所属实例对应的虚拟机使用时长*该资源的单位价格;If the resource type of any resource used by any of the tenants is a mirror image, the cost for the tenant to use the resource is the usage time of the virtual machine corresponding to the instance to which the resource belongs * the unit price of the resource;

若所述任一租户所使用的任一资源的资源类型为EBS,则该租户使用该资源的费用为该资源的使用空间大小*使用时长*该资源的单位价格;其中,EBS可能是卷或快照,因此卷和快照的费用应分开统计。If the resource type of any resource used by any of the tenants is EBS, then the cost for the tenant to use the resource is the size of the space used for the resource * the duration of use * the unit price of the resource; where EBS may be a volume or Snapshots, therefore the costs of volumes and snapshots should be counted separately.

若所述任一租户所使用的任一资源的资源类型为S3,则该租户使用该资源的费用为该资源的使用空间大小*使用时长*该资源的单位价格;If the resource type of any resource used by any of the tenants is S3, the cost for the tenant to use the resource is the size of the resource’s usage space*use duration*the unit price of the resource;

若所述任一租户所使用的任一资源的资源类型为ELB,则该租户使用该资源的费用为该资源的使用时长*该资源的单位价格;If the resource type of any resource used by any of the tenants is ELB, the cost for the tenant to use the resource is the usage time of the resource * the unit price of the resource;

若所述任一租户所使用的任一资源的资源类型为流量,则该租户使用该资源的费用为该资源的流量值*该资源的单位价格;其中,对于流量应分为上行流量、下行流量,上行流量和下行流量分开计费,单位价格相同。If the resource type of any resource used by any of the tenants is flow, then the cost for the tenant to use the resource is the flow value of the resource*the unit price of the resource; among them, the flow should be divided into uplink flow, downlink flow Traffic, upstream traffic and downstream traffic are billed separately, and the unit price is the same.

其中,所述任一资源的单位价格是根据所述任一资源的资源价格、价格单位和度量单位确定的。Wherein, the unit price of any resource is determined according to the resource price, price unit and measurement unit of any resource.

其中,在获取每个资源的费用后,可以为每个资源的费用生成资源计费表,该表可以记为“t_resource_price”,其中,可以对资源计费表进行定期备份,例如可以每月进行备份,具体的每月初可以将已有的资源计费表进行重命名后作为历史表保存,再生成最新的资源计费表,例如假设当前月份为12月,可将已有的表命名为t_resource_price_201412,而后再根据最新统计的数据创建该t_resource_price。除此之外,还可以设置,该历史表的保存时间,超过该保存时间后自动删除该历史表。Wherein, after obtaining the cost of each resource, a resource billing table can be generated for the cost of each resource, which can be recorded as "t_resource_price", where the resource billing table can be backed up regularly, for example, monthly Backup. Specifically, at the beginning of each month, you can rename the existing resource billing table and save it as a history table, and then generate the latest resource billing table. For example, if the current month is December, you can name the existing table as t_resource_price_201412 , and then create the t_resource_price based on the latest statistical data. In addition, you can also set the storage time of the history table, and automatically delete the history table after the storage time exceeds.

示例性的,生成t_resource_price可以包括:Exemplarily, generating t_resource_price may include:

其中,PayAccountName为付款账户名称,LinkedAccountName为已关联付款账户名称,PayerAccountId为付款人账户ID,LinkedAccountId为已关联账户ID,CloudType为云类型,ProductName为产品名称,Region为分区,TenantID为租户ID,ResourceType为资源类型,ResourceID为资源ID,ResourceSpecificationType为资源规格类型,AllUsage为使用量,AllFee为费用,ItemDescription为描述信息,Time为计费时间。Among them, PayAccountName is the name of the payment account, LinkedAccountName is the name of the linked payment account, PayerAccountId is the ID of the payer account, LinkedAccountId is the ID of the linked account, CloudType is the cloud type, ProductName is the product name, Region is the partition, TenantID is the tenant ID, ResourceType is the resource type, ResourceID is the resource ID, ResourceSpecificationType is the resource specification type, AllUsage is the usage amount, AllFee is the fee, ItemDescription is the description information, and Time is the billing time.

步骤3093、根据每个租户所使用的每个资源的费用计算每个租户的总费用。Step 3093: Calculate the total cost of each tenant according to the cost of each resource used by each tenant.

根据步骤3092得到的每个资源的费用,按照租户维度进行求和,就能够得到每个租户的总费用,并为每个租户生成资源计费总表,该资源计费总表可以记为“t_resource_price_total”,具体的可以包括:According to the cost of each resource obtained in step 3092, the total cost of each tenant can be obtained by summing according to the dimension of the tenant, and a resource billing summary table is generated for each tenant. The resource billing table can be recorded as " t_resource_price_total", which can specifically include:

其中,PayAccountName为付款账户名称,LinkedAccountName为已关联付款账户名称,PayerAccountId为付款人账户ID,LinkedAccountId为已关联账户ID,CloudType为云类型,ProductName为产品名称,Region为分区,TenantID为租户ID,ResourceType为资源类型,ResourceID为资源ID,ResourceSpecificationType为资源规格类型,AllUsage为使用量,AllFee为费用,UsageRound为使用量取整,ItemDescription为描述信息,Time为计费时间。Among them, PayAccountName is the name of the payment account, LinkedAccountName is the name of the linked payment account, PayerAccountId is the ID of the payer account, LinkedAccountId is the ID of the linked account, CloudType is the cloud type, ProductName is the product name, Region is the partition, TenantID is the tenant ID, ResourceType is the resource type, ResourceID is the resource ID, ResourceSpecificationType is the resource specification type, AllUsage is the usage, AllFee is the fee, UsageRound is the usage rounding, ItemDescription is the description information, and Time is the billing time.

从步骤301至步骤309就完成了对每个租户的计费过程,该过程可以按照一定时间间隔重复执行,例如可以每月执行一次,以便获取各个租户每月的费用。From step 301 to step 309, the billing process for each tenant is completed. This process can be repeated at certain time intervals, for example, once a month, so as to obtain the monthly fee of each tenant.

另外,可选的,如图8所示,本发明实施例所提供的计费方法还可以包括:In addition, optionally, as shown in FIG. 8, the charging method provided in this embodiment of the present invention may further include:

步骤401、计费中心从管理员设备接收管理员通过管理员界面触发的设定资源定价请求;所述设定资源定价请求为:设定价格请求、删除价格请求和查询价格请求中的一种。Step 401, the billing center receives from the administrator device a resource pricing request triggered by the administrator through the administrator interface; the resource pricing request is one of: a price setting request, a price deletion request, and a price query request .

步骤402、计费中心根据所述设定资源定价请求对所述资源定价表执行对应的设定资源定价操作。Step 402, the billing center performs a corresponding operation of setting resource pricing on the resource pricing table according to the resource pricing setting request.

步骤403、计费中心向所述管理员设备返回设定资源定价响应。Step 403, the billing center returns a resource pricing response to the administrator device.

具体的,所述管理员界面可以是一种显示在管理员设备上的交互界面,用于管理员通过该交互界面来实现设定资源定价操作,示例性的,在所述管理员界面上可以设置有三个Tab(标签)页,其中一个Tab页用于EBS/ELB/S3/流量的定价操作,一个Tab页用于给镜像进行定价操作,另一个Tab页用于给虚拟机规格进行定价操作。其中,每一个Tab页上都设置有该页对应资源的表项,每个表项中都包含了资源类型、当前价格、描述信息、更新时间以及操作按键等。当选定一个Tab页中的一个表项后,点击该表项的操作按键就会在该管理员界面上显示出价格设置界面,该价格设置界面上通常可以设置有价格输入栏、描述信息输入栏以及确认按键和取消按键。其中,价格输入栏用于输入当前要设定的目标价格,描述信息用于输入关于此次操作的描述,例如描述信息可以为“管理员A成功将价格由3.88欧元更新为5.88欧元,此价格将于下月生效”,当价格输入栏和描述信息输入栏中的信息输入完成后,点击确认按键确认。Specifically, the administrator interface may be an interactive interface displayed on the administrator device, which is used for the administrator to implement the operation of setting resource pricing through the interactive interface. Exemplarily, the administrator interface may be There are three tab pages, one of which is used for pricing operations on EBS/ELB/S3/traffic, one is used for pricing operations on images, and the other is used for pricing operations on virtual machine specifications . Wherein, each Tab page is provided with an entry of the resource corresponding to the page, and each entry includes resource type, current price, description information, update time, and operation buttons. When an item in a Tab page is selected, clicking the operation button of the item will display the price setting interface on the administrator interface. The price setting interface can usually be set with a price input column and description information input. bar and confirm and cancel buttons. Among them, the price input column is used to input the current target price to be set, and the description information is used to input the description about this operation, for example, the description information can be "administrator A successfully updated the price from 3.88 euros to 5.88 euros, this price Will take effect next month", when the information in the price input field and description information input field is entered, click the OK button to confirm.

管理员点击该确认按键后就会触发调用对应的设定价格接口生成设定价格请求发送给计费中心,该设定价格接口可以是PUT/v1/pricing,其中PUT表示调用方式,/v1/pricing表示接口的URL(统一资源标识符),该设定价格请求包括:请求设定价格的资源的资源标识、资源类型、资源价格(当前要设定的目标价格)、所属区域(所属分区,或者所属分区以及可用区)、价格单位(如欧元、美元、人民币等)和度量单位(如小时、GB或者GB/每小时)。除此之外,该设定价格请求中还可以包括:操作者信息、描述信息等,示例性的,设定价格请求的内容可以如表3所示。After the administrator clicks the confirmation button, it will trigger the call of the corresponding price setting interface to generate a price setting request and send it to the billing center. The price setting interface can be PUT/v1/pricing, where PUT indicates the calling method, /v1/ pricing indicates the URL (Uniform Resource Identifier) of the interface, and the price setting request includes: the resource identifier, resource type, resource price (the target price to be set currently), and the region to which it belongs (the zone to which it belongs, or the partition to which it belongs and availability zone), price unit (such as Euro, US dollar, RMB, etc.) and measurement unit (such as hour, GB or GB/hour). In addition, the price setting request may also include: operator information, description information, etc. Exemplarily, the content of the price setting request may be as shown in Table 3.

表3table 3

表3中的“O”表示可选的(Optional),另外,示例性的,设定价格请求可以如下消息示例所示:"O" in Table 3 means optional (Optional). In addition, as an example, the price setting request can be as shown in the following message example:

计费中心收到上述设定价格请求后执行设定价格请求对应的操作,此时步骤402中的所述根据所述设定资源定价请求对所述资源定价表执行对应的设定资源定价操作具体可以包括:After the billing center receives the price setting request above, it executes the operation corresponding to the price setting request. At this time, in step 402, according to the resource pricing request, the corresponding resource pricing operation is performed on the resource pricing table. Specifically can include:

判断所述资源定价表中是否存在与所述资源标识、所述资源类型和所述所属区域对应的价格条目;judging whether there is a price entry corresponding to the resource identifier, the resource type, and the region in the resource pricing table;

若不存在所述价格条目,则创建所述价格条目,所述价格条目中包括所述资源标识、所述资源类型、所述资源价格、所述所属区域、所述价格单位、所述度量单位和生效时间;If the price entry does not exist, create the price entry, and the price entry includes the resource identifier, the resource type, the resource price, the region to which it belongs, the price unit, and the measurement unit and effective time;

若存在所述价格条目,则根据所述资源价格对所述价格条目中的资源价格进行修改。If the price entry exists, modify the resource price in the price entry according to the resource price.

可以理解为,设定价格请求可以分为两种,分别是插入(Insert)价格和更新(Updata)价格,计费中心不区分当前的操作是插入价格还是更新价格,当计费中心收到一条新增价格请求时,先根据设定价格请求中的资源标识、所述资源类型和所述所属区域在资源定价表中查询是否存在对应的价格条目,若不存在,则认为当前操作为插入价格,新建一条与该设定价格请求对应的价格条目,该新建的价格条目中通常包括:所述设定价格请求中的资源标识、资源类型、资源价格、所属区域、价格单位、度量单位,以及生效时间,其中,新建的价格条目中的资源价格通常可以包括当前价格和下月价格,当前价格和下月价格均应该设置为所述设定价格请求中的资源价格。若存在,则认为当前操作为更新价格,则将已存在的价格条目中的当前价格保持不变,将下月价格修改为所述设定价格请求中的资源价格即可。It can be understood that price setting requests can be divided into two types, which are Insert price and Update price. The billing center does not distinguish whether the current operation is inserting price or updating price. When the billing center receives a When adding a price request, first check whether there is a corresponding price entry in the resource pricing table according to the resource identifier in the price setting request, the resource type, and the region to which it belongs. If there is no corresponding price entry, the current operation is considered to be an insertion price , create a new price entry corresponding to the price setting request, and the newly created price entry usually includes: the resource identifier, resource type, resource price, area to which it belongs, price unit, measurement unit, and The effective time, wherein, the resource price in the newly created price entry may usually include the current price and the next month's price, and both the current price and the next month's price should be set as the resource price in the price setting request. If it exists, it is considered that the current operation is to update the price, then the current price in the existing price entry remains unchanged, and the price for the next month is changed to the resource price in the price setting request.

若所述设定资源定价请求为所述设定价格请求,所述设定资源定价响应包括:操作成功消息。示例性的,该操作成功消息可以为“STATUS CODE 202Accept”消息。If the resource pricing request is the price setting request, the resource pricing response includes: an operation success message. Exemplarily, the operation success message may be a "STATUS CODE 202Accept" message.

或者,管理员点通过该管理员界面触发调用对应的删除价格接口生成删除价格请求发送给计费中心,该删除价格接口可以是DELETE/v1/{region}/pricing/{resourceType}/{resourceName}?az={az},其中DELETE是调用方式,该删除价格接口的URL为/v1/{region}/pricing/{resourceType}/{resourceName}?az={az},所述删除价格请求包括:请求删除价格的资源的资源标识、资源类型和所属区域(所属分区,或者所属分区以及可用区)。示例性的,设定价格请求的内容可以如表4所示。Or, the administrator triggers and calls the corresponding delete price interface through the administrator interface to generate a delete price request and send it to the billing center. The delete price interface can be DELETE/v1/{region}/pricing/{resourceType}/{resourceName} ? az={az}, where DELETE is the calling method, the URL of the delete price interface is /v1/{region}/pricing/{resourceType}/{resourceName}? az={az}, the price deletion request includes: the resource identifier, resource type, and region to which the price is requested to be deleted (the zone to which it belongs, or the zone to which it belongs and the availability zone). Exemplarily, the content of the price setting request may be as shown in Table 4.

表4Table 4

计费中心收到所述删除价格请求后执行删除价格请求对应的操作,此时步骤402中的所述根据所述设定资源定价请求对所述资源定价表执行对应的设定资源定价操作具体可以包括:After receiving the price deletion request, the billing center executes the operation corresponding to the price deletion request. At this time, the operation of setting resource pricing corresponding to the resource pricing table according to the resource pricing setting request in step 402 is specifically Can include:

在所述资源定价表查找到与所述资源标识、所述资源类型和所述所属区域对应的价格条目;Finding a price entry corresponding to the resource identifier, the resource type, and the region to which it belongs in the resource pricing table;

在所述价格条目中将删除位标记为删除对应的数值。Mark the delete bit as delete the corresponding value in the price entry.

可以理解为,对资源定价的删除操作,并非直接将资源定价表中的价格条目删除,而是将对应记录的标志位标示为“1(已删除)”,保证不影响当月的计费操作。It can be understood that the deletion of resource pricing does not directly delete the price entry in the resource pricing table, but marks the flag of the corresponding record as "1 (deleted)", ensuring that the billing operation of the current month will not be affected.

若所述设定资源定价请求为所述删除价格请求,所述设定资源定价响应包括:操作成功消息。示例性的,该操作成功消息可以为“STATUS CODE 204Not Content”消息。If the resource pricing request is the deletion price request, the resource pricing response includes: an operation success message. Exemplarily, the operation success message may be a "STATUS CODE 204 Not Content" message.

或者,管理员点通过该管理员界面触发调用对应的查询价格接口生成查询价格请求发送给计费中心,该查询价格接口可以是GET/v1/{region}/{resourceType}/pricing?resourceName={resourceName}&az={az},其中GET是调用方式,该查询价格接口的URL为/v1/{region}/{resourceType}/pricing?resourceName={resourceName}&az={az},所述查询价格请求包括:请求查询价格的资源的资源标识、资源类型和所属区域(所属分区,或者所属分区以及可用区)。示例性的,查询价格请求的内容可以如表5所示。Alternatively, the administrator triggers and calls the corresponding query price interface through the administrator interface to generate a price query request and send it to the billing center. The price query interface can be GET/v1/{region}/{resourceType}/pricing? resourceName={resourceName}&az={az}, where GET is the calling method, and the URL of the price query interface is /v1/{region}/{resourceType}/pricing? resourceName={resourceName}&az={az}, the price query request includes: the resource identifier, resource type and region (partition to which, or partition and availability zone) of the resource for which the price is requested. Exemplarily, the content of the price query request may be as shown in Table 5.

表5table 5

示例性的,查询价格请求可以如下消息示例所示:Exemplarily, the query price request may be as shown in the following message example:

GET/v1/region1/2/pricing?resourceName=test&az=az1GET /v1/region1/2/pricing? resourceName=test&az=az1

计费中心收到所述查询价格请求后执行查询价格请求对应的操作,此时步骤402中的所述根据所述设定资源定价请求对所述资源定价表执行对应的设定资源定价操作具体包括:After the billing center receives the query price request, it executes the operation corresponding to the price query request. At this time, the operation of setting resource pricing corresponding to the resource pricing table according to the resource pricing request in step 402 is specifically include:

在所述资源定价表查找到与所述资源标识、所述资源类型和所述所属区域对应的价格条目;Finding a price entry corresponding to the resource identifier, the resource type, and the region to which it belongs in the resource pricing table;

获取所述价格条目中的资源价格、价格单位、度量单位、生效时间、度量单位和生效时间;Obtain the resource price, price unit, measurement unit, effective time, measurement unit and effective time in the price entry;

若所述设定资源定价请求为所述查询价格请求,所述设定资源定价响应包括:所述资源标识、所述资源类型、所述资源价格、所述价格单位、所述度量单位和所述生效时间。示例性的,设定资源定价响应此时为查询价格请求的响应,该设定资源定价响应的内容可以如表6所示。If the resource pricing request is the query price request, the resource pricing response includes: the resource identifier, the resource type, the resource price, the price unit, the measurement unit, and the stated effective time. Exemplarily, the resource pricing response is a response to a price inquiry request, and the content of the resource pricing response can be shown in Table 6.

表6Table 6

参数名parameter name 类型Types of 说明illustrate ResourceIDResourceID stringstring 资源IDResource ID CurrentPriceCurrentPrice stringstring 当前价格Current price NextMonthPriceNextMonthPrice stringstring 下个月价格price next month Unitunit stringstring 价格单位price unit MeasurementUnitMeasurementUnit stringstring 度量单位Unit of measure ActiveTimeActiveTime stringstring 生效时间effective time DescriptionDescription stringstring 描述信息Description

示例性的,可以如下消息示例所示:Exemplarily, it can be shown in the following message example:

或者,在另一种实现方式中,所述查询价格请求可以不包括资源标识,则步骤402中的所述根据所述设定资源定价请求对所述资源定价表执行对应的设定资源定价操作具体包括:Or, in another implementation, the query price request may not include a resource identifier, and then in step 402, according to the resource pricing request, perform the corresponding resource pricing operation on the resource pricing table Specifically include:

在所述资源定价表查找到与所述资源类型和所述所属区域对应的所有资源的价格条目;Finding price entries of all resources corresponding to the resource type and the region in the resource pricing table;

获取所述所有资源的价格条目中的资源价格、价格单位、度量单位、生效时间、度量单位和生效时间;Obtain the resource price, price unit, measurement unit, effective time, measurement unit, and effective time in the price entries of all resources;

若所述设定资源定价请求为所述查询价格请求,所述设定资源定价响应包括:所述所有资源中每个资源的资源标识、资源类型、资源价格、价格单位、度量单位和生效时间。If the resource pricing request is the query price request, the resource pricing response includes: resource identifier, resource type, resource price, price unit, measurement unit and effective time of each resource in all resources .

此时,设定资源定价响应中包括至少一个资源的价格信息,其中每个资源的价格信息的内容与表6中的信息相同,不再赘述。At this time, the price information of at least one resource is set in the resource pricing response, where the content of the price information of each resource is the same as that in Table 6, and will not be repeated here.

可以理解为,为简化调用端的数据处理,不区分批量查询或者单个查询,如果所述查询价格请求除了所属区域外,同时携带了资源类型、资源标识,则会查询出该资源标识对应的资源的价格信息,如果所述查询价格请求中除了所属区域外,仅携带了资源类型,不携带资源标识,则会查询该区域下对应该资源类型的所有资源的价格信息。It can be understood that, in order to simplify the data processing of the calling end, no distinction is made between batch query or single query, if the query price request carries resource type and resource ID at the same time in addition to the area to which it belongs, the resource ID corresponding to the resource ID will be queried For price information, if the price query request only carries the resource type and does not carry the resource identifier in addition to the region to which it belongs, the price information of all resources corresponding to the resource type under the region will be queried.

另外,可选的,如图9所示,对于执行设定价格请求对应的操作或删除价格请求对应的操作,在每次执行完步骤403之后,本发明实施例所提供的计费方法还可以包括:In addition, optionally, as shown in Figure 9, for performing the operation corresponding to the price setting request or the operation corresponding to the deletion price request, after step 403 is executed each time, the billing method provided by the embodiment of the present invention can also be include:

步骤404、计费中心在设定资源定价操作历史记录表中添加与所述设定资源定价操作对应的历史记录条目。Step 404, the billing center adds a history record entry corresponding to the operation of setting resource pricing in the resource pricing operation history table.

所述历史记录条目包括:被操作的资源的资源类型、资源标识、所属区域、操作人员、操作时间和所述设定资源定价操作的描述信息。The history record entry includes: resource type, resource identifier, region to which the operated resource belongs, operator, operation time and description information of the resource pricing operation.

其中,值得一提的是,步骤401~404与步骤301~309之间没有固定的顺序,步骤401~404可以在任意时间执行。Wherein, it is worth mentioning that there is no fixed order between steps 401-404 and steps 301-309, and steps 401-404 can be performed at any time.

相应的,本发明实施例所提供的计费方法还可以包括:Correspondingly, the billing method provided by the embodiment of the present invention may also include:

步骤405、计费中心从管理员设备接收管理员通过管理员界面触发调用对应的操作记录查询接口生成操作记录查询请求(图中为示出)发送给计费中心,该操作记录查询接口可以是GET/v1/{region}/{resourceType}/{resourceName}/operatorLog?az={az}&startDate={startDate}&endDate={endDate},其中GET是调用方式,接口URL为/v1/{region}/{resourceType}/{resourceName}/operatorLog?az={az}&startDate={startDate}&endDate={endDate}。该操作记录查询请求可以包括:请求查询操作记录的资源的资源标识、资源类型和所属区域(所属分区,或者所属分区以及可用区)、开始时间和结束时间。示例性的,操作记录查询请求的内容可以如表7所示。Step 405, the billing center receives from the administrator device. The administrator triggers and calls the corresponding operation record query interface through the administrator interface to generate an operation record query request (shown in the figure) and sends it to the billing center. The operation record query interface can be GET /v1/{region}/{resourceType}/{resourceName}/operatorLog? az={az}&startDate={startDate}&endDate={endDate}, where GET is the calling method, and the interface URL is /v1/{region}/{resourceType}/{resourceName}/operatorLog? az={az}&startDate={startDate}&endDate={endDate}. The operation record query request may include: resource identifier, resource type and region (partition to which, or partition and availability zone to which the operation record is requested to be queried), start time and end time. Exemplarily, the content of the operation record query request may be as shown in Table 7.

表7Table 7

计费中心收到所述操作记录查询请求后,执行操作记录查询请求对应的操作。After receiving the operation record query request, the billing center executes the operation corresponding to the operation record query request.

而后,管理员设备会收到计费中心返回的操作记录查询响应,该响应可以包括:操作时间(operationTime)、描述信息(description)。其中,操作时间是操作记录查询请求所指示的资源的价格条目的操作时间,描述信息是对该条目进行操作的具体内容。例如,若操作记录查询请求为以下消息所示:Then, the administrator device will receive an operation record query response returned by the billing center, and the response may include: operation time (operationTime) and description information (description). Wherein, the operation time is the operation time of the price item of the resource indicated by the operation record query request, and the description information is the specific content of the operation on the item. For example, if the operation record query request is as shown in the following message:

GET/v1/region1/2/testVM/operatorLog?azGET /v1/region1/2/testVM/operatorLog? az

=az1&startDate=2014-02-02&endDate=2014-03-02=az1&startDate=2014-02-02&endDate=2014-03-02

则对应的,操作记录查询响应可以为以下消息所示:Correspondingly, the operation record query response can be as shown in the following message:

另外,可选的,如图10所示,本发明实施例所提供的计费方法还可以包括:In addition, optionally, as shown in FIG. 10, the billing method provided in this embodiment of the present invention may further include:

步骤501、计费中心从管理员设备接收管理员通过管理员费用查询界面触发的费用查询请求,所述费用查询请求中包括所述管理员指定的租户的租户标识,以及所述管理员指定的查询时间。Step 501, the billing center receives from the administrator device a fee query request triggered by the administrator through the administrator fee query interface, and the fee query request includes the tenant ID of the tenant specified by the administrator, and the fee specified by the administrator. Query time.

其中,所述管理员费用查询界面可以是一种显示在管理员设备上的费用查询交互界面,用于管理员通过该交互界面来实现各个租户的费用查询,示例性的,在所述管理员界面上可以设置有查询时间输入栏和租户标识输入栏,当设置好租户标识以及查询时间后就会调用对应的费用查询接口触发生成该费用查询请求发送给计费中心,该费用查询接口可以为GET/v1/charging/bills/total/{time}?tenantId={tenantId},其中GET为调用方式,/v1/charging/bills/total/{time}?tenantId={tenantId}为费用查询接口的URL,计费中心在获得该费用查询请求后就会根据费用查询请求执行步骤502~503。其中,查询时间可以指定成某年某月,示例性的,费用查询请求的内容可以如表8所示。Wherein, the administrator fee query interface may be a fee query interactive interface displayed on the administrator device, which is used for the administrator to realize the fee query of each tenant through the interactive interface. Exemplarily, the administrator The interface can be set with a query time input column and a tenant ID input column. After the tenant ID and query time are set, the corresponding fee query interface will be called to trigger the generation of the fee query request and send it to the billing center. The fee query interface can be GET /v1/charging/bills/total/{time}? tenantId={tenantId}, where GET is the calling method, /v1/charging/bills/total/{time}? tenantId={tenantId} is the URL of the fee query interface, and the billing center will execute steps 502-503 according to the fee query request after obtaining the fee query request. Wherein, the query time can be specified as a certain year and a certain month. Exemplarily, the content of the fee query request can be shown in Table 8.

表8Table 8

步骤502、计费中心根据所述租户标识和所述查询时间查询所述指定的租户在所述查询时间内的费用信息。Step 502, the billing center queries the fee information of the specified tenant within the query time according to the tenant identifier and the query time.

步骤503、计费中心向所述管理员设备返回携带所述费用信息的费用查询响应。Step 503, the billing center returns a charge inquiry response carrying the charge information to the administrator device.

其中,所述费用信息包括:实例使用费、EBS使用费、S3使用费、ELB使用费、流量使用费和总费用,以及所述实例使用费占所述租户的费用总限额的百分比、所述EBS使用费占所述费用总限额的百分比、所述S3使用费占所述费用总限额的百分比、所述ELB使用费占所述费用总限额的百分比、所述流量使用费用占所述费用总限额的百分比以及所述总费用占所述费用总限额的百分比。示例性的,费用查询响应的内容可以如表9所示:Wherein, the fee information includes: instance usage fee, EBS usage fee, S3 usage fee, ELB usage fee, traffic usage fee, and total fee, as well as the percentage of the instance usage fee in the total fee limit of the tenant, the The percentage of the EBS usage fee to the total fee limit, the S3 usage fee to the total fee limit, the ELB usage fee to the total fee limit, and the traffic usage fee to the total fee The percentage of the limit and the percentage of the total limit of the said fee. Exemplarily, the content of the fee query response may be as shown in Table 9:

表9Table 9

示例性的,费用查询请求可以如以下消息所示:Exemplarily, the fee query request may be as shown in the following message:

GET/billingcenter/v1/charging/bills/total/201405GET /billingcenter/v1/charging/bills/total/201405

对应的,费用查询响应可以如以下消息所示:Correspondingly, the fee query response can be as shown in the following message:

最终,收到费用查询响应的管理员设备根据该费用查询响应在该管理员费用查询界面上显示查询结果。可选的,还可以在该管理员费用查询界面上显示下载案件,方便管理员下载查询结果。Finally, the administrator device that receives the fee query response displays the query result on the administrator fee query interface according to the fee query response. Optionally, the downloaded cases can also be displayed on the administrator fee inquiry interface, so that the administrator can download the inquiry results conveniently.

或者,可选的,如图11所示,本发明实施例所提供的计费方法还可以包括:Or, optionally, as shown in FIG. 11 , the billing method provided in this embodiment of the present invention may further include:

步骤601、计费中心从租户设备接收租户通过租户费用查询界面触发的费用查询请求,所述费用查询请求中包括所述租户的租户标识,以及所述租户指定的查询时间。Step 601: The billing center receives a fee query request triggered by the tenant through the tenant fee query interface from the tenant device, and the fee query request includes the tenant ID of the tenant and the query time specified by the tenant.

其中,所述租户费用查询界可以是一种显示在租户设备上的费用查询交互界面,用于租户通过该交互界面来实现该租户的费用查询,示例性的,在所述租户员界面上可以设置有查询时间输入栏,当设置查询时间后就会调用对应的费用查询接口触发生成该费用查询请求发送给计费中心,由计费中心根据费用查询请求执行步骤602~603。Wherein, the tenant fee query interface may be a fee query interactive interface displayed on the tenant's equipment, and is used for the tenant to realize the tenant's fee query through the interactive interface. Exemplarily, the tenant member interface can be There is an input column for query time, and when the query time is set, the corresponding fee query interface will be invoked to trigger the generation of the fee query request and send it to the billing center, and the billing center will execute steps 602-603 according to the fee query request.

步骤602、计费中心根据所述租户标识和所述查询时间查询所述租户在所述查询时间内的费用信息。Step 602, the billing center queries the fee information of the tenant within the query time according to the tenant identifier and the query time.

步骤603、计费中心向所述租户设备返回携带所述费用信息的费用查询响应,所述费用信息包括:实例使用费、EBS使用费、S3使用费、ELB使用费、流量使用费和总费用,以及所述实例使用费占所述租户的费用总限额的百分比、所述EBS使用费占所述费用总限额的百分比、所述S3使用费占所述费用总限额的百分比、所述ELB使用费占所述费用总限额的百分比、所述流量使用费用占所述费用总限额的百分比以及所述总费用占所述费用总限额的百分比。Step 603, the billing center returns a fee query response carrying the fee information to the tenant device, and the fee information includes: instance usage fee, EBS usage fee, S3 usage fee, ELB usage fee, traffic usage fee and total fee , and the percentage of the instance usage fee to the total fee limit of the tenant, the percentage of the EBS usage fee to the total fee limit, the percentage of the S3 usage fee to the total fee limit, the ELB usage fee The percentage of the fee to the total fee limit, the percentage of the traffic usage fee to the total fee limit, and the percentage of the total fee to the total fee limit.

其中,除了租户只能查询自己的费用信息外,步骤602~603的内容与步骤502~503的其他内容完全相同,不再赘述。Among them, except that the tenant can only query its own fee information, the contents of steps 602-603 are completely the same as the other contents of steps 502-503, and will not be repeated here.

其中,步骤501~503与步骤601~603是相互独立的流程。Wherein, steps 501-503 and steps 601-603 are mutually independent processes.

可选的,本发明实施例所提供的计费方法还可以包括:Optionally, the billing method provided in the embodiment of the present invention may also include:

计费中心根据每个租户的费用占该租户的费用总限额的百分比,以及每个租户的费用百分比软限额、费用百分比硬限额,判断是否对该租户进行费用告警以及告警级别;所述费用百分比硬限额大于所述费用百分比软限额。According to the percentage of each tenant's fee in the tenant's total fee limit, as well as each tenant's fee percentage soft limit and fee percentage hard limit, the billing center determines whether to issue an expense alarm and the alarm level for the tenant; the fee percentage The hard cap is greater than the stated fee percentage soft cap.

示例性的,每个租户的费用总限额是预先设置好的,根据已获取的每个租户的费用,以及该预设好的费用总限额,就可以获取每个租户的费用占该租户的费用总限额的百分比。费用百分比软限额、费用百分比硬限额也是预先设置好的。Exemplarily, the total cost limit of each tenant is preset, and according to the acquired cost of each tenant and the preset total cost limit, the cost of each tenant can be obtained as a percentage of the tenant's cost Percentage of total limit. The fee percentage soft limit and fee percentage hard limit are also pre-set.

对于任一租户,若所述任一租户的费用超过所述费用百分比软限额,未超过所述费用百分比硬限额,则对该租户进行告警,告警级别为重要告警;For any tenant, if the fee of any tenant exceeds the soft limit of the fee percentage but does not exceed the hard limit of the fee percentage, an alarm is issued to the tenant, and the alarm level is an important alarm;

若所述任一租户的费用超过所述费用百分比硬限额,则对该租户进行告警,告警级别为紧急告警;If the fee of any one of the tenants exceeds the hard limit of the fee percentage, an alarm will be issued to the tenant, and the alarm level will be an emergency alarm;

若所述任一租户的费用未超过所述费用百分比软限额,则不进行告警。If the fee of any one of the tenants does not exceed the soft limit of the fee percentage, no alarm is issued.

进一步的,还可以设置一上浮阈值变量(upMount),则,Further, a floating threshold variable (upMount) can also be set, then,

对于任一租户,若所述任一租户的费用超过所述费用百分比软限额+上浮阈值变量,未超过所述费用百分比硬限额+上浮阈值变量,则对该租户进行告警,告警级别为重要告警;For any tenant, if the fee of any tenant exceeds the soft limit of the fee percentage + the floating threshold variable, but does not exceed the hard limit of the fee percentage + the floating threshold variable, an alarm will be issued to the tenant, and the alarm level is an important alarm ;

若所述任一租户的费用超过所述费用百分比硬限额+上浮阈值变量,则对该租户进行告警,告警级别为紧急告警;If the cost of any of the tenants exceeds the hard limit of the cost percentage + the floating threshold variable, the tenant is alerted, and the alert level is an emergency alert;

若所述任一租户的费用未超过所述费用百分比软限额+上浮阈值变量,则不进行告警。If the fee of any tenant does not exceed the fee percentage soft limit + floating threshold variable, no alarm is issued.

另外,如果之前有过上述任何一种告警,若当前已达到告警清除条件(费用未超过所述费用百分比软限额+上浮阈值变量),则应当清除告警。若之前是紧急告警,当前的费用已经低于费用百分比硬限额+上浮阈值变量,但是仍高于费用百分比软限额+上浮阈值变量,则应当将告警进行更新为重要告警。In addition, if there has been any of the above-mentioned alarms before, and if the current alarm clearing condition has been reached (the fee does not exceed the soft limit of the fee percentage + the floating threshold variable), the alarm should be cleared. If it was an urgent alarm before, and the current fee is lower than the hard limit of fee percentage + floating threshold variable, but still higher than the soft limit of fee percentage + floating threshold variable, the alarm should be updated as a major alarm.

可选的,如图12所示,本发明实施例所提供的计费方法还可以包括:Optionally, as shown in Figure 12, the charging method provided in this embodiment of the present invention may also include:

步骤701、计费中心获取所述分析中心统计的每类资源的使用率。Step 701, the billing center obtains the utilization rate of each type of resource counted by the analysis center.

步骤702、计费中心根据每类资源的使用率,以及预设的每类资源的使用率对应的价格调整策略对该类资源的资源价格进行调整。Step 702, the billing center adjusts the resource price of each type of resource according to the usage rate of each type of resource and the preset price adjustment policy corresponding to the usage rate of each type of resource.

可以理解为,是基于资源的忙闲比率的动态定价,示例性的,价格调整策略可以是预先设置的,例如可以为以下所示:It can be understood as a dynamic pricing based on the busy/busy ratio of resources. Exemplarily, the price adjustment strategy can be preset, for example, it can be as follows:

当资源使用率达到70%以上,价格在基础价上浮10%;When the resource utilization rate reaches over 70%, the price will be 10% higher than the base price;

当资源使用率达到80%以上,价格在基础价上浮20%;When the resource utilization rate reaches over 80%, the price will be 20% higher than the base price;

当资源使用率达到90%以上,不再接受新服务申请;When the resource utilization rate reaches more than 90%, no new service application will be accepted;

当资源使用率在40%以下,价格在基础价下调10%;When the resource utilization rate is below 40%, the price will be reduced by 10% from the base price;

当资源使用率在20%以下,价格在基础价下调20%;When the resource utilization rate is below 20%, the price will be reduced by 20% from the base price;

当资源使用率在10%以下,免费使用一定时间。When the resource usage rate is below 10%, it will be used for free for a certain period of time.

其具体实现可通过以下步骤包括:Its specific implementation can include the following steps:

a、在根据前述方法获得每个租户的每个资源的使用量后,对每个租户使用的同一资源进行求和得到每个资源的使用总量,并获取每个资源的资源总量;a. After obtaining the usage of each resource of each tenant according to the aforementioned method, sum the same resource used by each tenant to obtain the total usage of each resource, and obtain the total amount of resources of each resource;

b、获取每个资源的使用量,具体的可以通过公式K3=K2/K1*100%获取,其中K3为某一资源的使用率,K2为该资源的使用总量,K1为该资源的资源总量;b. Obtain the usage of each resource, which can be obtained specifically through the formula K3=K2/K1*100%, where K3 is the usage rate of a certain resource, K2 is the total usage of the resource, and K1 is the resource of the resource total amount;

c、监测K3值,与管理员预先设置好的阶梯计价阀值门限比较,若达到该阀值门限时,则触发忙闲比例阶梯定价调整机制;c. Monitor the value of K3 and compare it with the tiered pricing threshold preset by the administrator. If the threshold is reached, the busy-busy ratio tiered pricing adjustment mechanism will be triggered;

d、K3达到阀值,触发忙闲比例阶梯定价调整机制;d. K3 reaches the threshold, triggering the busy-busy ratio ladder pricing adjustment mechanism;

e、根据K3进行调价,调价策略可参照前述价格调整策略;e. Adjust the price according to K3, and the price adjustment strategy can refer to the aforementioned price adjustment strategy;

f、修改计价规则,刷新租户费率。f. Modify the pricing rules and refresh the tenant rate.

除此之外,也可以根据其他依据进行价格调整,例如:可以针对不同分区设置不同的价格,通过价格驱动租户使用不同分区的资源,达到资源均衡使用的效率。In addition, price adjustments can also be made based on other basis. For example, different prices can be set for different partitions, and tenants can be driven to use resources in different partitions through prices to achieve balanced resource utilization efficiency.

又或者,基于大数据分析的阶梯定价:Or, tiered pricing based on big data analysis:

分析中心针对租户的行为和历史数据进行大数据分析,建立KPI指标,根据KPI指标实现动态阶梯调价。例如,关键性KPI设置如下:The analysis center conducts big data analysis on tenants' behavior and historical data, establishes KPI indicators, and realizes dynamic step-by-step price adjustments based on KPI indicators. For example, the key KPI settings are as follows:

云服务时长KPI:即租用云服务资源的占用时长,例如虚拟机使用时长、Image(镜像)时长;Cloud service duration KPI: the duration of renting cloud service resources, such as the usage duration of a virtual machine and image (mirror) duration;

云服务流量KPI:即租用云服务所占用的具体流量,例如ELB服务,上行流量和下行流量;Cloud service traffic KPI: the specific traffic occupied by leased cloud services, such as ELB service, uplink traffic and downlink traffic;

云服务空间KPI:即租用云服务所实际使用的空间,例如S3/EBS存储服务,具体使用存储的空间(GB)。Cloud service space KPI: the space actually used by renting cloud services, such as S3/EBS storage services, and the specific storage space (GB).

其中,上述的各个KPI的获取方法如本实施例步骤301~305所示,不再赘述。Wherein, the methods for acquiring the above KPIs are as shown in steps 301 to 305 of this embodiment, and will not be repeated here.

进一步的,还可以通过一个或多个KPI组合,实现阶梯调价。Furthermore, stepwise price adjustment can also be realized through the combination of one or more KPIs.

例如:E.g:

使用云服务时长KPI(可以为当月的),计费中心获取该云服务时长KPI进行阶梯定价,比如:Using the cloud service duration KPI (can be the current month), the billing center obtains the cloud service duration KPI for tiered pricing, for example:

云服务时长KPI>720小时,资源价格在基础价下调10%;Cloud service duration KPI>720 hours, the resource price will be reduced by 10% from the base price;

云服务时长KPI>1440小时,资源价格在基础价下调20%;Cloud service duration KPI>1440 hours, the resource price will be reduced by 20% from the base price;

云服务时长KPI>2880小时,资源价格在基础价下调30%。If the cloud service duration KPI is >2880 hours, the resource price will be reduced by 30% from the base price.

又例如:Another example:

使用云服务流量KPI(可以为当月的),计费中心获取该云服务流量KPI进行阶梯定价,比如:Using the cloud service traffic KPI (can be the current month), the billing center obtains the cloud service traffic KPI for tiered pricing, for example:

云服务流量KPI>100GB,资源价格在基础价下调10%;Cloud service traffic KPI>100GB, the resource price will be reduced by 10% from the base price;

云服务流量KPI>200GB,资源价格在基础价下调20%;Cloud service traffic KPI>200GB, the resource price will be reduced by 20% from the base price;

云服务流量KPI>500GB,资源价格在基础价下调30%。If the cloud service traffic KPI is >500GB, the resource price will be reduced by 30% from the base price.

又例如:Another example:

使用云服务空间KPI(可以为当月的),计费中心获取该云服务空间KPI进行阶梯定价,比如:Using the cloud service space KPI (can be the current month), the billing center obtains the cloud service space KPI for tiered pricing, for example:

云服务空间KPI>100GB,资源价格在基础价下调10%;Cloud service space KPI>100GB, the resource price will be reduced by 10% from the base price;

云服务空间KPI>200GB,资源价格在基础价下调20%;Cloud service space KPI>200GB, the resource price will be reduced by 20% from the base price;

云服务空间KPI>500GB,资源价格在基础价下调30%。If the cloud service space KPI is >500GB, the resource price will be reduced by 30% from the base price.

进一步的,还可以进行混合定价。Furthermore, mixed pricing can also be carried out.

将多种云服务结合在一起进行定价,例如将弹性云计算(英文:Elastic ComputeCloud,简称:EC2)服务和镜像服务结合,形成一个综合的实例服务,对租户而言,只看到实例服务的费用,更方便用户使用。Combining multiple cloud services together for pricing, such as combining elastic cloud computing (English: Elastic ComputeCloud, referred to as: EC2) services and image services to form a comprehensive instance service, for tenants, only see the instance service cost, and more user-friendly.

或者,根据多种云服务的KPI混合阶梯定价,例如当资源使用率在40%以下,并且租户使用云服务的时长KPI>720小时,则定价下调20%(10%+10%)。Or, according to the KPI hybrid tiered pricing of multiple cloud services, for example, when the resource usage rate is below 40% and the KPI of the tenant's use of cloud services is >720 hours, the price will be reduced by 20% (10% + 10%).

以上的几种定价策略仅仅是示例性的,包括但不限于此,还可以采用其他可能的定价策略,在此不一一列举。The above several pricing strategies are only exemplary, including but not limited to these, and other possible pricing strategies may also be adopted, which are not listed here.

其中,需要说明的是,本发明实施例中所提及的各种接口均为示例性的,包括但不限于此,也可以为其他具有相同功能的接口,本实施例中不再一一列举。另外,所述管理员设备或租户设备为与计费中心具有通信连接关系的设备,其中管理员设备可以是计费中心的一部分设备,也可以是独立于计费中心的设备。Among them, it should be noted that the various interfaces mentioned in the embodiments of the present invention are exemplary, including but not limited to this, and may also be other interfaces with the same function, which will not be listed one by one in this embodiment . In addition, the administrator device or tenant device is a device having a communication connection with the billing center, where the administrator device may be a part of the billing center or a device independent of the billing center.

本发明实施例提供一种计费方法,由分析中心根据租户的标识,查询每个租户对应的分区,并查询每个租户对应的每个分区中的对应该租户的可用区,得到每个租户对应的至少一个可用区,还根据租户的标识查询每个租户对应的工程,从而在每个租户对应的至少一个可用区下查询该租户所使用的至少一个资源的资源信息,而后再对每个资源的使用量进行统计,最终得到每个租户的资源使用信息,生成资源使用统计总表,并将该资源使用统计总表发送给计费中心,该计费中心能够根据资源使用统计总表获取每个租户的资源使用信息,根据资源定价表以及每个租户的资源使用信息确定每个租户的费用。能够实现对多种云服务的资源使用进行混合计费,并实现对多分区多云平台进行混合计费。An embodiment of the present invention provides a billing method. The analysis center queries the partition corresponding to each tenant according to the identifier of the tenant, and queries the available area corresponding to the tenant in each partition corresponding to each tenant, and obtains the cost of each tenant. Corresponding to at least one availability zone, also query the project corresponding to each tenant according to the tenant’s identification, so as to query the resource information of at least one resource used by the tenant under at least one availability zone corresponding to each tenant, and then for each The resource usage is counted, and finally the resource usage information of each tenant is obtained, the resource usage statistics summary table is generated, and the resource usage statistics summary table is sent to the billing center, which can be obtained according to the resource usage statistics summary table The resource usage information of each tenant determines the cost of each tenant according to the resource pricing table and the resource usage information of each tenant. It can realize hybrid billing for the resource usage of multiple cloud services, and realize hybrid billing for multi-partition and multi-cloud platforms.

本发明实施例还提供一种分析中心01,适用于云计算下对云服务的资源使用进行计费,如图13所示,所述分析中心01包括:The embodiment of the present invention also provides an analysis center 01, which is suitable for charging cloud service resource usage under cloud computing. As shown in FIG. 13, the analysis center 01 includes:

查询模块011,用于根据第一租户的标识查询所述第一租户对应的分区,并查询所述第一租户对应的每个分区中的与所述第一租户对应的可用区,得到所述第一租户对应的至少一个可用区;其中所述第一租户为所有租户中的任一个租户;The query module 011 is configured to query the partition corresponding to the first tenant according to the identifier of the first tenant, and query the availability zone corresponding to the first tenant in each partition corresponding to the first tenant, and obtain the At least one availability zone corresponding to the first tenant; wherein the first tenant is any one of all tenants;

所述查询模块011,还用于根据所述第一租户的标识查询所述第一租户对应的工程,得到所述第一租户对应的至少一个工程;The query module 011 is further configured to query the project corresponding to the first tenant according to the identifier of the first tenant, and obtain at least one project corresponding to the first tenant;

采集模块012,用于根据所述至少一个工程的标识在所述至少一个可用区下查询所述至少一个工程中每个工程所使用的资源的资源信息,得到所述第一租户所使用的至少一个资源的资源信息;The collection module 012 is configured to query resource information of resources used by each project in the at least one project in the at least one availability zone according to the identifier of the at least one project, and obtain at least one resource used by the first tenant. resource information for a resource;

分析模块013,用于根据所述至少一个资源的资源信息对每个资源的使用量进行统计,得到所述第一租户的资源使用信息;An analysis module 013, configured to count the usage of each resource according to the resource information of the at least one resource, and obtain the resource usage information of the first tenant;

所述分析模块013,还用于根据所述所有租户的资源使用信息生成资源使用统计总表;The analysis module 013 is further configured to generate a summary table of resource usage statistics according to the resource usage information of all tenants;

接口模块014,用于将所述资源使用统计总表发送至计费中心,以便计费中心根据所述资源使用统计总表获取每个租户的资源使用信息,并根据资源定价表以及每个租户的资源使用信息确定每个租户的费用。The interface module 014 is configured to send the resource usage statistics summary table to the billing center, so that the billing center can obtain the resource usage information of each tenant according to the resource usage statistics summary table, and according to the resource pricing table and each tenant resource usage information to determine the per-tenant charges.

可选的,所述至少一个资源的资源信息包括:所述至少一个资源的资源标识和资源类型;Optionally, the resource information of the at least one resource includes: a resource identifier and a resource type of the at least one resource;

其中,所述资源类型包括:实例,镜像,简单存储服务S3,弹性块存储EBS,弹性负载均衡ELB,以及流量中的一种。Wherein, the resource type includes: one of instance, image, simple storage service S3, elastic block storage EBS, elastic load balancing ELB, and traffic.

可选的,所述分析模块013可以具体用于:Optionally, the analysis module 013 can be specifically used for:

若所述至少一个资源中的任一资源的资源类型为实例,则根据所述任一资源的资源标识统计所述任一资源对应的虚拟机使用时长作为所述任一资源的使用量;If the resource type of any resource in the at least one resource is an instance, count the usage time of the virtual machine corresponding to the any resource as the usage amount of the any resource according to the resource identifier of the any resource;

若所述任一资源的资源类型为镜像,则根据所述任一资源的资源标识将所述任一资源所属实例对应的虚拟机使用时长作为所述任一资源的使用量;If the resource type of any resource is a mirror image, then according to the resource identifier of any resource, the usage time of the virtual machine corresponding to the instance to which any resource belongs is taken as the usage amount of any resource;

若所述任一资源的资源类型为EBS,则根据所述任一资源的资源标识统计所述任一资源的使用空间大小和使用时长作为所述任一资源的使用量;If the resource type of any resource is EBS, count the usage space size and usage duration of any resource as the usage amount of any resource according to the resource identifier of any resource;

若所述任一资源的资源类型为S3,则根据所述任一资源的资源标识统计所述任一资源的使用空间大小和使用时长作为所述任一资源的使用量;If the resource type of any resource is S3, count the usage space size and usage duration of any resource as the usage amount of any resource according to the resource identifier of any resource;

若所述任一资源的资源类型为ELB,则根据所述任一资源的资源标识统计所述任一资源的使用时长作为所述任一资源的使用量;If the resource type of any resource is ELB, count the usage time of any resource as the usage amount of any resource according to the resource identifier of any resource;

若所述任一资源的资源类型为流量,则将所述任一资源对应的根据所述任一资源的资源标识统计所述任一资源的流量值作为所述任一资源的使用量。If the resource type of the any resource is traffic, count the traffic value of the any resource corresponding to the any resource according to the resource identifier of the any resource as the usage amount of the any resource.

可选的,从所述查询模块根据第一租户的标识查询所述第一租户对应的分区以及每个所述分区中所述第一租户对应的可用区至所述接口模块将所述资源使用统计总表发送至计费中心为一个查询批次;Optionally, from the query module to query the partition corresponding to the first tenant and the availability zone corresponding to the first tenant in each partition according to the identifier of the first tenant to the interface module to use the resource The statistical summary table is sent to the billing center as a query batch;

在所述接口模块将所述资源使用统计总表发送至计费中心之后,间隔预设时长后执行下一个所述查询批次。After the interface module sends the resource usage statistics summary table to the billing center, the next query batch is executed after a preset period of time.

可选的,在所述资源使用统计总表中,每个资源对应一个条目;其中,任一资源对应的条目包括:租户标识、资源类型、资源标识、资源使用量、查询时间戳;Optionally, in the summary table of resource usage statistics, each resource corresponds to an entry; wherein, the entry corresponding to any resource includes: tenant ID, resource type, resource ID, resource usage, query timestamp;

其中,所述租户标识为使用所述任一资源的租户的标识,所述资源类型为所述任一资源的资源类型,所述资源标识为所述任一资源的资源标识,所述资源使用量为所述租户标识对应的租户使用所述任一资源的使用量,所述查询时间戳为查询所述资源使用量的时间点,其中,在同一查询批次中,每个资源对应的条目中的查询时间戳相同。Wherein, the tenant ID is the ID of the tenant using the any resource, the resource type is the resource type of the any resource, the resource ID is the resource ID of the any resource, and the resource uses The amount is the usage amount of any resource used by the tenant corresponding to the tenant ID, and the query timestamp is the time point when the resource usage amount is queried, wherein, in the same query batch, the entry corresponding to each resource The query timestamps in are the same.

本实施例用于实现上述各方法实施例,本实施例中各个单元的工作流程和工作原理参见上述各方法实施例中的描述,在此不再赘述。This embodiment is used to implement the above-mentioned method embodiments. For the workflow and working principle of each unit in this embodiment, refer to the descriptions in the above-mentioned method embodiments, and details are not repeated here.

本发明实施例提供一种分析中心,该分析中心根据租户的标识,查询每个租户对应的分区,并查询每个租户对应的每个分区中对应该租户的可用区,得到每个租户对应的至少一个可用区,还根据租户的标识查询每个租户对应的工程,从而在每个租户对应的至少一个可用区下查询该租户所使用的至少一个资源的资源信息,而后再对每个资源的使用量进行统计,最终得到每个租户的资源使用信息,生成资源使用统计总表,并将该资源使用统计总表发送给计费中心,该计费中心能够根据资源使用统计总表获取每个租户的资源使用信息,根据资源定价表以及每个租户的资源使用信息确定每个租户的费用。能够实现对多种云服务的资源使用进行混合计费,并实现对多分区多云平台进行混合计费。An embodiment of the present invention provides an analysis center. The analysis center queries the partition corresponding to each tenant according to the identifier of the tenant, and queries the available area corresponding to the tenant in each partition corresponding to each tenant, and obtains the corresponding partition of each tenant. At least one availability zone, and query the project corresponding to each tenant according to the identifier of the tenant, so as to query the resource information of at least one resource used by the tenant under at least one availability zone corresponding to each tenant, and then check the resource information of each resource The usage is counted, and finally the resource usage information of each tenant is obtained, the resource usage statistics summary table is generated, and the resource usage statistics summary table is sent to the billing center, which can obtain each tenant according to the resource usage statistics summary table The resource usage information of tenants, the cost of each tenant is determined according to the resource pricing table and the resource usage information of each tenant. It can realize hybrid billing for the resource usage of multiple cloud services, and realize hybrid billing for multi-partition and multi-cloud platforms.

本发明实施例提供一种计费中心02,适用于云计算下对云服务的资源使用进行计费,如图14所示,所述计费中心02包括:The embodiment of the present invention provides a billing center 02, which is suitable for billing cloud service resource usage under cloud computing. As shown in FIG. 14, the billing center 02 includes:

接口模块021,用于接收分析中心发送的资源使用统计总表;The interface module 021 is used to receive the statistical summary table of resource usage sent by the analysis center;

获取模块022,用于根据所述资源使用统计总表获取每个租户的资源使用信息;An acquisition module 022, configured to acquire resource usage information of each tenant according to the resource usage statistics table;

计费模块023,用于根据资源定价表以及每个租户的资源使用信息获取每个租户的费用;The billing module 023 is used to obtain the cost of each tenant according to the resource pricing table and the resource usage information of each tenant;

所述资源的资源类型包括:实例,镜像,S3,EBS,ELB,以及流量中的一种。The resource type of the resource includes: one of instance, image, S3, EBS, ELB, and traffic.

可选的,在所述资源使用统计总表中每个资源对应一个条目;其中,任一资源对应的条目包括:租户标识、资源类型、资源标识、资源使用量、查询时间戳;Optionally, each resource corresponds to an entry in the resource usage statistics summary table; wherein, the entry corresponding to any resource includes: tenant ID, resource type, resource ID, resource usage, query timestamp;

其中,所述租户标识为使用所述任一资源的租户的标识,所述资源类型为所述任一资源的资源类型,所述资源标识为所述任一资源的资源标识,所述资源使用量为所述租户标识对应的租户使用所述任一资源的使用量,所述查询时间戳为查询所述资源使用量的时间点,其中,在同一查询批次中,每个资源对应的条目中的查询时间戳相同。Wherein, the tenant ID is the ID of the tenant using the any resource, the resource type is the resource type of the any resource, the resource ID is the resource ID of the any resource, and the resource uses The amount is the usage amount of any resource used by the tenant corresponding to the tenant ID, and the query timestamp is the time point when the resource usage amount is queried, wherein, in the same query batch, the entry corresponding to each resource The query timestamps in are the same.

可选的,所述获取模块022可以具体用于:Optionally, the acquiring module 022 may be specifically used for:

根据所述资源使用统计总表中每个条目中的所述租户标识确定每条条目所属的租户;determining the tenant to which each entry belongs according to the tenant identifier in each entry in the resource usage statistics summary table;

根据每个租户的所有条目获取每个租户的资源使用信息,每个租户的资源使用信息包括每个租户所使用的每个资源的使用量。The resource usage information of each tenant is obtained according to all entries of each tenant, and the resource usage information of each tenant includes the usage amount of each resource used by each tenant.

可选的,如图15所示,所述计费模块023可以包括:Optionally, as shown in Figure 15, the billing module 023 may include:

单价查询模块0231,用于查询所述资源定价表获取每个租户所使用的每个资源的单位价格;A unit price query module 0231, configured to query the resource pricing table to obtain the unit price of each resource used by each tenant;

资源计费模块0232,用于按照每个租户所使用的每个资源的单位价格,根据每个租户所使用的每个资源的使用量以及预设的计费策略计算每个租户所使用的每个资源的费用;The resource billing module 0232 is configured to calculate the unit price of each resource used by each tenant according to the usage amount of each resource used by each tenant and the preset billing policy. the cost of a resource;

租户计费模块0233,用于根据每个租户所使用的每个资源的费用计算每个租户的总费用。The tenant billing module 0233 is configured to calculate the total cost of each tenant according to the cost of each resource used by each tenant.

可选的,每个租户所使用的每个资源的使用量包括:Optionally, the usage of each resource used by each tenant includes:

对于任一租户,若所述任一租户所使用的任一资源的资源类型为实例,则所述任一资源的使用量为所述任一资源对应的虚拟机使用时长;For any tenant, if the resource type of any resource used by the any tenant is an instance, the usage amount of the any resource is the usage time of the virtual machine corresponding to the any resource;

若所述任一租户所使用的任一资源的资源类型为镜像,则所述任一资源的使用量为所述任一资源所属实例对应的虚拟机使用时长;If the resource type of any resource used by any of the tenants is mirroring, the usage of any of the resources is the usage time of the virtual machine corresponding to the instance to which any of the resources belongs;

若所述任一租户所使用的任一资源的资源类型为弹性块存储EBS,则所述任一资源的使用量为所述任一资源的使用空间大小和使用时长;If the resource type of any resource used by any of the tenants is elastic block storage EBS, then the usage of any of the resources is the usage space and duration of usage of any of the resources;

若所述任一租户所使用的任一资源的资源类型为简单存储服务S3,则所述任一资源的使用量为所述任一资源的使用空间大小和使用时长;If the resource type of any resource used by any tenant is simple storage service S3, then the usage amount of any resource is the usage space size and usage duration of any resource;

若所述任一租户所使用的任一资源的资源类型为弹性负载均衡ELB,则所述任一资源的使用量为所述任一资源的使用时长;If the resource type of any resource used by any tenant is elastic load balancing ELB, the usage amount of any resource is the usage time of any resource;

若所述任一租户所使用的任一资源的资源类型为流量,则所述任一资源的使用量为所述任一资源的流量值。If the resource type of any resource used by any tenant is traffic, the usage amount of any resource is the traffic value of any resource.

可选的,所述预设的计费策略可以包括:Optionally, the preset charging policy may include:

若所述任一租户所使用的任一资源的资源类型为实例,则所述任一租户使用所述任一资源的费用为所述任一资源对应的虚拟机使用时长*所述任一资源的单位价格;If the resource type of any resource used by any of the tenants is an instance, the fee for any of the resources used by any of the tenants is the virtual machine usage time corresponding to the any of the resources * the time of use of the any of the resources unit price;

若所述任一租户所使用的任一资源的资源类型为镜像,则所述任一租户使用所述任一资源的费用为所述任一资源所属实例对应的虚拟机使用时长*所述任一资源的单位价格;If the resource type of any resource used by any of the tenants is mirror image, the cost for any of the resources used by any of the tenants is the usage time of the virtual machine corresponding to the instance to which any of the resources belongs * the duration of any of the resources the unit price of a resource;

若所述任一租户所使用的任一资源的资源类型为EBS,则所述任一租户使用所述任一资源的费用为所述任一资源的使用空间大小*使用时长*所述任一资源的单位价格;If the resource type of any resource used by any of the tenants is EBS, then the fee for any of the resources used by any of the tenants is the size of the space used by any of the resources * the duration of use * the the unit price of the resource;

若所述任一租户所使用的任一资源的资源类型为S3,则所述任一租户使用所述任一资源的费用为所述任一资源的使用空间大小*使用时长*所述任一资源的单位价格;If the resource type of any resource used by any of the tenants is S3, then the fee for any of the resources used by any of the tenants is the size of the space used by any of the resources * the duration of use * the the unit price of the resource;

若所述任一租户所使用的任一资源的资源类型为ELB,则所述任一租户使用所述任一资源的费用为所述任一资源的使用时长*所述任一资源的单位价格;If the resource type of any resource used by any tenant is ELB, the cost for any resource used by any tenant is the usage time of any resource * the unit price of any resource ;

若所述任一租户所使用的任一资源的资源类型为流量,则所述任一租户使用所述任一资源的费用为所述任一资源的流量值*所述任一资源的单位价格;If the resource type of any resource used by any of the tenants is traffic, then the cost for any of the resources used by any of the tenants is the traffic value of any of the resources * the unit price of any of the resources ;

其中,所述任一资源的单位价格是根据所述任一资源的资源价格、价格单位和度量单位确定的。Wherein, the unit price of any resource is determined according to the resource price, price unit and measurement unit of any resource.

可选的,如图16所示,所述计费中心02可以还包括:资源定价管理模块024;Optionally, as shown in FIG. 16, the billing center 02 may further include: a resource pricing management module 024;

所述接口模块,还用于从管理员设备接收管理员通过管理员界面触发的设定资源定价请求;所述设定资源定价请求为:设定价格请求、删除价格请求和查询价格请求中的一种;The interface module is further configured to receive a resource pricing request triggered by the administrator through the administrator interface from the administrator device; the resource pricing request is: a price setting request, a price deletion request, and a price query request A sort of;

所述资源定价管理模块,用于根据所述设定资源定价请求对所述资源定价表执行对应的设定资源定价操作;The resource pricing management module is configured to perform a corresponding resource pricing setting operation on the resource pricing table according to the resource pricing setting request;

所述接口模块还用于向所述管理员设备返回设定资源定价响应。The interface module is further configured to return a setting resource pricing response to the administrator device.

可选的,所述设定价格请求包括:请求设定价格的资源的资源标识、资源类型、资源价格、所属区域、价格单位和度量单位;Optionally, the price setting request includes: the resource identifier, resource type, resource price, region to which the price is requested, the price unit, and the measurement unit of the resource for which price setting is requested;

若所述设定资源定价请求为所述新增价格请求,则所述资源定价管理模块024可以具体用于:If the resource pricing request is the new price request, the resource pricing management module 024 can be specifically used for:

判断所述资源定价表中是否存在与所述资源标识、所述资源类型和所述所属区域对应的价格条目;judging whether there is a price entry corresponding to the resource identifier, the resource type, and the region in the resource pricing table;

若不存在所述价格条目,则创建所述价格条目,所述价格条目中包括所述资源标识、所述资源类型、所述资源价格、所述所属区域、所述价格单位、所述度量单位和生效时间;If the price entry does not exist, create the price entry, and the price entry includes the resource identifier, the resource type, the resource price, the region to which it belongs, the price unit, and the measurement unit and effective time;

若存在所述价格条目,则根据所述资源价格对所述价格条目中的资源价格进行修改;If the price entry exists, modify the resource price in the price entry according to the resource price;

若所述设定资源定价请求为所述设定价格请求,所述设定资源定价响应包括:操作成功消息。If the resource pricing request is the price setting request, the resource pricing response includes: an operation success message.

可选的,所述删除价格请求包括:请求删除价格的资源的资源标识、资源类型和所属区域;Optionally, the price deletion request includes: the resource identifier, resource type, and region of the resource requesting price deletion;

若所述设定资源定价请求为所述删除价格请求,则所述资源定价管理模块024可以具体用于:If the resource pricing request is the deletion price request, the resource pricing management module 024 can be specifically used for:

在所述资源定价表查找到与所述资源标识、所述资源类型和所述所属区域对应的价格条目;Finding a price entry corresponding to the resource identifier, the resource type, and the region to which it belongs in the resource pricing table;

在所述价格条目中将删除位标记为删除对应的数值;mark the delete bit as delete the corresponding value in said price entry;

若所述设定资源定价请求为所述删除价格请求,所述设定资源定价响应包括:操作成功消息。If the resource pricing request is the deletion price request, the resource pricing response includes: an operation success message.

可选的,所述查询价格请求包括:请求查询价格的资源的资源标识、资源类型和所属区域;Optionally, the price query request includes: the resource identifier, resource type, and region of the resource requesting price query;

若所述设定资源定价请求为所述查询价格请求,则所述资源定价管理模块024可以具体用于:If the resource pricing request is the query price request, the resource pricing management module 024 can be specifically used to:

在所述资源定价表查找到与所述资源标识、所述资源类型和所述所属区域对应的价格条目;Finding a price entry corresponding to the resource identifier, the resource type, and the region to which it belongs in the resource pricing table;

获取所述价格条目中的资源价格、价格单位、度量单位、生效时间、度量单位和生效时间;Obtain the resource price, price unit, measurement unit, effective time, measurement unit and effective time in the price entry;

若所述设定资源定价请求为所述查询价格请求,所述设定资源定价响应包括:所述资源标识、所述资源类型、所述资源价格、所述价格单位、所述度量单位和所述生效时间。If the resource pricing request is the query price request, the resource pricing response includes: the resource identifier, the resource type, the resource price, the price unit, the measurement unit, and the stated effective time.

可选的,所述查询价格请求包括:请求查询价格的资源的资源类型和所属区域;Optionally, the price query request includes: the resource type and region of the resource requesting the price query;

若所述设定资源定价请求为所述查询价格请求,则所述资源定价管理模块024可以具体用于:If the resource pricing request is the query price request, the resource pricing management module 024 can be specifically used to:

在所述资源定价表查找到与所述资源类型和所述所属区域对应的所有资源的价格条目;Finding price entries of all resources corresponding to the resource type and the region in the resource pricing table;

获取所述所有资源的价格条目中的资源价格、价格单位、度量单位、生效时间、度量单位和生效时间;Obtain the resource price, price unit, measurement unit, effective time, measurement unit, and effective time in the price entries of all resources;

若所述设定资源定价请求为所述查询价格请求,所述设定资源定价响应包括:所述所有资源中每个资源的资源标识、资源类型、资源价格、价格单位、度量单位和生效时间。If the resource pricing request is the query price request, the resource pricing response includes: resource identifier, resource type, resource price, price unit, measurement unit and effective time of each resource in all resources .

可选的,如图17所示,所述计费中心02可以还包括:Optionally, as shown in Figure 17, the billing center 02 may further include:

记录管理模块025,用于在设定资源定价操作历史记录表中添加与所述设定资源定价操作对应的历史记录条目;所述历史记录条目包括:被操作的资源的资源类型、资源标识、所属区域、操作人员、操作时间和所述设定资源定价操作的描述信息。The record management module 025 is configured to add a history entry corresponding to the resource pricing operation in the resource pricing operation history table; the history entry includes: the resource type of the resource being operated, the resource identifier, The area to which it belongs, the operator, the operation time, and the description information of the operation of setting resource pricing.

可选的,如图18所示,所述计费中心02可以还包括:查询模块026;Optionally, as shown in FIG. 18, the billing center 02 may further include: a query module 026;

所述接口模块021还用于从管理员设备接收管理员通过管理员费用查询界面触发的费用查询请求,所述费用查询请求中包括所述管理员指定的租户的租户标识,以及所述管理员指定的查询时间;The interface module 021 is further configured to receive, from the administrator device, a fee query request triggered by the administrator through the administrator fee query interface, the fee query request including the tenant identifier of the tenant specified by the administrator, and the administrator's fee query request. specified query time;

所述查询模块026用于根据所述租户标识和所述查询时间查询所述指定的租户在所述查询时间内的费用信息;The query module 026 is used to query the fee information of the specified tenant within the query time according to the tenant identifier and the query time;

所述接口模块021还用于向所述管理员设备返回携带所述费用信息的费用查询响应,所述费用信息包括:实例使用费、EBS使用费、S3使用费、ELB使用费、流量使用费和总费用,以及所述实例使用费占所述租户的费用总限额的百分比、所述EBS使用费占所述费用总限额的百分比、所述S3使用费占所述费用总限额的百分比、所述ELB使用费占所述费用总限额的百分比、所述流量使用费用占所述费用总限额的百分比以及所述总费用占所述费用总限额的百分比;The interface module 021 is further configured to return a fee query response carrying the fee information to the administrator device, and the fee information includes: instance usage fee, EBS usage fee, S3 usage fee, ELB usage fee, traffic usage fee and the total fee, and the percentage of the instance usage fee in the total fee limit of the tenant, the percentage of the EBS usage fee in the total fee limit, the percentage of the S3 usage fee in the total fee limit, the The percentage of the ELB usage fee to the total fee limit, the percentage of the traffic usage fee to the total fee limit, and the percentage of the total fee to the total fee limit;

或者,or,

所述接口模块021还用于从租户设备接收租户通过租户费用查询界面触发的费用查询请求,所述费用查询请求中包括所述租户的租户标识,以及所述租户指定的查询时间;The interface module 021 is further configured to receive a fee query request triggered by the tenant through the tenant fee query interface from the tenant device, the fee query request including the tenant ID of the tenant and the query time specified by the tenant;

所述查询模块026用于根据所述租户标识和所述查询时间查询所述租户在所述查询时间内的费用信息;The query module 026 is used to query the cost information of the tenant within the query time according to the tenant identifier and the query time;

所述接口模块021还用于向所述租户设备返回携带所述费用信息的费用查询响应,所述费用信息包括:实例使用费、EBS使用费、S3使用费、ELB使用费、流量使用费和总费用,以及所述实例使用费占所述租户的费用总限额的百分比、所述EBS使用费占所述费用总限额的百分比、所述S3使用费占所述费用总限额的百分比、所述ELB使用费占所述费用总限额的百分比、所述流量使用费用占所述费用总限额的百分比以及所述总费用占所述费用总限额的百分比。The interface module 021 is further configured to return a fee query response carrying the fee information to the tenant device, and the fee information includes: instance usage fee, EBS usage fee, S3 usage fee, ELB usage fee, traffic usage fee, and The total fee, and the percentage of the instance usage fee to the total fee limit of the tenant, the percentage of the EBS usage fee to the total fee limit, the percentage of the S3 usage fee to the total fee limit, the The percentage of the ELB usage fee to the total fee limit, the percentage of the traffic usage fee to the total fee limit, and the percentage of the total fee to the total fee limit.

可选的,如图19所示,所述计费中心02可以还包括:Optionally, as shown in Figure 19, the billing center 02 may further include:

告警模块027,用于在获取每个租户的费用之后,根据每个租户的费用占该租户的费用总限额的百分比,以及每个租户的费用百分比软限额、费用百分比硬限额,判断是否对该租户进行费用告警以及告警级别;所述费用百分比硬限额大于所述费用百分比软限额;The alarm module 027 is used to determine whether the fee for each tenant is determined based on the percentage of each tenant's fee in the tenant's total fee limit, and the fee percentage soft limit and fee percentage hard limit of each tenant after obtaining the fee for each tenant. The tenant issues a fee alarm and the alarm level; the hard limit of the fee percentage is greater than the soft limit of the fee percentage;

其中,对于任一租户,若所述任一租户的费用超过所述费用百分比软限额,未超过所述费用百分比硬限额,则对所述任一租户进行告警,告警级别为重要告警;Wherein, for any tenant, if the fee of any tenant exceeds the soft limit of the fee percentage but does not exceed the hard limit of the fee percentage, an alarm is issued to the any tenant, and the alarm level is an important alarm;

若所述任一租户的费用超过所述费用百分比硬限额,则对所述任一租户进行告警,告警级别为紧急告警;If the fee of any one of the tenants exceeds the hard limit of the fee percentage, then give an alarm to any one of the tenants, and the alarm level is an emergency alarm;

若所述任一租户的费用未超过所述费用百分比软限额,则不进行告警。If the fee of any one of the tenants does not exceed the soft limit of the fee percentage, no alarm is issued.

可选的,如图20所示,所述计费中心02可以还包括:价格调整模块028,所述价格调整模块028可以用于:Optionally, as shown in FIG. 20, the billing center 02 may further include: a price adjustment module 028, and the price adjustment module 028 may be used for:

获取所述分析中心统计的每类资源的使用率;Obtain the utilization rate of each type of resource counted by the analysis center;

根据每类资源的使用率,以及预设的每类资源的使用率对应的价格调整策略对该类资源的资源价格进行调整。The resource price of this type of resource is adjusted according to the usage rate of each type of resource and the preset price adjustment strategy corresponding to the usage rate of each type of resource.

本实施例用于实现上述各方法实施例,本实施例中各个单元的工作流程和工作原理参见上述各方法实施例中的描述,在此不再赘述。This embodiment is used to implement the above-mentioned method embodiments. For the workflow and working principle of each unit in this embodiment, refer to the descriptions in the above-mentioned method embodiments, and details are not repeated here.

本发明实施例提供一种计费中心,首先由分析中心根据租户的标识,查询每个租户对应的分区,并查询每个租户对应的每个分区中的对应该租户的可用区,得到每个租户对应的至少一个可用区,还根据租户的标识查询每个租户对应的工程,从而在每个租户对应的至少一个可用区下查询该租户所使用的至少一个资源的资源信息,而后再对每个资源的使用量进行统计,最终得到每个租户的资源使用信息,生成资源使用统计总表,并将该资源使用统计总表发送给计费中心,该计费中心能够根据资源使用统计总表获取每个租户的资源使用信息,根据资源定价表以及每个租户的资源使用信息确定每个租户的费用。能够实现对多种云服务的资源使用进行混合计费,并实现对多分区多云平台进行混合计费。An embodiment of the present invention provides a billing center. First, the analysis center queries the partition corresponding to each tenant according to the identifier of the tenant, and queries the available area corresponding to the tenant in each partition corresponding to each tenant, and obtains each At least one availability zone corresponding to the tenant, and query the project corresponding to each tenant according to the identifier of the tenant, so as to query the resource information of at least one resource used by the tenant under at least one availability zone corresponding to each tenant, and then query each Statistics on the usage of each resource, and finally obtain the resource usage information of each tenant, generate a resource usage statistics summary table, and send the resource usage statistics summary table to the billing center, which can be based on the resource usage statistics summary table. Obtain the resource usage information of each tenant, and determine the cost of each tenant according to the resource pricing table and the resource usage information of each tenant. It can realize hybrid billing for the resource usage of multiple cloud services, and realize hybrid billing for multi-partition and multi-cloud platforms.

本发明实施例还提供另一种分析中心03,适用于云计算下对云服务的资源使用进行计费,如图21所示,所述分析中心03包括:处理器031、存储器032、接口033,处理器031、存储器032和接口033通过总线034连接,其中接口033用于与其他网元交互,存储器032用于存储计算机程序0321,处理器031用于执行计算机程序0321,处理器031执行计算机程序0321用于:The embodiment of the present invention also provides another analysis center 03, which is suitable for charging cloud service resource usage under cloud computing. As shown in FIG. 21, the analysis center 03 includes: a processor 031, a memory 032, and an interface 033 , the processor 031, the memory 032 and the interface 033 are connected through the bus 034, wherein the interface 033 is used to interact with other network elements, the memory 032 is used to store the computer program 0321, the processor 031 is used to execute the computer program 0321, and the processor 031 executes the computer Procedure 0321 is used to:

根据第一租户的标识查询所述第一租户对应的分区,并查询所述第一租户对应的每个分区中的与所述第一租户对应的可用区,得到所述第一租户对应的至少一个可用区;其中所述第一租户为所有租户中的任一个租户;Query the partition corresponding to the first tenant according to the identifier of the first tenant, and query the availability zone corresponding to the first tenant in each partition corresponding to the first tenant, and obtain at least An availability zone; wherein the first tenant is any one of all tenants;

根据所述第一租户的标识查询所述第一租户对应的工程,得到所述第一租户对应的至少一个工程;Querying the project corresponding to the first tenant according to the identifier of the first tenant to obtain at least one project corresponding to the first tenant;

根据所述至少一个工程的标识在所述至少一个可用区下查询所述至少一个工程中每个工程所使用的资源的资源信息,得到所述第一租户所使用的至少一个资源的资源信息;Query resource information of resources used by each project in the at least one project in the at least one availability zone according to the identifier of the at least one project, and obtain resource information of at least one resource used by the first tenant;

根据所述至少一个资源的资源信息对每个资源的使用量进行统计,得到所述第一租户的资源使用信息;Counting the usage of each resource according to the resource information of the at least one resource to obtain the resource usage information of the first tenant;

根据所述所有租户的资源使用信息生成资源使用统计总表;Generate a resource usage statistics summary table according to the resource usage information of all tenants;

将所述资源使用统计总表发送至计费中心,以便计费中心根据所述资源使用统计总表获取每个租户的资源使用信息,并根据资源定价表以及每个租户的资源使用信息确定每个租户的费用。Send the resource usage statistics summary table to the billing center, so that the billing center can obtain the resource usage information of each tenant according to the resource usage statistics summary table, and determine the resource usage information of each tenant according to the resource pricing table and the resource usage information of each tenant. tenant's fees.

可选的,所述至少一个资源的资源信息包括:所述至少一个资源的资源标识和资源类型;Optionally, the resource information of the at least one resource includes: a resource identifier and a resource type of the at least one resource;

其中,所述资源类型包括:实例,镜像,S3,EBS,ELB,以及流量中的一种。Wherein, the resource type includes: one of instance, image, S3, EBS, ELB, and traffic.

可选的,处理器031执行计算机程序0321可以具体用于:Optionally, the execution of the computer program 0321 by the processor 031 may be specifically used for:

若所述至少一个资源中的任一资源的资源类型为实例,则根据所述任一资源的资源标识统计所述任一资源对应的虚拟机使用时长作为所述任一资源的使用量;If the resource type of any resource in the at least one resource is an instance, count the usage time of the virtual machine corresponding to the any resource as the usage amount of the any resource according to the resource identifier of the any resource;

若所述任一资源的资源类型为镜像,则根据所述任一资源的资源标识将所述任一资源所属实例对应的虚拟机使用时长作为所述任一资源的使用量;If the resource type of any resource is a mirror image, then according to the resource identifier of any resource, the usage time of the virtual machine corresponding to the instance to which any resource belongs is taken as the usage amount of any resource;

若所述任一资源的资源类型为EBS,则根据所述任一资源的资源标识统计所述任一资源的使用空间大小和使用时长作为所述任一资源的使用量;If the resource type of any resource is EBS, count the usage space size and usage duration of any resource as the usage amount of any resource according to the resource identifier of any resource;

若所述任一资源的资源类型为S3,则根据所述任一资源的资源标识统计所述任一资源的使用空间大小和使用时长作为所述任一资源的使用量;If the resource type of any resource is S3, count the usage space size and usage duration of any resource as the usage amount of any resource according to the resource identifier of any resource;

若所述任一资源的资源类型为ELB,则根据所述任一资源的资源标识统计所述任一资源的使用时长作为所述任一资源的使用量;If the resource type of any resource is ELB, count the usage time of any resource as the usage amount of any resource according to the resource identifier of any resource;

若所述任一资源的资源类型为流量,则将所述任一资源对应的根据所述任一资源的资源标识统计所述任一资源的流量值作为所述任一资源的使用量。If the resource type of the any resource is traffic, count the traffic value of the any resource corresponding to the any resource according to the resource identifier of the any resource as the usage amount of the any resource.

可选的,所述根据第一租户的标识查询所述第一租户对应的分区以及每个所述分区中所述第一租户对应的可用区至所述将所述资源使用统计总表发送至计费中心为一个查询批次;Optionally, the querying the partition corresponding to the first tenant and the availability zone corresponding to the first tenant in each partition according to the identifier of the first tenant to the sending the resource usage statistics summary table to The billing center is a query batch;

在所述将所述资源使用统计总表发送至计费中心之后,间隔预设时长后执行下一个查询批次。After the resource usage statistics summary table is sent to the billing center, the next query batch is executed after a preset period of time.

可选的,在所述资源使用统计总表中,每个资源对应一个条目;其中,任一资源对应的条目包括:租户标识、资源类型、资源标识、资源使用量、查询时间戳;Optionally, in the summary table of resource usage statistics, each resource corresponds to an entry; wherein, the entry corresponding to any resource includes: tenant ID, resource type, resource ID, resource usage, query timestamp;

其中,所述租户标识为使用所述任一资源的租户的标识,所述资源类型为所述任一资源的资源类型,所述资源标识为所述任一资源的资源标识,所述资源使用量为所述租户标识对应的租户使用所述任一资源的使用量,所述查询时间戳为查询所述资源使用量的时间点,其中,在同一查询批次中,每个资源对应的条目中的查询时间戳相同。Wherein, the tenant ID is the ID of the tenant using the any resource, the resource type is the resource type of the any resource, the resource ID is the resource ID of the any resource, and the resource uses The amount is the usage amount of any resource used by the tenant corresponding to the tenant ID, and the query timestamp is the time point when the resource usage amount is queried, wherein, in the same query batch, the entry corresponding to each resource The query timestamps in are the same.

本实施例用于实现上述各方法实施例,本实施例中各个单元的工作流程和工作原理参见上述各方法实施例中的描述,在此不再赘述。This embodiment is used to implement the above-mentioned method embodiments. For the workflow and working principle of each unit in this embodiment, refer to the descriptions in the above-mentioned method embodiments, and details are not repeated here.

本发明实施例提供一种分析中心,该分析中心根据租户的标识,查询每个租户对应的分区,并查询每个租户对应的每个分区中的对应该租户的可用区,得到每个租户对应的至少一个可用区,还根据租户的标识查询每个租户对应的工程,从而在每个租户对应的至少一个可用区下查询该租户所使用的至少一个资源的资源信息,而后再对每个资源的使用量进行统计,最终得到每个租户的资源使用信息,生成资源使用统计总表,并将该资源使用统计总表发送给计费中心,该计费中心能够根据资源使用统计总表获取每个租户的资源使用信息,根据资源定价表以及每个租户的资源使用信息确定每个租户的费用。能够实现对多种云服务的资源使用进行混合计费,并实现对多分区多云平台进行混合计费。An embodiment of the present invention provides an analysis center. The analysis center queries the partition corresponding to each tenant according to the identifier of the tenant, and queries the available area corresponding to the tenant in each partition corresponding to each tenant, and obtains the information corresponding to each tenant. At least one availability zone of each tenant, and also query the project corresponding to each tenant according to the tenant's identifier, so as to query the resource information of at least one resource used by the tenant under at least one availability zone corresponding to each tenant, and then query each resource Statistics on the usage of each tenant, and finally obtain the resource usage information of each tenant, generate a resource usage statistics summary table, and send the resource usage statistics summary table to the billing center, the billing center can obtain each tenant according to the resource usage statistics table According to the resource usage information of each tenant, the cost of each tenant is determined according to the resource pricing table and the resource usage information of each tenant. It can realize hybrid billing for the resource usage of multiple cloud services, and realize hybrid billing for multi-partition and multi-cloud platforms.

本发明实施例提供一种计费中心04,适用于云计算下对云服务的资源使用进行计费,如图22所示,所述计费中心04包括:处理器041、存储器042、接口043,处理器041、存储器042和接口043通过总线044连接,其中接口043用于与其他网元交互,存储器042用于存储计算机程序0421,处理器041用于执行计算机程序0421,处理器041执行计算机程序0421用于:The embodiment of the present invention provides a billing center 04, which is suitable for billing cloud service resource usage under cloud computing. As shown in FIG. 22, the billing center 04 includes: a processor 041, a memory 042, and an interface 043 , the processor 041, the memory 042 and the interface 043 are connected through the bus 044, wherein the interface 043 is used to interact with other network elements, the memory 042 is used to store the computer program 0421, the processor 041 is used to execute the computer program 0421, and the processor 041 executes the computer Procedure 0421 is used to:

接收分析中心发送的资源使用统计总表;Receive the summary table of resource usage statistics sent by the analysis center;

根据所述资源使用统计总表获取每个租户的资源使用信息;Obtain resource usage information of each tenant according to the resource usage statistics table;

根据资源定价表以及每个租户的资源使用信息获取每个租户的费用;Obtain the cost of each tenant according to the resource pricing table and the resource usage information of each tenant;

所述资源的资源类型包括:实例,镜像,S3,EBS,ELB,以及流量中的一种。The resource type of the resource includes: one of instance, image, S3, EBS, ELB, and traffic.

可选的,在所述资源使用统计总表中每个资源对应一个条目;其中,任一资源对应的条目包括:租户标识、资源类型、资源标识、资源使用量、查询时间戳;Optionally, each resource corresponds to an entry in the resource usage statistics summary table; wherein, the entry corresponding to any resource includes: tenant ID, resource type, resource ID, resource usage, query timestamp;

其中,所述租户标识为使用所述任一资源的租户的标识,所述资源类型为所述任一资源的资源类型,所述资源标识为所述任一资源的资源标识,所述资源使用量为所述租户标识对应的租户使用所述任一资源的使用量,所述查询时间戳为查询所述资源使用量的时间点,其中,在同一查询批次中,每个资源对应的条目中的查询时间戳相同。Wherein, the tenant ID is the ID of the tenant using the any resource, the resource type is the resource type of the any resource, the resource ID is the resource ID of the any resource, and the resource uses The amount is the usage amount of any resource used by the tenant corresponding to the tenant ID, and the query timestamp is the time point when the resource usage amount is queried, wherein, in the same query batch, the entry corresponding to each resource The query timestamps in are the same.

可选的,处理器041执行计算机程序0421可以具体用于:Optionally, the processor 041 executing the computer program 0421 may be specifically used for:

根据所述资源使用统计总表中每个条目中的所述租户标识确定每条条目所属的租户;determining the tenant to which each entry belongs according to the tenant identifier in each entry in the resource usage statistics summary table;

根据每个租户的所有条目获取每个租户的资源使用信息,每个租户的资源使用信息包括每个租户所使用的每个资源的使用量。The resource usage information of each tenant is obtained according to all entries of each tenant, and the resource usage information of each tenant includes the usage amount of each resource used by each tenant.

可选的,处理器041执行计算机程序0421可以具体用于:Optionally, the processor 041 executing the computer program 0421 may be specifically used for:

查询所述资源定价表获取每个租户所使用的每个资源的单位价格;Query the resource pricing table to obtain the unit price of each resource used by each tenant;

按照每个租户所使用的每个资源的单位价格,根据每个租户所使用的每个资源的使用量以及预设的计费策略计算每个租户所使用的每个资源的费用;According to the unit price of each resource used by each tenant, calculate the cost of each resource used by each tenant according to the usage of each resource used by each tenant and the preset billing policy;

根据每个租户所使用的每个资源的费用计算每个租户的总费用。Calculates the total cost per tenant based on the cost per resource used by each tenant.

可选的,每个租户所使用的每个资源的使用量包括:Optionally, the usage of each resource used by each tenant includes:

对于任一租户,若所述任一租户所使用的任一资源的资源类型为实例,则所述任一资源的使用量为所述任一资源对应的虚拟机使用时长;For any tenant, if the resource type of any resource used by the any tenant is an instance, the usage amount of the any resource is the usage time of the virtual machine corresponding to the any resource;

若所述任一租户所使用的任一资源的资源类型为镜像,则所述任一资源的使用量为所述任一资源所属实例对应的虚拟机使用时长;If the resource type of any resource used by any of the tenants is mirroring, the usage of any of the resources is the usage time of the virtual machine corresponding to the instance to which any of the resources belongs;

若所述任一租户所使用的任一资源的资源类型为弹性块存储EBS,则所述任一资源的使用量为所述任一资源的使用空间大小和使用时长;If the resource type of any resource used by any of the tenants is elastic block storage EBS, then the usage of any of the resources is the usage space and duration of usage of any of the resources;

若所述任一租户所使用的任一资源的资源类型为简单存储服务S3,则所述任一资源的使用量为所述任一资源的使用空间大小和使用时长;If the resource type of any resource used by any tenant is simple storage service S3, then the usage amount of any resource is the usage space size and usage duration of any resource;

若所述任一租户所使用的任一资源的资源类型为弹性负载均衡ELB,则所述任一资源的使用量为所述任一资源的使用时长;If the resource type of any resource used by any tenant is elastic load balancing ELB, the usage amount of any resource is the usage time of any resource;

若所述任一租户所使用的任一资源的资源类型为流量,则所述任一资源的使用量为所述任一资源的流量值。If the resource type of any resource used by any tenant is traffic, the usage amount of any resource is the traffic value of any resource.

可选的,所述预设的计费策略包括:Optionally, the preset charging policy includes:

若所述任一租户所使用的任一资源的资源类型为实例,则所述任一租户使用所述任一资源的费用为所述任一资源对应的虚拟机使用时长*所述任一资源的单位价格;If the resource type of any resource used by any of the tenants is an instance, the fee for any of the resources used by any of the tenants is the virtual machine usage time corresponding to the any of the resources * the time of use of the any of the resources unit price;

若所述任一租户所使用的任一资源的资源类型为镜像,则所述任一租户使用所述任一资源的费用为所述任一资源所属实例对应的虚拟机使用时长*所述任一资源的单位价格;If the resource type of any resource used by any of the tenants is mirror image, the cost for any of the resources used by any of the tenants is the usage time of the virtual machine corresponding to the instance to which any of the resources belongs * the duration of any of the resources the unit price of a resource;

若所述任一租户所使用的任一资源的资源类型为EBS,则所述任一租户使用所述任一资源的费用为所述任一资源的使用空间大小*使用时长*所述任一资源的单位价格;If the resource type of any resource used by any of the tenants is EBS, then the fee for any of the resources used by any of the tenants is the size of the space used by any of the resources * the duration of use * the the unit price of the resource;

若所述任一租户所使用的任一资源的资源类型为S3,则所述任一租户使用所述任一资源的费用为所述任一资源的使用空间大小*使用时长*所述任一资源的单位价格;If the resource type of any resource used by any of the tenants is S3, then the fee for any of the resources used by any of the tenants is the size of the space used by any of the resources * the duration of use * the the unit price of the resource;

若所述任一租户所使用的任一资源的资源类型为ELB,则所述任一租户使用所述任一资源的费用为所述任一资源的使用时长*所述任一资源的单位价格;If the resource type of any resource used by any tenant is ELB, the cost for any resource used by any tenant is the usage time of any resource * the unit price of any resource ;

若所述任一租户所使用的任一资源的资源类型为流量,则所述任一租户使用所述任一资源的费用为所述任一资源的流量值*所述任一资源的单位价格;If the resource type of any resource used by any of the tenants is traffic, then the cost for any of the resources used by any of the tenants is the traffic value of any of the resources * the unit price of any of the resources ;

其中,所述任一资源的单位价格是根据所述任一资源的资源价格、价格单位和度量单位确定的。Wherein, the unit price of any resource is determined according to the resource price, price unit and measurement unit of any resource.

可选的,可选的,处理器041执行计算机程序0421可以还用于:Optionally, optionally, the processor 041 executing the computer program 0421 may also be used for:

从管理员设备接收管理员通过管理员界面触发的设定资源定价请求;所述设定资源定价请求为:设定价格请求、删除价格请求和查询价格请求中的一种;Receive a resource pricing request triggered by the administrator through the administrator interface from the administrator device; the resource pricing request is: one of a price setting request, a price deletion request, and a price query request;

根据所述设定资源定价请求对所述资源定价表执行对应的设定资源定价操作;Execute a corresponding operation of setting resource pricing on the resource pricing table according to the request for setting resource pricing;

向所述管理员设备返回设定资源定价响应。A set resource pricing response is returned to the administrator device.

可选的,所述设定价格请求包括:请求设定价格的资源的资源标识、资源类型、资源价格、所属区域、价格单位和度量单位;Optionally, the price setting request includes: the resource identifier, resource type, resource price, region to which the price is requested, the price unit, and the measurement unit of the resource for which price setting is requested;

若所述设定资源定价请求为所述新增价格请求,则处理器041执行计算机程序0421可以具体用于:If the resource pricing request is the new price request, the processor 041 executing the computer program 0421 may be specifically used for:

判断所述资源定价表中是否存在与所述资源标识、所述资源类型和所述所属区域对应的价格条目;judging whether there is a price entry corresponding to the resource identifier, the resource type, and the region in the resource pricing table;

若不存在所述价格条目,则创建所述价格条目,所述价格条目中包括所述资源标识、所述资源类型、所述资源价格、所述所属区域、所述价格单位、所述度量单位和生效时间;If the price entry does not exist, create the price entry, and the price entry includes the resource identifier, the resource type, the resource price, the region to which it belongs, the price unit, and the measurement unit and effective time;

若存在所述价格条目,则根据所述资源价格对所述价格条目中的资源价格进行修改;If the price entry exists, modify the resource price in the price entry according to the resource price;

若所述设定资源定价请求为所述设定价格请求,所述设定资源定价响应包括:操作成功消息。If the resource pricing request is the price setting request, the resource pricing response includes: an operation success message.

可选的,所述删除价格请求包括:请求删除价格的资源的资源标识、资源类型和所属区域;Optionally, the price deletion request includes: the resource identifier, resource type, and region of the resource requesting price deletion;

若所述设定资源定价请求为所述删除价格请求,则处理器041执行计算机程序0421可以具体用于:If the resource pricing request is the deletion price request, the processor 041 executing the computer program 0421 may be specifically used to:

在所述资源定价表查找到与所述资源标识、所述资源类型和所述所属区域对应的价格条目;Finding a price entry corresponding to the resource identifier, the resource type, and the region to which it belongs in the resource pricing table;

在所述价格条目中将删除位标记为删除对应的数值;mark the delete bit as delete the corresponding value in said price entry;

若所述设定资源定价请求为所述删除价格请求,所述设定资源定价响应包括:操作成功消息。If the resource pricing request is the deletion price request, the resource pricing response includes: an operation success message.

可选的,所述查询价格请求包括:请求查询价格的资源的资源标识、资源类型和所属区域;Optionally, the price query request includes: the resource identifier, resource type, and region of the resource requesting price query;

若所述设定资源定价请求为所述查询价格请求,则处理器041执行计算机程序0421可以具体用于:If the resource pricing request is the query price request, the processor 041 executing the computer program 0421 may be specifically used for:

在所述资源定价表查找到与所述资源标识、所述资源类型和所述所属区域对应的价格条目;Finding a price entry corresponding to the resource identifier, the resource type, and the region to which it belongs in the resource pricing table;

获取所述价格条目中的资源价格、价格单位、度量单位、生效时间、度量单位和生效时间;Obtain the resource price, price unit, measurement unit, effective time, measurement unit and effective time in the price entry;

若所述设定资源定价请求为所述查询价格请求,所述设定资源定价响应包括:所述资源标识、所述资源类型、所述资源价格、所述价格单位、所述度量单位和所述生效时间。If the resource pricing request is the query price request, the resource pricing response includes: the resource identifier, the resource type, the resource price, the price unit, the measurement unit, and the stated effective time.

可选的,所述查询价格请求包括:请求查询价格的资源的资源类型和所属区域;Optionally, the price query request includes: the resource type and region of the resource requesting the price query;

若所述设定资源定价请求为所述查询价格请求,则处理器041执行计算机程序0421可以具体用于:If the resource pricing request is the query price request, the processor 041 executing the computer program 0421 may be specifically used for:

在所述资源定价表查找到与所述资源类型和所述所属区域对应的所有资源的价格条目;Finding price entries of all resources corresponding to the resource type and the region in the resource pricing table;

获取所述所有资源的价格条目中的资源价格、价格单位、度量单位、生效时间、度量单位和生效时间;Obtain the resource price, price unit, measurement unit, effective time, measurement unit, and effective time in the price entries of all resources;

若所述设定资源定价请求为所述查询价格请求,所述设定资源定价响应包括:所述所有资源中每个资源的资源标识、资源类型、资源价格、价格单位、度量单位和生效时间。If the resource pricing request is the query price request, the resource pricing response includes: resource identifier, resource type, resource price, price unit, measurement unit and effective time of each resource in all resources .

可选的,处理器041执行计算机程序0421可以还用于:Optionally, the processor 041 executing the computer program 0421 may also be used for:

在设定资源定价操作历史记录表中添加与所述设定资源定价操作对应的历史记录条目;所述历史记录条目包括:被操作的资源的资源类型、资源标识、所属区域、操作人员、操作时间和所述设定资源定价操作的描述信息。Add a history entry corresponding to the operation of setting resource pricing in the resource pricing operation history table; the history entry includes: the resource type, resource identifier, region, operator, and operation of the resource being operated The time and description information of the set resource pricing operation.

可选的,处理器041执行计算机程序0421可以还用于:Optionally, the processor 041 executing the computer program 0421 may also be used for:

从管理员设备接收管理员通过管理员费用查询界面触发的费用查询请求,所述费用查询请求中包括所述管理员指定的租户的租户标识,以及所述管理员指定的查询时间;receiving a fee query request triggered by the administrator through the administrator fee query interface from the administrator device, the fee query request including the tenant identifier of the tenant specified by the administrator, and the query time specified by the administrator;

根据所述租户标识和所述查询时间查询所述指定的租户在所述查询时间内的费用信息;Querying the cost information of the specified tenant within the query time according to the tenant identifier and the query time;

向所述管理员设备返回携带所述费用信息的费用查询响应,所述费用信息包括:实例使用费、EBS使用费、S3使用费、ELB使用费、流量使用费和总费用,以及所述实例使用费占所述租户的费用总限额的百分比、所述EBS使用费占所述费用总限额的百分比、所述S3使用费占所述费用总限额的百分比、所述ELB使用费占所述费用总限额的百分比、所述流量使用费用占所述费用总限额的百分比以及所述总费用占所述费用总限额的百分比;Returning a fee query response carrying the fee information to the administrator device, the fee information includes: instance usage fee, EBS usage fee, S3 usage fee, ELB usage fee, traffic usage fee and total fee, and the instance usage fee The usage fee accounts for the percentage of the total fee limit of the tenant, the EBS usage fee accounts for the percentage of the total fee limit, the S3 usage fee accounts for the percentage of the total fee limit, and the ELB usage fee accounts for the fee The percentage of the total limit, the percentage of the traffic usage fee in the total limit of the fee, and the percentage of the total fee in the total limit of the fee;

或者,or,

从租户设备接收租户通过租户费用查询界面触发的费用查询请求,所述费用查询请求中包括所述租户的租户标识,以及所述租户指定的查询时间;receiving a fee query request triggered by the tenant through the tenant fee query interface from the tenant device, the fee query request including the tenant ID of the tenant and the query time specified by the tenant;

根据所述租户标识和所述查询时间查询所述租户在所述查询时间内的费用信息;Querying the cost information of the tenant within the query time according to the tenant identifier and the query time;

向所述租户设备返回携带所述费用信息的费用查询响应,所述费用信息包括:实例使用费、EBS使用费、S3使用费、ELB使用费、流量使用费和总费用,以及所述实例使用费占所述租户的费用总限额的百分比、所述EBS使用费占所述费用总限额的百分比、所述S3使用费占所述费用总限额的百分比、所述ELB使用费占所述费用总限额的百分比、所述流量使用费用占所述费用总限额的百分比以及所述总费用占所述费用总限额的百分比。Returning a fee query response carrying the fee information to the tenant device, the fee information includes: instance usage fee, EBS usage fee, S3 usage fee, ELB usage fee, traffic usage fee and total fee, and the instance usage fee the percentage of the total fee limit for the tenant, the percentage of the EBS usage fee for the total fee limit, the percentage of the S3 usage fee for the total fee limit, and the ELB usage fee for the total fee limit. The percentage of the quota, the percentage of the traffic usage fee to the total fee limit, and the percentage of the total fee to the total fee limit.

可选的,处理器041执行计算机程序0421可以还用于:在所述计费中心获取每个租户的费用之后,根据每个租户的费用占该租户的费用总限额的百分比,以及每个租户的费用百分比软限额、费用百分比硬限额,判断是否对该租户进行费用告警以及告警级别;所述费用百分比硬限额大于所述费用百分比软限额;Optionally, the processor 041 executing the computer program 0421 may be further configured to: after the billing center obtains each tenant's fee, according to the percentage of each tenant's fee in the tenant's total fee limit, and the percentage of each tenant's fee The fee percentage soft limit and fee percentage hard limit determine whether to issue a fee alarm and the alarm level for the tenant; the fee percentage hard limit is greater than the fee percentage soft limit;

其中,对于任一租户,若所述任一租户的费用超过所述费用百分比软限额,未超过所述费用百分比硬限额,则对所述任一租户进行告警,告警级别为重要告警;Wherein, for any tenant, if the fee of any tenant exceeds the soft limit of the fee percentage but does not exceed the hard limit of the fee percentage, an alarm is issued to the any tenant, and the alarm level is an important alarm;

若所述任一租户的费用超过所述费用百分比硬限额,则对所述任一租户进行告警,告警级别为紧急告警;If the fee of any one of the tenants exceeds the hard limit of the fee percentage, then give an alarm to any one of the tenants, and the alarm level is an emergency alarm;

若所述任一租户的费用未超过所述费用百分比软限额,则不进行告警。If the fee of any one of the tenants does not exceed the soft limit of the fee percentage, no alarm is issued.

可选的,处理器041执行计算机程序0421可以还用于:Optionally, the processor 041 executing the computer program 0421 may also be used for:

获取所述分析中心统计的每类资源的使用率;Obtain the utilization rate of each type of resource counted by the analysis center;

根据每类资源的使用率,以及预设的每类资源的使用率对应的价格调整策略对该类资源的资源价格进行调整。The resource price of this type of resource is adjusted according to the usage rate of each type of resource and the preset price adjustment strategy corresponding to the usage rate of each type of resource.

本实施例用于实现上述各方法实施例,本实施例中各个单元的工作流程和工作原理参见上述各方法实施例中的描述,在此不再赘述。This embodiment is used to implement the above-mentioned method embodiments. For the workflow and working principle of each unit in this embodiment, refer to the descriptions in the above-mentioned method embodiments, and details are not repeated here.

本发明实施例提供一种计费中心,首先由分析中心根据租户的标识,查询每个租户对应的分区,并查询每个租户对应的每个分区中的对应该租户的可用区,得到每个租户对应的至少一个可用区,还根据租户的标识查询每个租户对应的工程,从而在每个租户对应的至少一个可用区下查询该租户所使用的至少一个资源的资源信息,而后再对每个资源的使用量进行统计,最终得到每个租户的资源使用信息,生成资源使用统计总表,并将该资源使用统计总表发送给计费中心,该计费中心能够根据资源使用统计总表获取每个租户的资源使用信息,根据资源定价表以及每个租户的资源使用信息确定每个租户的费用。能够实现对多种云服务的资源使用进行混合计费,并实现对多分区多云平台进行混合计费。An embodiment of the present invention provides a billing center. First, the analysis center queries the partition corresponding to each tenant according to the identifier of the tenant, and queries the available area corresponding to the tenant in each partition corresponding to each tenant, and obtains each At least one availability zone corresponding to the tenant, and query the project corresponding to each tenant according to the identifier of the tenant, so as to query the resource information of at least one resource used by the tenant under at least one availability zone corresponding to each tenant, and then query each Statistics on the usage of each resource, and finally obtain the resource usage information of each tenant, generate a resource usage statistics summary table, and send the resource usage statistics summary table to the billing center, which can be based on the resource usage statistics summary table. Obtain the resource usage information of each tenant, and determine the cost of each tenant according to the resource pricing table and the resource usage information of each tenant. It can realize hybrid billing for the resource usage of multiple cloud services, and realize hybrid billing for multi-partition and multi-cloud platforms.

本发明实施例还提供一种计费系统,包括:前述实施例所述的分析中心01或03,以及前述实施例所述的计费中心02或04,还可以包括,分析数据库和计费数据库,其中分析中心、计费中心、分析数据库、计费数据库以及多个分区之间的关系与图1所示的系统架构相同,不再赘述。An embodiment of the present invention also provides a billing system, including: the analysis center 01 or 03 described in the foregoing embodiments, and the billing center 02 or 04 described in the foregoing embodiments, and may also include an analysis database and a billing database , wherein the relationship between the analysis center, billing center, analysis database, billing database, and multiple partitions is the same as the system architecture shown in FIG. 1 , and will not be repeated here.

在本发明所提供的几个实施例中,应该理解到,所揭露的方法、装置,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present invention, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware, or in the form of hardware plus software functional units.

上述以软件功能单元的形式实现的集成的单元,可以存储在一个计算机可读取存储介质中。上述软件功能单元存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本发明各个实施例所述方法的部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The above-mentioned integrated units implemented in the form of software functional units may be stored in a computer-readable storage medium. The above-mentioned software functional units are stored in a storage medium, and include several instructions to make a computer device (which may be a personal computer, server, or network device, etc.) or a processor (processor) execute the methods described in various embodiments of the present invention. partial steps. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other various media that can store program codes. .

本领域技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的装置的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of description, only the division of the above-mentioned functional modules is used as an example for illustration. The internal structure of the system is divided into different functional modules to complete all or part of the functions described above. For the specific working process of the device described above, reference may be made to the corresponding process in the foregoing method embodiments, and details are not repeated here.

最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than limiting them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: It is still possible to modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the technical solutions of the various embodiments of the present invention. scope.

Claims (24)

1. A charging method is suitable for charging resource usage of cloud services under cloud computing, and is characterized by comprising the following steps:
inquiring a partition corresponding to a first tenant according to the identifier of the first tenant, and inquiring an available area corresponding to the first tenant in each partition corresponding to the first tenant to obtain at least one available area corresponding to the first tenant; wherein the first tenant is any one of all tenants;
inquiring a project corresponding to the first tenant according to the identifier of the first tenant to obtain at least one project corresponding to the first tenant;
inquiring resource information of resources used by each project in the at least one project under the at least one available area according to the identifier of the at least one project to obtain the resource information of at least one resource used by the first tenant;
counting the usage amount of each resource according to the resource information of the at least one resource to obtain the resource usage information of the first tenant;
generating a resource usage statistics summary table according to the resource usage information of all tenants;
and sending the resource usage statistics summary table to a charging center so that the charging center can acquire the resource usage information of each tenant according to the resource usage statistics summary table, and determine the cost of each tenant according to a resource pricing table and the resource usage information of each tenant.
2. The method of claim 1, wherein the resource information of the at least one resource comprises: a resource identification and a resource type of the at least one resource;
wherein the resource types include: example, one of mirroring, simple storage service S3, elastic block storage EBS, elastic load balancing ELB, and traffic.
3. The method of claim 2, wherein the counting the usage amount of each resource according to the resource information of the at least one resource comprises:
if the resource type of any resource in the at least one resource is an example, counting the use duration of the virtual machine corresponding to the any resource according to the resource identifier of the any resource, wherein the use duration is used as the use amount of the any resource;
if the resource type of any resource is a mirror image, using the virtual machine usage duration corresponding to the instance to which any resource belongs as the usage amount of any resource according to the resource identifier of any resource;
if the resource type of any resource is EBS, counting the size of the use space and the use duration of any resource as the use amount of any resource according to the resource identifier of any resource;
if the resource type of any resource is S3, counting the size of the usage space and the usage duration of any resource as the usage amount of any resource according to the resource identifier of any resource;
if the resource type of any resource is ELB, counting the use duration of any resource as the use amount of any resource according to the resource identifier of any resource;
and if the resource type of any resource is flow, taking the flow value of any resource counted according to the resource identifier of any resource corresponding to any resource as the usage amount of any resource.
4. The method according to any one of claims 1-3, wherein the querying the partition corresponding to the first tenant and the available area corresponding to the first tenant in each partition according to the identifier of the first tenant until the sending of the resource usage statistics total to a charging center is a query batch;
and after the resource usage statistical summary table is sent to a charging center, executing the next query batch after a preset time interval.
5. The method of claim 4, wherein each resource corresponds to an entry in the resource usage statistics summary table; wherein, the entry corresponding to any resource includes: tenant identification, resource type, resource identification, resource usage amount and query timestamp;
the tenant identification is an identification of a tenant using any resource, the resource type is a resource type of any resource, the resource identification is a resource identification of any resource, the resource usage amount is the usage amount of any resource used by the tenant corresponding to the tenant identification, and the query timestamp is a time point for querying the resource usage amount, wherein the query timestamp in the entry corresponding to each resource is the same in the same query batch.
6. A charging method is suitable for charging resource usage of cloud services under cloud computing, and is characterized by comprising the following steps:
receiving a resource usage statistics summary table sent by an analysis center, wherein the resource usage statistics summary table is generated according to resource usage information of all tenants, wherein each resource usage information is obtained by counting the usage amount of each resource according to the resource information of at least one resource of each tenant, the resource information of at least one resource of each tenant is obtained by querying the resource information of the resource used by each project in at least one available area according to the identifier of at least one project of each tenant, at least one project corresponding to each tenant is obtained by querying the project corresponding to each tenant according to the identifier of each tenant, at least one available area corresponding to each tenant is a partition corresponding to each tenant, which is queried by the identifier of each tenant, the usable area corresponding to each tenant in each partition corresponding to each tenant is inquired;
acquiring the resource use information of each tenant according to the resource use statistical summary table;
acquiring the cost of each tenant according to the resource pricing table and the resource use information of each tenant;
the resource types of the resources include: example, one of mirroring, simple storage service S3, elastic block storage EBS, elastic load balancing ELB, and traffic.
7. The method of claim 6, wherein there is one entry for each resource in the resource usage statistics summary table; wherein, the entry corresponding to any resource includes: tenant identification, resource type, resource identification, resource usage amount and query timestamp;
the tenant identification is an identification of a tenant using any resource, the resource type is a resource type of any resource, the resource identification is a resource identification of any resource, the resource usage amount is the usage amount of any resource used by the tenant corresponding to the tenant identification, and the query timestamp is a time point for querying the resource usage amount, wherein the query timestamp in the entry corresponding to each resource is the same in the same query batch.
8. The method of claim 7, wherein the obtaining resource usage information of each tenant according to the resource usage statistics summary table comprises:
determining the tenant to which each entry belongs according to the tenant identification in each entry in the resource usage statistics summary table;
and acquiring the resource use information of each tenant according to all the entries of each tenant, wherein the resource use information of each tenant comprises the use amount of each resource used by each tenant.
9. The method of claim 8, wherein obtaining the cost of each tenant based on the resource pricing tables and the resource usage information of each tenant comprises:
inquiring the resource pricing table to obtain the unit price of each resource used by each tenant;
according to the unit price of each resource used by each tenant, calculating the cost of each resource used by each tenant according to the usage amount of each resource used by each tenant and a preset charging strategy;
the total cost of each tenant is calculated according to the cost of each resource used by each tenant.
10. The method of claim 9, wherein the usage of each resource used by each tenant comprises:
for any tenant, if the resource type of any resource used by the any tenant is an instance, the usage amount of the any resource is the usage duration of a virtual machine corresponding to the any resource;
if the resource type of any resource used by any tenant is a mirror image, the usage amount of any resource is the usage duration of a virtual machine corresponding to the instance to which any resource belongs;
if the resource type of any resource used by any tenant is EBS, the usage amount of any resource is the size of the usage space and the usage duration of any resource;
if the resource type of any resource used by any tenant is S3, the usage amount of any resource is the size of the usage space and the usage duration of any resource;
if the resource type of any resource used by any tenant is ELB, the usage amount of any resource is the usage duration of any resource;
and if the resource type of any resource used by any tenant is flow, the usage amount of any resource is the flow value of any resource.
11. The method of claim 10, wherein the preset charging policy comprises:
if the resource type of any resource used by any tenant is an instance, the cost of any resource used by any tenant is the usage duration of a virtual machine corresponding to any resource and the unit price of any resource;
if the resource type of any resource used by any tenant is a mirror image, the cost of any resource used by any tenant is the usage duration of a virtual machine corresponding to the instance to which any resource belongs and the unit price of any resource;
if the resource type of any resource used by any tenant is EBS, the cost of any resource used by any tenant is the size of the use space of any resource, the use duration and the unit price of any resource;
if the resource type of any resource used by any tenant is S3, the cost of any resource used by any tenant is the size of the usage space of any resource, the usage duration, and the unit price of any resource;
if the resource type of any resource used by any tenant is ELB, the cost of any resource used by any tenant is the using time of any resource and the unit price of any resource;
if the resource type of any resource used by any tenant is flow, the expense of any resource used by any tenant is the flow value of any resource and the unit price of any resource;
wherein the price per unit of the any resource is determined from the price per resource, the price unit, and the measure unit of the any resource.
12. The method according to any one of claims 6-11, further comprising:
acquiring the utilization rate of each type of resource counted by the analysis center;
and adjusting the resource price of each type of resource according to the utilization rate of each type of resource and a preset price adjusting strategy corresponding to the utilization rate of each type of resource.
13. An analysis center adapted to charge for resource usage of a cloud service under cloud computing, the analysis center comprising:
the query module is used for querying the partition corresponding to the first tenant according to the identifier of the first tenant, and querying an available area corresponding to the first tenant in each partition corresponding to the first tenant to obtain at least one available area corresponding to the first tenant; wherein the first tenant is any one of all tenants;
the query module is further configured to query the project corresponding to the first tenant according to the identifier of the first tenant, so as to obtain at least one project corresponding to the first tenant;
the acquisition module is used for inquiring the resource information of the resource used by each project in the at least one project under the at least one available area according to the identifier of the at least one project to obtain the resource information of the at least one resource used by the first tenant;
the analysis module is used for counting the usage amount of each resource according to the resource information of the at least one resource to obtain the resource usage information of the first tenant;
the analysis module is used for generating a resource usage statistics summary table according to the resource usage information of all tenants;
and the interface module is used for sending the resource usage statistics summary table to a charging center so that the charging center can obtain the resource usage information of each tenant according to the resource usage statistics summary table and determine the cost of each tenant according to the resource pricing table and the resource usage information of each tenant.
14. The analysis center of claim 13, wherein the resource information of the at least one resource comprises: a resource identification and a resource type of the at least one resource;
wherein the resource types include: example, one of mirroring, simple storage service S3, elastic block storage EBS, elastic load balancing ELB, and traffic.
15. The analysis center of claim 14, wherein the analysis module is specifically configured to:
if the resource type of any resource in the at least one resource is an example, counting the use duration of the virtual machine corresponding to the any resource according to the resource identifier of the any resource, wherein the use duration is used as the use amount of the any resource;
if the resource type of any resource is a mirror image, using the virtual machine usage duration corresponding to the instance to which any resource belongs as the usage amount of any resource according to the resource identifier of any resource;
if the resource type of any resource is EBS, counting the size of the use space and the use duration of any resource as the use amount of any resource according to the resource identifier of any resource;
if the resource type of any resource is S3, counting the size of the usage space and the usage duration of any resource as the usage amount of any resource according to the resource identifier of any resource;
if the resource type of any resource is ELB, counting the use duration of any resource as the use amount of any resource according to the resource identifier of any resource;
and if the resource type of any resource is flow, taking the flow value of any resource counted according to the resource identifier of any resource corresponding to any resource as the usage amount of any resource.
16. The analysis center according to any one of claims 13 to 15, wherein the resource usage statistics summary is sent to the charging center as a query batch from the query module querying the partition corresponding to the first tenant and the available area corresponding to the first tenant in each partition according to the identifier of the first tenant to the interface module;
and after the interface module sends the resource usage statistical summary table to a charging center, executing the next query batch after a preset time interval.
17. The analysis center of claim 16, wherein in the resource usage statistics summary table, there is an entry for each resource; wherein, the entry corresponding to any resource includes: tenant identification, resource type, resource identification, resource usage amount and query timestamp;
the tenant identification is an identification of a tenant using any resource, the resource type is a resource type of any resource, the resource identification is a resource identification of any resource, the resource usage amount is the usage amount of any resource used by the tenant corresponding to the tenant identification, and the query timestamp is a time point for querying the resource usage amount, wherein the query timestamp in the entry corresponding to each resource is the same in the same query batch.
18. A charging center is suitable for charging resource usage of cloud services under cloud computing, and is characterized by comprising:
an interface module for receiving a resource usage statistics summary table sent by the analysis center, wherein the resource usage statistics summary table is generated according to the resource usage information of all tenants, wherein each resource usage information is obtained by counting the usage amount of each resource according to the resource information of at least one resource of each tenant, the resource information of at least one resource of each tenant is obtained by querying the resource information of the resource used by each project in at least one available area according to the identifier of at least one project of each tenant, at least one project corresponding to each tenant is obtained by querying the project corresponding to each tenant according to the identifier of each tenant, at least one available area corresponding to each tenant is a partition corresponding to each tenant, which is queried by the identifier of each tenant, the usable area corresponding to each tenant in each partition corresponding to each tenant is inquired;
the acquisition module is used for acquiring the resource use information of each tenant according to the resource use statistical summary table;
the charging module is used for acquiring the cost of each tenant according to the resource pricing table and the resource use information of each tenant;
the resource types of the resources include: example, one of mirroring, simple storage service S3, elastic block storage EBS, elastic load balancing ELB, and traffic.
19. The billing center of claim 18, wherein there is an entry for each resource in the resource usage statistics summary table; wherein, the entry corresponding to any resource includes: tenant identification, resource type, resource identification, resource usage amount and query timestamp;
the tenant identification is an identification of a tenant using any resource, the resource type is a resource type of any resource, the resource identification is a resource identification of any resource, the resource usage amount is the usage amount of any resource used by the tenant corresponding to the tenant identification, and the query timestamp is a time point for querying the resource usage amount, wherein the query timestamp in the entry corresponding to each resource is the same in the same query batch.
20. The charging center according to claim 19, wherein the obtaining module is specifically configured to:
determining the tenant to which each entry belongs according to the tenant identification in each entry in the resource usage statistics summary table;
and acquiring the resource use information of each tenant according to all the entries of each tenant, wherein the resource use information of each tenant comprises the use amount of each resource used by each tenant.
21. The billing center of claim 20, wherein the billing module comprises:
the unit price query module is used for querying the resource pricing table to obtain the unit price of each resource used by each tenant;
the resource charging module is used for calculating the cost of each resource used by each tenant according to the unit price of each resource used by each tenant, the usage amount of each resource used by each tenant and a preset charging strategy;
and the tenant charging module is used for calculating the total charge of each tenant according to the charge of each resource used by each tenant.
22. The charging center of claim 21, wherein the usage amount of each resource used by each tenant comprises:
for any tenant, if the resource type of any resource used by the any tenant is an instance, the usage amount of the any resource is the usage duration of a virtual machine corresponding to the any resource;
if the resource type of any resource used by any tenant is a mirror image, the usage amount of any resource is the usage duration of a virtual machine corresponding to the instance to which any resource belongs;
if the resource type of any resource used by any tenant is EBS, the usage amount of any resource is the size of the usage space and the usage duration of any resource;
if the resource type of any resource used by any tenant is S3, the usage amount of any resource is the size of the usage space and the usage duration of any resource;
if the resource type of any resource used by any tenant is ELB, the usage amount of any resource is the usage duration of any resource;
and if the resource type of any resource used by any tenant is flow, the usage amount of any resource is the flow value of any resource.
23. The charging center of claim 22, wherein the preset charging policy comprises:
if the resource type of any resource used by any tenant is an instance, the cost of any resource used by any tenant is the usage duration of a virtual machine corresponding to any resource and the unit price of any resource;
if the resource type of any resource used by any tenant is a mirror image, the cost of any resource used by any tenant is the usage duration of a virtual machine corresponding to the instance to which any resource belongs and the unit price of any resource;
if the resource type of any resource used by any tenant is EBS, the cost of any resource used by any tenant is the size of the use space of any resource, the use duration and the unit price of any resource;
if the resource type of any resource used by any tenant is S3, the cost of any resource used by any tenant is the size of the usage space of any resource, the usage duration, and the unit price of any resource;
if the resource type of any resource used by any tenant is ELB, the cost of any resource used by any tenant is the using time of any resource and the unit price of any resource;
if the resource type of any resource used by any tenant is flow, the expense of any resource used by any tenant is the flow value of any resource and the unit price of any resource;
wherein the price per unit of the any resource is determined from the price per resource, the price unit, and the measure unit of the any resource.
24. The charging center according to any one of claims 18 to 23, wherein the charging center further comprises: a price adjustment module, the price adjustment module to:
acquiring the utilization rate of each type of resource counted by the analysis center;
and adjusting the resource price of each type of resource according to the utilization rate of each type of resource and a preset price adjusting strategy corresponding to the utilization rate of each type of resource.
CN201410855958.9A 2014-12-31 2014-12-31 Charging method, analysis center and charging center Active CN104468136B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410855958.9A CN104468136B (en) 2014-12-31 2014-12-31 Charging method, analysis center and charging center

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410855958.9A CN104468136B (en) 2014-12-31 2014-12-31 Charging method, analysis center and charging center

Publications (2)

Publication Number Publication Date
CN104468136A CN104468136A (en) 2015-03-25
CN104468136B true CN104468136B (en) 2017-11-24

Family

ID=52913566

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410855958.9A Active CN104468136B (en) 2014-12-31 2014-12-31 Charging method, analysis center and charging center

Country Status (1)

Country Link
CN (1) CN104468136B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI663556B (en) 2018-01-30 2019-06-21 中華電信股份有限公司 Resource authorization control system and method with fee splitting function

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108874638B (en) 2017-05-12 2023-05-30 微软技术许可有限责任公司 Intelligent cloud management based on portrait information
CN107516199A (en) * 2017-08-01 2017-12-26 携程旅游信息技术(上海)有限公司 Container charging method, apparatus and system, equipment, the storage medium of cloud platform
CN108171540A (en) * 2017-12-26 2018-06-15 北京星河星云信息技术有限公司 For the method and apparatus of resource metering and billing
CN108234622A (en) * 2017-12-28 2018-06-29 北京星河星云信息技术有限公司 Charging method and charge system
CN108596649A (en) * 2018-03-22 2018-09-28 深圳市网心科技有限公司 Account book rewards settlement method, server and computer readable storage medium
CN110298677B (en) * 2018-03-22 2021-08-13 中移(苏州)软件技术有限公司 A method, device, electronic device and storage medium for charging cloud computing resources
CN108898446B (en) * 2018-07-18 2022-04-12 北京百度网讯科技有限公司 Method and apparatus for outputting information
CN109255602A (en) * 2018-09-26 2019-01-22 广东浪潮大数据研究有限公司 A kind of resource uses charging method, device and equipment
CN109450984B (en) * 2018-10-16 2021-12-21 深信服科技股份有限公司 Cloud architecture management method and device and computer readable storage medium
CN110381137A (en) * 2019-07-19 2019-10-25 浪潮云信息技术有限公司 Object storage usage amount statistical method and system based on ceph
CN110674190B (en) * 2019-09-27 2022-07-15 北京金山云网络技术有限公司 Statistical method and device for file system tasks and server
CN112054912B (en) * 2020-08-31 2023-06-13 北京易捷思达科技发展有限公司 Resource charging system and method of OpenStack open source cloud platform
CN112422299B (en) * 2020-11-18 2022-10-25 杭州飞致云信息科技有限公司 Method and device for analyzing public cloud charging data and computer readable storage medium
CN114629732A (en) * 2020-12-11 2022-06-14 北京金山云网络技术有限公司 Charging method and device for cloud resources, electronic equipment and medium
CN113822701B (en) * 2021-08-28 2023-12-26 济南浪潮数据技术有限公司 Cloud platform third party resource computing method, device, equipment and readable medium
CN114529290A (en) * 2022-01-27 2022-05-24 广东省电信规划设计院有限公司 Charging management method and device for government affair cloud and computer storage medium
CN120011092A (en) * 2025-04-18 2025-05-16 北京九章云极科技有限公司 Computing power usage rate prompt method and device for inclusive computing power intelligent computing center

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7743001B1 (en) * 2005-06-21 2010-06-22 Amazon Technologies, Inc. Method and system for dynamic pricing of web services utilization
CN102594576A (en) * 2012-03-19 2012-07-18 广州亦云信息技术有限公司 Charging method based on cloud platform service
CN103166989A (en) * 2011-12-13 2013-06-19 中国电信股份有限公司 Cloud Computing Oriented Resource Usage Metering Method and System
CN103458055A (en) * 2013-09-22 2013-12-18 广州中国科学院软件应用技术研究所 Clout competing platform
CN103731278A (en) * 2011-12-31 2014-04-16 华茂云天科技(北京)有限公司 Service billing system of cloud computing platform

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7743001B1 (en) * 2005-06-21 2010-06-22 Amazon Technologies, Inc. Method and system for dynamic pricing of web services utilization
CN103166989A (en) * 2011-12-13 2013-06-19 中国电信股份有限公司 Cloud Computing Oriented Resource Usage Metering Method and System
CN103731278A (en) * 2011-12-31 2014-04-16 华茂云天科技(北京)有限公司 Service billing system of cloud computing platform
CN102594576A (en) * 2012-03-19 2012-07-18 广州亦云信息技术有限公司 Charging method based on cloud platform service
CN103458055A (en) * 2013-09-22 2013-12-18 广州中国科学院软件应用技术研究所 Clout competing platform

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI663556B (en) 2018-01-30 2019-06-21 中華電信股份有限公司 Resource authorization control system and method with fee splitting function

Also Published As

Publication number Publication date
CN104468136A (en) 2015-03-25

Similar Documents

Publication Publication Date Title
CN104468136B (en) Charging method, analysis center and charging center
RU2614538C2 (en) Tracking data usage under a schematized data plan
CN110418022B (en) Method and device for adjusting flow package for multiple user identifications
CN103166989B (en) Resource use metering method and resource use metering system for cloud computing
US20090292654A1 (en) Systems and methods for calculating use charges in a virtualized infrastructure
CN103067185B (en) Charging method in cloud computing system
US11516033B1 (en) System and method for metering consumption
US10944874B2 (en) Telecommunication system for monitoring and controlling of a network providing resource to a user
CN109951302A (en) A kind of cloud computing charge system and method based on the customized product of data dictionary
CN107493176B (en) A billing method and system
CN108023735A (en) A kind of charging method based on dynamic resource
Anwar et al. Scalable metering for an affordable it cloud service management
CN109936465A (en) A kind of cloud platform resource utilization evaluation method and device
CN113407302B (en) Resource management method and system
CN116056018A (en) Short message service charging method and device and electronic equipment
Schwanengel et al. Challenges with tenant-specific cost determination in multi-tenant applications
US20240242254A1 (en) System and method for providing converged utilities billing
EP3331196B1 (en) Telecommunication system for monitoring and controlling of a network providing resource to a user
Kalmar et al. What does I (o) T cost?
CN103955854A (en) Account management device and method
US11062364B1 (en) Pricing usage of software products
CN114548991A (en) Bill generation method and device
AU2018102223A4 (en) Telecom Information Processing System and Method Thereof
CN107979478A (en) A kind of definite method and device of customer experience index
US20180025338A1 (en) Image forming system and charging management method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant