CN111224791B - Cloud resource charging method and device, electronic equipment and storage medium - Google Patents

Cloud resource charging method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111224791B
CN111224791B CN202010026424.0A CN202010026424A CN111224791B CN 111224791 B CN111224791 B CN 111224791B CN 202010026424 A CN202010026424 A CN 202010026424A CN 111224791 B CN111224791 B CN 111224791B
Authority
CN
China
Prior art keywords
period
charging
sub
service item
time
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
CN202010026424.0A
Other languages
Chinese (zh)
Other versions
CN111224791A (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.)
Shanghai Nanyang Yunhai Data Technology Co.,Ltd.
Original Assignee
Shanghai Yunhai Wanbang Data Technology 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 Shanghai Yunhai Wanbang Data Technology Co ltd filed Critical Shanghai Yunhai Wanbang Data Technology Co ltd
Priority to CN202010026424.0A priority Critical patent/CN111224791B/en
Publication of CN111224791A publication Critical patent/CN111224791A/en
Application granted granted Critical
Publication of CN111224791B publication Critical patent/CN111224791B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/14Charging, metering or billing arrangements for data wireline or wireless communications
    • H04L12/1432Metric aspects
    • H04L12/1439Metric aspects time-based
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/14Charging, metering or billing arrangements for data wireline or wireless communications
    • H04L12/1403Architecture for metering, charging or billing
    • H04L12/1407Policy-and-charging control [PCC] architecture
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/14Charging, metering or billing arrangements for data wireline or wireless communications
    • H04L12/1485Tariff-related aspects
    • H04L12/1496Tariff-related aspects involving discounts

Abstract

The embodiment of the invention discloses a cloud resource charging method, a cloud resource charging device, electronic equipment and a storage medium, wherein the method comprises the following steps: determining service items which are deployed by a cloud resource user and are charged according to the usage amount, the charging time period of the service items and the initial unit price according to the received charging instruction; determining at least one discount coefficient of the service item in the charging period according to the deployment duration of the service item, and dividing the charging period into at least one first sub-period according to the discount coefficient; dividing each first sub-period into at least two types of second sub-periods based on the time-sharing charging rule of the service item, and determining the period coefficient and the usage amount of each type of second sub-period in each first sub-period; and determining the cost of the service item charged according to the usage amount according to the initial unit price of the service item, the discount coefficient of at least one first sub-period, and the period coefficient and the usage amount of various second sub-periods in each first sub-period. Charging is carried out according to the discount coefficient and the time period coefficient, so that the flexibility of cloud resource charging is improved.

Description

Cloud resource charging method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to a cloud computing technology, in particular to a cloud resource charging method and device, electronic equipment and a storage medium.
Background
Currently, a cloud user (e.g., an enterprise, a government organization, etc.) may apply for cloud resources (e.g., computing resources, storage resources, network resources, various software services, etc.) from a cloud service provider, and the cloud service provider may allocate corresponding cloud resources to the cloud user according to the application and perform billing. In the prior art, a cloud resource charging method generally charges according to the usage amount of cloud resource service items deployed by a cloud user and the unit price of each service item, and is relatively single and relatively poor in flexibility.
Disclosure of Invention
In view of this, embodiments of the present invention provide a cloud resource charging method and apparatus, an electronic device, and a storage medium, so as to improve flexibility of cloud resource charging.
In a first aspect, an embodiment of the present invention provides a cloud resource charging method, including:
receiving a charging instruction, and determining service items deployed by a cloud resource user, charging time periods of the service items and initial unit prices according to the charging instruction, wherein the service items are service items charged according to usage;
determining at least one discount coefficient of the service item in the charging time interval according to the deployment duration of the service item, and dividing the charging time interval into at least one first sub-time interval according to the discount coefficient;
dividing each first sub-period into at least two types of second sub-periods based on the time-sharing charging rule of the service item, and determining the period coefficient and the usage amount of each type of second sub-period in each first sub-period;
and determining the cost of the service item charged according to the usage amount according to the initial unit price of the service item, the discount coefficient of at least one first sub-period, and the period coefficient and the usage amount of various second sub-periods in each first sub-period.
In a second aspect, an embodiment of the present invention further provides a cloud resource charging apparatus, including:
the basic information determining module is used for receiving a charging instruction, and determining service items deployed by a cloud resource user, charging time periods of the service items and initial unit prices according to the charging instruction, wherein the service items are service items charged according to usage;
the discount coefficient determining module is used for determining at least one discount coefficient of the service item in the charging time interval according to the deployment duration of the service item, and dividing the charging time interval into at least one first sub-time interval according to the discount coefficient;
the time interval coefficient and usage amount determining module is used for dividing each first sub-time interval into at least two types of second sub-time intervals based on the time-sharing charging rule of the service item, and determining the time interval coefficient and usage amount of each type of second sub-time interval in each first sub-time interval;
and the charge determining module is used for determining the charge of the service item according to the initial unit price of the service item, the discount coefficient of at least one first sub-period, and the period coefficient and the usage of various second sub-periods in each first sub-period.
In a third aspect, an embodiment of the present invention further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and capable of running on the processor, where when the processor executes the computer program, the cloud resource billing method provided in any embodiment of the present application is implemented.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the cloud resource charging method according to any embodiment of the present application.
According to the cloud resource charging method, the cloud resource charging device, the electronic equipment and the storage medium, aiming at the service items charged according to the usage amount, the server of the cloud resource provider can determine the service items deployed by the cloud resource user, the charging time period and the initial unit price of the service items according to the received charging instruction; determining at least one discount coefficient of the service item in the charging period according to the deployment duration of the service item, and dividing the charging period into at least one first sub-period according to the discount coefficient; dividing each first sub-period into at least two types of second sub-periods based on the time-sharing charging rule of the service item, and determining the period coefficient and the usage amount of each type of second sub-period in each first sub-period; and determining the cost of the service item charged according to the usage amount according to the initial unit price of the service item, the discount coefficient of at least one first sub-period, and the period coefficient and the usage amount of various second sub-periods in each first sub-period.
The discount coefficient is determined according to the service item deployment time length of the cloud resource user, the time period coefficient of various time periods is determined according to the time-sharing charging rule of the service items, the initial unit price, the discount coefficient, the time period coefficient and the usage amount of the service items are integrated, and the cost of the service items charged according to the usage amount is obtained, so that the service items with different deployment time lengths and/or the usage amounts of the service items in different time periods can be charged in a differentiated mode, the charging mode is enriched, and the flexibility of cloud resource charging is improved.
Drawings
Fig. 1 is a flowchart illustrating a cloud resource charging method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a cloud resource charging apparatus according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device according to a third embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described through embodiments with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention. In the following embodiments, optional features and examples are provided in each embodiment, and various features described in the embodiments may be combined to form a plurality of alternatives, and each numbered embodiment should not be regarded as only one technical solution.
Example one
Fig. 1 is a flowchart of a cloud resource charging method according to an embodiment of the present invention, which is applicable to a situation in which a cloud resource provider charges cloud resources used by cloud resource users, specifically a situation in which a cloud resource service item charged according to a long usage amount is charged. The method can be executed by the cloud resource charging device provided by the embodiment of the invention, and the cloud resource charging device can be configured in the electronic equipment provided by the embodiment of the invention.
Referring to fig. 1, the cloud resource charging method specifically includes the following steps:
and S110, receiving a charging instruction, and determining service items deployed by a cloud resource user, charging time periods of the service items and initial unit prices according to the charging instruction, wherein the service items are service items charged according to usage.
The electronic device implementing the cloud resource charging method provided by the embodiment of the invention can be, for example, a server of a cloud resource provider. The charging instruction received by the server may be a charging instruction triggered by the server per se according to a charging period, or may be a charging instruction sent by a cloud resource user. The charging period may be day, month, quarter or year, and the value of the specific day, month, quarter or year may be preset by the server of the cloud resource provider according to the actual application scenario. The service items deployed by the cloud resource user are cloud resource service items which are applied by the cloud resource user to the cloud resource provider and are charged according to the usage amount, and may include computing resources, storage resources, network resources, various software services, and the like. The charging time interval of the service item is a time interval in which charges are generated in the use process after the service item is configured, namely an effective charging time interval, namely, if no charges are generated in the use process after the service item is configured, the use time interval is not used as the charging time interval. The initial unit prices of the different service items can be different or the same, and the initial unit prices of the service items can be preset by a server of a cloud resource provider according to an actual application scene and can be stored in a preset space.
When receiving a charging instruction triggered by the server per se according to a charging cycle, the server of the cloud resource provider can sequentially query service items which are deployed by each cloud resource user and are charged according to the usage amount according to the charging instruction, determine a charging period of the service items deployed by each cloud resource user, and obtain an initial unit price of the service items deployed by each cloud resource user, which is set in advance, from a preset storage space. When receiving a charging instruction sent by a certain cloud resource user, a server of a cloud resource provider can query service items which are deployed by the cloud resource user and are charged according to the usage amount according to the charging instruction, determine a charging period of the service items deployed by the cloud resource user, and obtain an initial unit price of the service items deployed by the cloud resource user, which is set in advance, from a preset storage space.
Optionally, determining a charging period of the service item deployed by the cloud resource user according to the charging instruction includes: acquiring a first time period carried in a charging instruction, a deployment time period of a service item deployed by a cloud resource user and a price configuration time period of the service item; and solving the intersection of the first time interval, the deployment time interval and the price configuration time interval to obtain the charging time interval of the service item.
When the charging instruction received by the server is a charging instruction triggered by the server according to the charging period, the first period can be the charging period to be charged currently; when the charging instruction received by the server is a charging instruction sent by a certain cloud resource user, the first time period may be a time period defined by the cloud resource user, for example, a time period from n month m days to n +1 month m days. The deployment time period of the cloud resource user deployment server is a time period from a deployment starting time point to a deployment ending time point, and if the deployment ending time point is not available when the cloud resource cost is determined, the time point from the deployment starting time point to the current charging time point can be used as the deployment time period. The price configuration time period of the service item is a time period from a configuration price starting time point to a configuration price ending time point, and if the configuration price ending time point is not available when the cloud resource cost is determined, the time point from the configuration price starting time point to the current charging time can be used as the price configuration time period. It can be understood that the tariff of the service item is 0 before the configuration price starting time point and after the configuration price ending time point; and in the time period from the configuration price starting time point to the configuration price ending time point, the charge of the service item is not 0.
When receiving a charging instruction triggered by the server according to the charging cycle, the server of the cloud resource provider can obtain an intersection of the charging cycle to be charged currently, the deployment time period of the service item deployed by each cloud resource user and the price configuration time period, so as to obtain the charging time period of each cloud resource user. When receiving a charging instruction sent by a certain cloud resource user, a server of a cloud resource provider can obtain an intersection of a self-defined first time period carried in the charging instruction, a deployment time period of a service item deployed by the cloud resource user and a price configuration time period, so as to obtain the charging time period of the cloud resource user.
Illustratively, when the charging instruction received by the server of the cloud resource provider is a charging instruction triggered by a charging period, and the charging cycle to be charged at present is (2019-09-01, 2019-09-30), the deployment time period of the service item deployed by a certain cloud resource user is (2019-09-14, max), the service item price configuration time period is (2019-01-01, max), the intersection of (2019-09-01, 2019-09-30), (2019-09-14, 2019-09-30) and (2019-01-01, 2019-09-30) can be taken to obtain (2019-09-14, 2019-09-30), and the time period (2019-09-14, 2019-09-30) is used as the charging time period of the service item deployed by the cloud resource user.
S120, determining at least one discount coefficient of the service item in the charging period according to the deployment duration of the service item, and dividing the charging period into at least one first sub-period according to the discount coefficient.
The discount coefficient is negatively correlated with the deployment time of the service item, that is, the longer the deployment time of the service item is, the smaller the discount coefficient can be. In the charging process of the cloud resource service item, under the condition that other calculation factors are the same, the smaller the discount coefficient is, the less the charging is. The discount coefficient and the deployment duration of the service item may be in a piecewise descending relationship, for example, the deployment duration of the service item is within one year, and the discount coefficient may be 1; the deployment duration of the service items is within one year to two years, and the discount coefficient can be 0.75; the deployment duration of the service items is within two to three years, and the discount coefficient can be 0.5; when the service item is deployed for more than three years, the discount coefficient may be 0.35. The deployment duration may be a natural year duration, or may also be an effective use duration of the service item, where a time when the service item generates a use amount may be used as the effective use duration, and is not specifically limited herein. By setting different discount coefficients, different charging strategies can be adopted for cloud resource users with different service item deployment durations, and flexibility of charging modes is improved.
The service item may correspond to one or more discount coefficients in the charging period, and when one discount coefficient corresponds, the charging period is the first sub-period, and when a plurality of discount coefficients correspond, the charging period is divided into a plurality of first sub-periods according to the discount coefficients. Illustratively, when the charging period is (2019-09-01, 2019-09-30), the discount coefficient of the service item corresponding to (2019-09-01, 2019-09-15) is 1, and the discount coefficient corresponding to (2019-09-15, 2019-09-30) is 0.75, the charging period (2019-09-01, 2019-09-30) can be divided into two first sub-periods, namely (2019-09-01, 2019-09-15) and (2019-09-15, 2019-09-30) according to the discount coefficients.
Optionally, determining at least one discount coefficient of the service item in the charging period according to the deployment duration of the service item, and dividing the charging period into at least one first sub-period according to the discount coefficient, including: taking the duration from the deployment starting time of the service item to each preset time point in the charging period as the deployment duration of each preset time point; determining a discount coefficient of each preset time point based on the deployment duration-discount corresponding relation of the preset service items; and taking the time period formed by the time points of the same discount coefficient as a first sub-time period to obtain at least one first sub-time period.
And (4) the deployment starting time of the service item is the time length of each preset time point in the charging period, namely the deployment time length is the natural year time length. Each preset time point in the charging period may be a time point selected at intervals of a first preset period from a starting time point of the charging period, where the first preset period is not greater than the charging period, for example, when the charging period is 1 month, the first preset period may be 1 day. After determining the deployment start time of the service item to the duration of each preset time point in the charging period, the server can determine the discount coefficient corresponding to each duration by inquiring the deployment duration-discount corresponding relation of the preset service item, and can take the period formed by the time points with the same discount coefficient as a first sub-period to obtain at least one first sub-period. The first preset period may be understood as a minimum duration unit for changing the discount coefficient in the deployment duration-discount correspondence, that is, a minimum variation of the charging period.
Illustratively, when the charging period is (2019-09-01, 2019-09-30), the first preset period is 1 day, the deployment start time of the service item is 2018-09-15, and the deployment duration of the service item is within one year, the discount coefficient may be 1; when the service item is deployed for a period of time within one to two years, and the discount coefficient may be 0.75, the server determines at least one first sub-period as follows:
the server determines the duration of each day and the deployment starting time 2018-09-15 of the service item in (2019-09-01, 2019-09-30), and obtains that the discount coefficients corresponding to the deployment duration of each day in 2019-09-01 to 2019-09-15 are all 1, and the discount coefficients corresponding to the deployment duration of each day in 2019-09-15 to 2019-09-30 are all 0.75, so that the charging period (2019-09-01, 2019-09-30) can be divided into two first sub-periods, namely (2019-09-01, 2019-09-15) and (2019-09-15, 2019-09-30), according to the discount coefficients.
S130, based on the time-sharing charging rule of the service item, dividing each first sub-period into at least two types of second sub-periods, and determining the period coefficient and the usage amount of each type of second sub-period in each first sub-period.
The time-sharing charging rule of the service item may be a charging rule that repeats every second preset period, where the second preset period is not greater than each first sub-period, and may be equal to the first preset period, for example. The charging rule may be that the time period in each second preset period is divided into at least two types of second sub-time periods, and different time period coefficients are set for the different types of second sub-time periods. Therefore, different fees can be charged for different time periods, for example, the service item can be used in a peak time period, the time period coefficient is higher, the service item can be used in an idle time period, and the time period coefficient is lower, so that the use amount of the service item in the peak time period is weakened, namely the normal operation of the server is ensured, a strategy for reducing the cost is provided for a cloud resource user, and the service experience of the service item can be ensured.
For example, when the second preset period is 1 day, the charging rule may be preset to include a second sub-period of two types of a busy period and an idle period each day, the busy period may be, for example, eight morning hours to eight evening hours each day, the idle period may be, for example, early morning to eight morning hours and eight evening to early morning hours, and a period coefficient of the busy period may be set to 0.8, and a period coefficient of the idle period may be set to 0.2. The duration of the second preset period, the number of the division types of the second preset period, the time period range of each type and the time period coefficient can be preset according to the actual application scene.
S140, determining the cost of the service item charged according to the usage amount according to the initial unit price of the service item, the discount coefficient of at least one first sub-period, and the period coefficient and the usage amount of various second sub-periods in each first sub-period.
The server can calculate the corresponding cost of each second sub-time period in each first sub-time period, and then sum the cost to obtain the cost of the service items according to the usage amount.
Optionally, determining the cost of the service item charged by the usage amount according to the initial unit price of the service item, the discount coefficient of at least one first sub-period, and the period coefficient and the usage amount of each type of second sub-period in each first sub-period, includes: sequentially selecting a current first sub-time period from at least one first sub-time period; aiming at various second sub-periods in the current first sub-period, the product of the initial unit price of the service item, the discount coefficient of the current first sub-period, the period coefficient of various second sub-periods and the usage amount is obtained and used as the first cost corresponding to various second sub-periods in the current first sub-period; summing first fees corresponding to various second sub-periods in the current first sub-period to obtain second fees corresponding to the current first sub-period; and when the second cost of at least one first sub-period is determined, summing the second costs to obtain the cost of the service item charged according to the usage amount.
The first sub-period is selected in sequence, for example, according to the time sequence. After the current first sub-period is selected, the costs of various second sub-periods can be calculated and summed respectively to obtain the cost of the current first sub-period. The formula for calculating the cost of the current first sub-period may be:
AC=P0*DR*(w1*AU1+w2*AU2+...+wm*AUm),
where AC represents the cost of the current first sub-period, P0 represents the initial unit price of the service item, DR represents the discount coefficient of the current first sub-period, w1、w2...wmTime interval coefficients, AU, representing second sub-intervals of the first to m-th classes, respectively1、AU2...AUmRespectively represent the usage amounts of the first class to the mth class for the second period.
After the cost of each first sub-period is obtained, the first sub-periods are summed, and the interface obtains the cost of the service items according to the usage amount.
Illustratively, suppose that the cost of the I/O throughput needs to be calculated, wherein the initial unit price of the I/O throughput is 10 yuan/million, the charging period is equal to the first sub-period (2019-09-01, 2019-09-30), and the discount coefficient is 0.75; the charging rule includes a busy period (eight morning hours to eight evening hours) and an idle period (morning hours to eight morning hours and eight evening hours to morning hours) each day, and the period coefficient of the busy period is 0.8, and the period coefficient of the idle period is 0.2. In this case, the cost of the I/O throughput can be found as follows:
the server divides the (2019-09-01, 2019-09-30) time period into at least two types of second sub-time periods according to the charging rule, namely divides the eight morning hours to the eight evening hours of each day in the (2019-09-01, 2019-09-30) time period into a first type of second sub-time period (namely a busy time period), and divides the morning hours to the eight morning hours and the eight evening hours to the early morning hours of each day in the (2019-09-01, 2019-09-30) time period into a second type of second sub-time period (namely an idle time period). The server respectively counts the usage amount of the first-type second sub-period and the second-type second sub-period to be 900 million and 100 million, and the cost of the I/O throughput in the (2019-09-01, 2019-09-30) period is as follows: 10 × 0.75 ═ 0.8 × 900+0.2 × 100 ═ 5550.
Optionally, the service item deployed by the cloud resource user is at least one service item. When the service item is one item, the cost of the service item can be calculated according to the method, namely the cost of the cloud resource service item; when the service items are more than two, the cost of each item can be calculated according to the method, and then the total cost of the cloud resource service items can be obtained by summing the cost of each item.
Optionally, when the charging instruction is a charging instruction sent by a cloud resource user, after determining the cost of the cloud resource user, the method further includes: and feeding back the cost to the cloud resource user. When the charging instruction is sent by the cloud resource user, the first time period carried in the charging instruction is a user-defined time period. After the charging time interval in the user-defined time interval is obtained, the cost of at least one service item in the charging time interval can be determined. After determining the service item cost of the cloud resource user in the custom period, the server can feed back the service item cost to the cloud resource user, so that the cloud resource user can conveniently count the service item cost condition in the custom period, and the cloud resource user can conveniently and reasonably plan the resource use cost.
Optionally, the cloud resource charging method further includes: determining service items which are deployed by a cloud resource user and are charged according to the charging instruction, the charging time period of the service items which are charged according to times, and the using times of the service items which are charged according to times in the charging time period; obtaining a third fee according to the initial unit price and the using times of the service items charged according to times; accordingly, the sum of the third fee and the fee of the service item charged by the usage amount is used as the fee of the cloud resource using party.
When the service item also comprises a service item charged according to times, the first time period carried in the charging instruction and the price configuration time period of the service item can be obtained, the intersection of the first time period and the price configuration time period can be used as the charging time period of the service item charged according to times, and the using times in the charging time period can be counted; multiplying the initial unit price of the service items charged by times by the using times to obtain the charge charged by times, namely a third charge; correspondingly, the fee charged by time and the fee of the service items charged by the usage amount are summed, and the fee of the cloud resource user can be obtained. The charging requirement of the service items charged according to the usage amount and the usage times is realized.
In addition, a discount coefficient of the pay-per-use service item may be set, and the discount coefficient may be inversely related to the historical number of uses and/or the historical use fee. Accordingly, the third fee may be obtained according to the discount coefficient of the pay-per-view service item, the initial unit price and the number of times of use of the pay-per-view service item. By setting different discount coefficients, different charging strategies can be adopted for cloud resource users with different service item use times or use fees, and the flexibility of the charging mode is improved.
In the cloud resource charging method provided by this embodiment, for the service items charged by the usage amount, the server of the cloud resource provider may determine the service items deployed by the cloud resource user, the charging period of the service items, and the initial unit price according to the received charging instruction; determining at least one discount coefficient of the service item in the charging period according to the deployment duration of the service item, and dividing the charging period into at least one first sub-period according to the discount coefficient; dividing each first sub-period into at least two types of second sub-periods based on the time-sharing charging rule of the service item, and determining the period coefficient and the usage amount of each type of second sub-period in each first sub-period; and determining the cost of the service item charged according to the usage amount according to the initial unit price of the service item, the discount coefficient of at least one first sub-period, and the period coefficient and the usage amount of various second sub-periods in each first sub-period.
The discount coefficient is determined according to the service item deployment time length of the cloud resource user, the time period coefficient of various time periods is determined according to the time-sharing charging rule of the service items, the initial unit price, the discount coefficient, the time period coefficient and the usage amount of the service items are integrated, and the cost of the service items charged according to the usage amount is obtained, so that the service items with different deployment time lengths and/or the usage amounts of the service items in different time periods can be charged in a differentiated mode, the charging mode is enriched, and the flexibility of cloud resource charging is improved.
Example two
Fig. 2 is a schematic structural diagram of a cloud resource charging apparatus according to a second embodiment of the present invention. The cloud resource charging method provided by any embodiment of the invention can be realized by applying the metering device.
Referring to fig. 2, the cloud resource billing apparatus includes:
a basic information determining module 210, configured to receive a charging instruction, and determine, according to the charging instruction, a service item deployed by a cloud resource user, a charging period of the service item, and an initial unit price, where the service item is a service item charged according to usage;
a discount coefficient determining module 220, configured to determine at least one discount coefficient of the service item in the charging period according to the deployment duration of the service item, and divide the charging period into at least one first sub-period according to the discount coefficient;
a time interval coefficient and usage determining module 230, configured to divide each first sub-time interval into at least two types of second sub-time intervals based on the time-sharing charging rule of the service item, and determine a time interval coefficient and usage of each type of second sub-time interval in each first sub-time interval;
and the fee determining module 240 is used for determining the fee of the service item according to the initial unit price of the service item, the discount coefficient of at least one first sub-period, and the period coefficient and the usage amount of various second sub-periods in each first sub-period.
Optionally, the basic information determining module includes:
the charging period determining unit is used for acquiring a first period carried in a charging instruction, a deployment period of a service item deployed by a cloud resource user and a price configuration period of the service item; and solving the intersection of the first time interval, the deployment time interval and the price configuration time interval to obtain the charging time interval of the service item.
Optionally, the discount coefficient determining module includes:
a deployment duration determining unit, configured to use a duration from a deployment start time of the service item to each preset time point in the charging period as a deployment duration of each preset time point;
the discount coefficient determining unit is used for determining discount coefficients of all preset time points based on the deployment duration-discount corresponding relation of preset service items;
and the first sub-period dividing unit is used for taking a period formed by time points with the same discount coefficient as a first sub-period to obtain at least one first sub-period.
Optionally, the fee determining module includes:
a current first sub-period selecting unit, configured to select a current first sub-period from at least one first sub-period in sequence;
the first expense obtaining unit is used for obtaining the initial unit price of the service item, the discount coefficient of the current first sub-period, and the product of the period coefficient and the usage amount of each type of second sub-period as first expenses corresponding to each type of second sub-period in the current first sub-period aiming at each type of second sub-period in the current first sub-period;
the second expense obtaining unit is used for summing the first expenses corresponding to various second sub-periods in the current first sub-period to obtain second expenses corresponding to the current first sub-period;
and the charge determining unit is used for summing the second charges to obtain the charge of the service item charged according to the usage amount when the second charges of at least one first sub-period are determined.
Optionally, the service item deployed by the cloud resource user is at least one service item.
Optionally, when the charging instruction is a charging instruction sent by a cloud resource user, the cloud resource charging apparatus further includes:
and the feedback module is used for feeding back the cost to the cloud resource user after determining the cost of the cloud resource user.
Optionally, the basic information determining module is further configured to determine, according to the charging instruction, a service item for per-charge deployed by the cloud resource using party, a charging period of the service item for per-charge, and a number of times of use of the service item for per-charge within the charging period;
the charge determining module is also used for obtaining a third charge according to the initial unit price and the using times of the service items charged according to times; accordingly, the sum of the third fee and the fee of the service item charged by the usage amount is used as the fee of the cloud resource using party.
The cloud resource charging device provided by the embodiment of the invention can execute the cloud resource charging method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method. For details of the technology that are not described in detail, reference may be made to the cloud resource charging method provided in any embodiment of the present invention.
EXAMPLE III
Fig. 3 is a schematic structural diagram of an electronic device according to a third embodiment of the present invention. FIG. 3 illustrates a block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention. The electronic device 12 shown in fig. 3 is only an example and should not bring any limitations to the function and scope of use of the embodiments of the present invention. Device 12 is typically an electronic device that assumes cloud resource billing functionality.
As shown in FIG. 3, electronic device 12 is embodied in the form of a general purpose computing device. The components of electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a memory 28, and a bus 18 that couples the various components (including the memory 28 and the processing unit 16).
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
Electronic device 12 typically includes a variety of computer-readable media. Such media may be any available media that is accessible by electronic device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 28 may include computer device readable media in the form of volatile Memory, such as Random Access Memory (RAM) 30 and/or cache Memory 32. The electronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 3, and commonly referred to as a "hard drive"). Although not shown in FIG. 3, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a Compact disk-Read Only Memory (CD-ROM), a Digital Video disk (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product 40, with program product 40 having a set of program modules 42 configured to carry out the functions of embodiments of the invention. Program product 40 may be stored, for example, in memory 28, and such program modules 42 include, but are not limited to, one or more application programs, other program modules, and program data, each of which examples or some combination may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, mouse, camera, etc., and display), one or more devices that enable a user to interact with electronic device 12, and/or any devices (e.g., network card, modem, etc.) that enable electronic device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the electronic device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), Wide Area Network (WAN), and/or a public Network such as the internet) via the Network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via the bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, Redundant processing units, external disk drive Arrays, disk array (RAID) devices, tape drives, and data backup storage devices, to name a few.
The processor 16 executes various functional applications and data processing by executing the program stored in the memory 28, for example, implementing the cloud resource billing method provided by the above embodiment of the present invention, the method includes:
receiving a charging instruction, and determining service items deployed by a cloud resource user, charging time periods of the service items and an initial unit price according to the charging instruction, wherein the service items are service items charged according to usage; determining at least one discount coefficient of the service item in the charging period according to the deployment duration of the service item, and dividing the charging period into at least one first sub-period according to the discount coefficient; dividing each first sub-period into at least two types of second sub-periods based on the time-sharing charging rule of the service item, and determining the period coefficient and the usage amount of each type of second sub-period in each first sub-period; and determining the cost of the service item charged according to the usage amount according to the initial unit price of the service item, the discount coefficient of at least one first sub-period, and the period coefficient and the usage amount of various second sub-periods in each first sub-period.
Of course, those skilled in the art can understand that the processor may also implement the technical solution of the cloud resource charging method provided in any embodiment of the present invention.
Example four
The fourth embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the cloud resource charging method provided in the fourth embodiment of the present invention is implemented, where the method includes:
receiving a charging instruction, and determining service items deployed by a cloud resource user, charging time periods of the service items and an initial unit price according to the charging instruction, wherein the service items are service items charged according to usage; determining at least one discount coefficient of the service item in the charging period according to the deployment duration of the service item, and dividing the charging period into at least one first sub-period according to the discount coefficient; dividing each first sub-period into at least two types of second sub-periods based on the time-sharing charging rule of the service item, and determining the period coefficient and the usage amount of each type of second sub-period in each first sub-period; and determining the cost of the service item charged according to the usage amount according to the initial unit price of the service item, the discount coefficient of at least one first sub-period, and the period coefficient and the usage amount of various second sub-periods in each first sub-period.
Of course, the computer program stored on the computer-readable storage medium provided in the embodiments of the present invention is not limited to the above method operations, and may also execute the cloud resource charging method provided in any embodiment of the present invention.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor device, apparatus, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution apparatus, device, or apparatus.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution apparatus, device, or apparatus.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, or the like, as well as conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments illustrated herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (9)

1. A cloud resource charging method is characterized by comprising the following steps:
receiving a charging instruction, and determining service items deployed by a cloud resource user, charging time periods of the service items and initial unit prices according to the charging instruction, wherein the service items are service items charged according to usage;
determining at least one discount coefficient of the service item in the charging time interval according to the deployment duration of the service item, and dividing the charging time interval into at least one first sub-time interval according to the discount coefficient; the deployment duration is natural year duration or effective use duration of the service items, wherein the time of using the service items is used as the effective use duration; wherein the discount coefficient is inversely related to the deployment duration of the service item;
dividing each first sub-period into at least two types of second sub-periods based on the time-sharing charging rule of the service item, and determining the period coefficient and the usage amount of each type of second sub-period in each first sub-period;
determining the cost of the service item charged according to the usage amount according to the initial unit price of the service item, the discount coefficient of at least one first sub-period, and the period coefficient and the usage amount of various second sub-periods in each first sub-period;
determining a charging period of a service item deployed by a cloud resource user according to the charging instruction, wherein the charging period comprises the following steps:
acquiring a first time period carried in the charging instruction, a deployment time period of a service item deployed by the cloud resource user and a price configuration time period of the service item;
obtaining the intersection of the first time interval, the deployment time interval and the price configuration time interval to obtain the charging time interval of the service item;
when the charging instruction is a charging instruction triggered according to a charging cycle, the first time interval is a current charging cycle to be charged, and when the charging instruction is a charging instruction sent by the cloud resource user, the first time interval is a time interval defined by the cloud resource user; the deployment time period of the service item is a time period from a deployment starting time point to a deployment ending time point of the service item, and if the deployment ending time point is not available when the cloud resource cost is determined, the time point from the deployment starting time point to the current charging time point is taken as the deployment time period; the price configuration time period of the service item is a time period from a configuration price starting time point to a configuration price ending time point of the service item, and if the configuration price ending time point is not available when the cloud resource cost is determined, the time point from the configuration price starting time point to the current charging time point is used as the price configuration time period.
2. The method of claim 1, wherein the determining at least one discount coefficient of the service item in the charging period according to the deployment duration of the service item, and dividing the charging period into at least one first sub-period according to the discount coefficient comprises:
taking the duration from the deployment starting time of the service item to each preset time point in the charging period as the deployment duration of each preset time point;
determining a discount coefficient of each preset time point based on the deployment duration-discount corresponding relation of the preset service items;
and taking the time period formed by the time points of the same discount coefficient as a first sub-time period to obtain at least one first sub-time period.
3. The method of claim 1, wherein determining the cost of the service item charged by the usage amount according to the initial unit price of the service item, the discount coefficient of at least one first sub-period, and the period coefficient and the usage amount of each type of second sub-period in each first sub-period comprises:
sequentially selecting a current first sub-time period from at least one first sub-time period;
aiming at various second sub-periods in the current first sub-period, calculating the product of the initial unit price of the service item, the discount coefficient of the current first sub-period, the period coefficient of various second sub-periods and the usage amount, and taking the product as the first cost corresponding to various second sub-periods in the current first sub-period;
summing first fees corresponding to various second sub-periods in the current first sub-period to obtain second fees corresponding to the current first sub-period;
and when the second cost of at least one first sub-period is determined, summing the second costs to obtain the cost of the service item charged according to the usage amount.
4. The method according to any one of claims 1-3, wherein the service items deployed by the cloud resource users are at least one service item.
5. The method according to any one of claims 1 to 3, wherein when the charging instruction is a charging instruction sent by a cloud resource user, after the determining a charge of the cloud resource user, further comprising: and feeding back the cost to the cloud resource user.
6. The method of any of claims 1-3, further comprising:
determining service items which are deployed by a cloud resource user and are charged according to the charging instruction, the charging time period of the service items which are charged according to times, and the using times of the service items which are charged according to times in the charging time period;
obtaining a third fee according to the initial unit price and the using times of the service items charged according to times;
correspondingly, the sum of the third fee and the fee of the service item charged according to the usage amount is used as the fee of the cloud resource user.
7. A cloud resource charging apparatus, comprising:
the basic information determining module is used for receiving a charging instruction, and determining service items deployed by a cloud resource user, charging time periods of the service items and initial unit prices according to the charging instruction, wherein the service items are service items charged according to usage;
the discount coefficient determining module is used for determining at least one discount coefficient of the service item in the charging time interval according to the deployment duration of the service item, and dividing the charging time interval into at least one first sub-time interval according to the discount coefficient; the deployment duration is natural year duration or effective use duration of the service items, wherein the time of using the service items is used as the effective use duration; wherein the discount coefficient is inversely related to the deployment duration of the service item;
the time interval coefficient and usage amount determining module is used for dividing each first sub-time interval into at least two types of second sub-time intervals based on the time-sharing charging rule of the service item, and determining the time interval coefficient and usage amount of each type of second sub-time interval in each first sub-time interval;
the fee determining module is used for determining the fee of the service item according to the initial unit price of the service item, the discount coefficient of at least one first sub-period, and the period coefficient and the usage of various second sub-periods in each first sub-period;
wherein the basic information determining module comprises:
a charging period determining unit, configured to obtain a first period carried in the charging instruction, a deployment period of a service item deployed by the cloud resource user, and a price configuration period of the service item;
obtaining the intersection of the first time interval, the deployment time interval and the price configuration time interval to obtain the charging time interval of the service item;
when the charging instruction is a charging instruction triggered according to a charging cycle, the first time interval is a current charging cycle to be charged, and when the charging instruction is a charging instruction sent by the cloud resource user, the first time interval is a time interval defined by the cloud resource user; the deployment time period of the service item is a time period from a deployment starting time point to a deployment ending time point of the service item, and if the deployment ending time point is not available when the cloud resource cost is determined, the time point from the deployment starting time point to the current charging time point is taken as the deployment time period; the price configuration time period of the service item is a time period from a configuration price starting time point to a configuration price ending time point of the service item, and if the configuration price ending time point is not available when the cloud resource cost is determined, the time point from the configuration price starting time point to the current charging time point is used as the price configuration time period.
8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the cloud resource billing method of any of claims 1-6 when executing the program.
9. A computer-readable storage medium on which a computer program is stored, the program, when executed by a processor, implementing the cloud resource billing method according to any of claims 1-6.
CN202010026424.0A 2020-01-10 2020-01-10 Cloud resource charging method and device, electronic equipment and storage medium Active CN111224791B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010026424.0A CN111224791B (en) 2020-01-10 2020-01-10 Cloud resource charging method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010026424.0A CN111224791B (en) 2020-01-10 2020-01-10 Cloud resource charging method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111224791A CN111224791A (en) 2020-06-02
CN111224791B true CN111224791B (en) 2020-12-08

Family

ID=70829370

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010026424.0A Active CN111224791B (en) 2020-01-10 2020-01-10 Cloud resource charging method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111224791B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114629732A (en) * 2020-12-11 2022-06-14 北京金山云网络技术有限公司 Charging method and device for cloud resources, electronic equipment and medium
CN113516507B (en) * 2021-06-16 2024-02-13 国云科技股份有限公司 Multi-cloud management platform resource charging method and device
CN117014238A (en) * 2022-04-29 2023-11-07 华为云计算技术有限公司 Cloud resource charging method and device based on public cloud technology and cloud management platform

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103166989A (en) * 2011-12-13 2013-06-19 中国电信股份有限公司 Resource use metering method and resource use metering system for cloud computing
CN107360006A (en) * 2017-06-12 2017-11-17 北京三快在线科技有限公司 A kind of resource billing method and device
CN107566133A (en) * 2017-10-26 2018-01-09 郑州云海信息技术有限公司 A kind of resource billing method, device and platform
CN109522134A (en) * 2018-12-19 2019-03-26 湖北省楚天云有限公司 A kind of method and apparatus that charging is carried out based on cloud computing platform resource

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9727847B2 (en) * 2011-06-14 2017-08-08 Empire Technology Development Llc Peak-performance-aware billing for cloud computing environment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103166989A (en) * 2011-12-13 2013-06-19 中国电信股份有限公司 Resource use metering method and resource use metering system for cloud computing
CN107360006A (en) * 2017-06-12 2017-11-17 北京三快在线科技有限公司 A kind of resource billing method and device
CN107566133A (en) * 2017-10-26 2018-01-09 郑州云海信息技术有限公司 A kind of resource billing method, device and platform
CN109522134A (en) * 2018-12-19 2019-03-26 湖北省楚天云有限公司 A kind of method and apparatus that charging is carried out based on cloud computing platform resource

Also Published As

Publication number Publication date
CN111224791A (en) 2020-06-02

Similar Documents

Publication Publication Date Title
CN111224791B (en) Cloud resource charging method and device, electronic equipment and storage medium
CN108564269B (en) Distribution task allocation method and device, electronic equipment and computer storage medium
CN110362750B (en) Target user determination method, device, electronic equipment and computer readable medium
JP5986082B2 (en) Reply to the estimated value of search keywords for all accounts
CN114416308A (en) Task scheduling method and device, computer equipment and storage medium
CN109949064B (en) Open interface call charging method and device
CN108241535B (en) Resource management method and device and server equipment
CN113037510A (en) Charging method, charging device and computer readable storage medium
US8122448B2 (en) Estimation method and system
CN111414568B (en) Information display method and device, electronic equipment and storage medium
CN105335537A (en) Estimation method and system of network media information exposure in video album
CN109618070B (en) Call bill charging method, device, equipment and medium
CN115640167A (en) Data backup method and device, electronic equipment and storage medium
CN113780625B (en) User electricity charge prediction method, system, terminal and storage medium
CN103971165A (en) Information processing system and information processing method
CN114240416A (en) Data processing method, data processing device, computer equipment and storage medium
CN116074541B (en) Resource processing method, system, device and electronic equipment
CN112064287A (en) Water use control method and device for washing machine, electronic equipment and storage medium
CN113822690A (en) Advertisement conversion amount determining method and device and related equipment
CN110956686A (en) Rendering bidding method and system
CN112308580A (en) Resource bit providing method, device, equipment and readable storage medium
AU782754B2 (en) Improvements relating to customer billing
KR101508515B1 (en) Method for providing moble application advertisement and server, computer readable medium performing the method
CN117742964A (en) Resource control method, device, equipment and medium
CN111681043A (en) Integral data clearing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 200050 room 8092, No. 1033, Changning Road, Changning District, Shanghai (nominal Floor 9)

Patentee after: Shanghai Nanyang Yunhai Data Technology Co.,Ltd.

Address before: 201800 room j2819, building 1, No. 2222, Huancheng Road, Juyuan new area, Jiading District, Shanghai

Patentee before: Shanghai Yunhai Wanbang Data Technology Co.,Ltd.