CN113315642A - Resource metering processing method and device and cloud service system - Google Patents

Resource metering processing method and device and cloud service system Download PDF

Info

Publication number
CN113315642A
CN113315642A CN202010734142.6A CN202010734142A CN113315642A CN 113315642 A CN113315642 A CN 113315642A CN 202010734142 A CN202010734142 A CN 202010734142A CN 113315642 A CN113315642 A CN 113315642A
Authority
CN
China
Prior art keywords
resource
metering
value
result
cloud service
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.)
Granted
Application number
CN202010734142.6A
Other languages
Chinese (zh)
Other versions
CN113315642B (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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN202010734142.6A priority Critical patent/CN113315642B/en
Publication of CN113315642A publication Critical patent/CN113315642A/en
Application granted granted Critical
Publication of CN113315642B publication Critical patent/CN113315642B/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/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/1432Metric aspects
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0817Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning

Abstract

The application discloses a resource metering processing method and device and a cloud service system. Wherein, the method comprises the following steps: obtaining a first metering value from a first storage area, wherein the first metering value is metering information of a first resource, and the first resource comprises: reserving exclusive type resources based on user granularity; acquiring a second metering value from a second storage area, wherein the second metering value is metering information of a second resource, and the second resource is the exclusive type resource and the volume charging type resource consumed by a plurality of call requests received by a cloud service system; and determining a target metering result based on the first metering value and the second metering value. The method and the device solve the technical problem that the algorithm change of the resource scheduling system influences the user metering value under the mixed use scene of the reservation mode and the volume mode in the prior art.

Description

Resource metering processing method and device and cloud service system
Technical Field
The application relates to the technical field of computers, in particular to a resource metering processing method and device and a cloud service system.
Background
With the development of cloud services, various large cloud service providers provide cloud service resources such as computing, storage, network and the like for users in various forms, wherein the common forms are a volume mode and a reservation mode, and most cloud products adopt the same metering mode for the volume mode and the reservation mode.
The volume mode and the reservation mode correspond to different application scenes, so that a plurality of cloud products support a volume and reservation mode and simultaneously support a volume and reservation mixed use mode, namely a user can create a batch of reserved resources in advance, and a resource scheduling system at the rear end of the cloud products can forward requests of the user according to a certain scheduling algorithm strategy. The resource scheduling system aims at the factors of highest utilization rate of the whole reserved resources, most cold start eliminating requests and the like, and determines whether to forward the request of a user to the reserved resources or flexibly create a batch of quantitative resources and forward the request to the quantitative resources.
However, according to the conventional metering method, when the metered resources and the reserved resources are mixed for use, the final metering result is the metering value of the user reserved resources and the actual metered resources are accumulated. Namely, under the scene of mixed use of the reservation mode and the volume mode, the optimized behavior of the resource scheduling system influences the metering value of the user, and the principle that the user cost can be expected is broken.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the application provides a processing method and device for resource metering and a cloud service system, and at least solves the technical problem that in the prior art, under the scene of mixed use of a reservation mode and a volume mode, the algorithm change of a resource scheduling system influences a user metering value.
According to an aspect of the embodiments of the present application, there is provided a processing method of resource metering, including: obtaining a first metering value from a first storage area, wherein the first metering value is metering information of a first resource, and the first resource comprises: reserving exclusive type resources based on user granularity; acquiring a second metering value from a second storage area, wherein the second metering value is metering information of a second resource, and the second resource is the exclusive type resource and the volume charging type resource consumed by a plurality of call requests received by a cloud service system; and determining a target metering result based on the first metering value and the second metering value.
According to another aspect of the embodiments of the present application, there is also provided a method for processing resource metering, where the method is applied to a cloud service system, and the cloud service system includes: the system comprises a first database, a second database and a cloud service resource pool, wherein the cloud service resource pool comprises: exclusive type resources and charging type resources according to the amount reserved based on the user granularity; the method comprises the following steps: acquiring a first metering value from the first database, wherein the first metering value is metering information of the exclusive type resource; obtaining a second metering value from the second database, wherein the second metering value is metering information of the exclusive type resources and the amount-based charging type resources consumed by the plurality of call requests received by the cloud service system; and determining a target metering result based on the first metering value and the second metering value.
According to another aspect of the embodiments of the present application, there is also provided a cloud service system, including: the system comprises a charging processing system, a first storage area and a second storage area; the first storage area is configured to store a first metering value, where the first metering value is metering information of a first resource, and the first resource includes: reserving exclusive type resources based on user granularity; the second storage area is configured to store a second metering value, where the second metering value is metering information of a second resource, and the second resource is the exclusive type resource and the volume charging type resource that are consumed by a plurality of call requests received by the cloud service system; the charging processing system is configured to obtain the first measurement value from the first storage area, obtain the second measurement value from the second storage area, and determine a target measurement result based on the first measurement value and the second measurement value.
According to another aspect of the embodiments of the present application, there is also provided a processing apparatus for resource metering, including: a first obtaining module, configured to obtain a first metering value from a first storage area, where the first metering value is metering information of a first resource, and the first resource includes: reserving exclusive type resources based on user granularity; a second obtaining module, configured to obtain a second metering value from a second storage area, where the second metering value is metering information of a second resource, and the second resource is the exclusive type resource and the volume charging type resource that are consumed by multiple call requests received by a cloud service system; and the processing module is used for determining a target metering result based on the first metering value and the second metering value.
According to another aspect of the embodiments of the present application, there is also provided a storage medium, where the storage medium includes a stored program, and when the program runs, the apparatus on which the storage medium is located is controlled to execute any one of the processing methods for resource metering.
According to another aspect of the embodiments of the present application, there is also provided a processor, configured to execute a program, where the program executes any one of the processing methods for resource metering.
In an embodiment of the present application, a first metering value is obtained from a first storage area, where the first metering value is metering information of a first resource, and the first resource includes: reserving exclusive type resources based on user granularity; acquiring a second metering value from a second storage area, wherein the second metering value is metering information of a second resource, and the second resource is the exclusive type resource and the volume charging type resource consumed by a plurality of call requests received by a cloud service system; and determining a target metering result based on the first metering value and the second metering value.
It is easily noted that, in the embodiment of the present application, by storing the first metering value of the first resource in the first storage area, and storing the second metering value of the second resource in the second storage area, and since the second resource is the above-mentioned exclusive type resource and the accounting-by-volume type resource consumed by the multiple invocation requests received by the cloud service system, by obtaining the first metering value from the first storage area and obtaining the second metering value from the second storage area, the target metering result may be determined based on the first metering value and the second metering value.
Therefore, the method and the device achieve the purpose of determining the user metering value without being influenced by the algorithm change of the resource scheduling system under the scene of mixed use of the reservation mode and the metering mode, achieve the technical effect of improving the metering accuracy of the user metering value, and further solve the technical problem that the algorithm change of the resource scheduling system influences the user metering value under the scene of mixed use of the reservation mode and the metering mode in the prior art.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a block diagram of a hardware structure of a computer terminal (or a mobile device) for implementing a processing method for resource metering according to an embodiment of the present application;
FIG. 2 is a flow chart of a processing method of resource metering according to an embodiment of the application;
fig. 3 is a schematic view of an application scenario of an alternative processing method for resource metering according to an embodiment of the present application;
FIG. 4 is a flow chart of an alternative method of processing resource metering according to an embodiment of the present application;
FIG. 5 is a flow chart of an alternative method of processing resource metering according to an embodiment of the present application;
FIG. 6 is a flow chart of another method of processing resource metering according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a cloud service system according to an embodiment of the present application;
FIG. 8 is a schematic structural diagram of a processing apparatus for resource metering according to an embodiment of the present application;
fig. 9 is a block diagram of another computer terminal according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. 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 application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
First, some terms or terms appearing in the description of the embodiments of the present application are applicable to the following explanations:
according to a quantity mode: the cloud service system can temporarily create a batch of resources meeting the user requirements according to the load requested by the user, and after the user request is finished, the system gradually releases idle resources according to a certain algorithm, so that the user only needs to pay for the actually consumed resources. Certain resources are consumed by each request in the quantitative mode, cloud products can be measured independently in the request dimension of a user, and finally measurement aggregation operation is carried out in higher dimensions of the user, a region and the like.
A reservation mode: the method is characterized in that a user manually creates a batch of resources in advance, the resources reside in a cloud service system and only provide services for a creator, the creation and release of the resources are determined by the user, and the user needs to pay for the whole life cycle of reserved resources. The metering value in the reservation mode is closely related to the amount of the reserved resource created by the user and the life cycle of the reserved resource, and if the request of the user consumes the reserved resource, the user does not need to pay for the request additionally.
Metering value: the usage data generated when the user uses the cloud product is used as the original data according to the user fee bill.
And (3) metering particle size: the method refers to the minimum time unit for calculating the metering information by the cloud product side, and the finer the metering granularity is, the more accurate the metering value is.
Generally, a cloud product charges reserved resources purchased by a user and flexibly created resources according to quantity, but in the background technology, it is mentioned that which kind of resources the user requests to forward to is determined by a scheduling system, if the reserved resources are not fully utilized due to a scheduling system algorithm, a condition of multi-charging is generated, meanwhile, a product side scheduling algorithm is also in continuous iterative optimization, and the cost of the user is also influenced by the scheduling algorithm.
Example 1
There is also provided, in accordance with an embodiment of the present application, an embodiment of a method for resource metering, where it is noted that the steps illustrated in the flowchart of the drawings may be performed in a computer system, such as a set of computer-executable instructions, and that, although a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
The method provided by the embodiment 1 of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Fig. 1 shows a hardware block diagram of a computer terminal (or mobile device) for implementing a processing method of resource metering, and as shown in fig. 1, the computer terminal 10 (or mobile device 10) may include one or more processors 102 (shown with 102a, 102b, … …, 102n in the figure) (the processors 102 may include, but are not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission module 106 for communication function. Besides, the method can also comprise the following steps: a display, an input/output interface (I/O interface), a Universal Serial BUS (USB) port (which may be included as one of the ports of the BUS), a network interface, a power source, and/or a camera. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration and is not intended to limit the structure of the electronic device. For example, the computer terminal 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
It should be noted that the one or more processors 102 and/or other data processing circuitry described above may be referred to generally herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part in software, hardware, firmware, or any combination thereof. Further, the data processing circuit may be a single stand-alone processing module, or incorporated in whole or in part into any of the other elements in the computer terminal 10 (or mobile device). As referred to in the embodiments of the application, the data processing circuit acts as a processor control (e.g. selection of a variable resistance termination path connected to the interface).
The memory 104 may be used to store software programs and modules of application software, such as program instructions/data storage devices corresponding to the processing method of resource metering in the embodiment of the present application, and the processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the processing method of resource metering described above is implemented. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmission device 106 can be a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
The display may be, for example, a touch screen type Liquid Crystal Display (LCD) that may enable a user to interact with a user interface of the computer terminal 10 (or mobile device).
In the foregoing operating environment, the present application provides a processing method of resource metering as shown in fig. 2, fig. 2 is a flowchart of a processing method of resource metering according to an embodiment of the present application, and as shown in fig. 2, the processing method of resource metering includes the following method steps:
step S202, obtaining a first metering value from a first storage area, where the first metering value is metering information of a first resource, and the first resource includes: reserving exclusive type resources based on user granularity;
step S204, a second metering value is obtained from a second storage area, wherein the second metering value is metering information of a second resource, and the second resource is the exclusive type resource and the volume charging type resource consumed by a plurality of call requests received by the cloud service system;
in step S206, a target measurement result is determined based on the first measurement value and the second measurement value.
In an embodiment of the present application, a first metering value is obtained from a first storage area, where the first metering value is metering information of a first resource, and the first resource includes: reserving exclusive type resources based on user granularity; acquiring a second metering value from a second storage area, wherein the second metering value is metering information of a second resource, and the second resource is the exclusive type resource and the volume charging type resource consumed by a plurality of call requests received by a cloud service system; and determining a target metering result based on the first metering value and the second metering value.
It is easily noted that, in the embodiment of the present application, by storing the first metering value of the first resource in the first storage area, and storing the second metering value of the second resource in the second storage area, and since the second resource is the above-mentioned exclusive type resource and the accounting-by-volume type resource consumed by the multiple invocation requests received by the cloud service system, by obtaining the first metering value from the first storage area and obtaining the second metering value from the second storage area, the target metering result may be determined based on the first metering value and the second metering value.
Therefore, the method and the device achieve the purpose of determining the user metering value without being influenced by the algorithm change of the resource scheduling system under the scene of mixed use of the reservation mode and the metering mode, achieve the technical effect of improving the metering accuracy of the user metering value, and further solve the technical problem that the algorithm change of the resource scheduling system influences the user metering value under the scene of mixed use of the reservation mode and the metering mode in the prior art.
It should be noted that the processing method for resource metering provided in the embodiment of the present application may be applied to a scenario in which a reservation mode and a volume mode are used in a mixed manner, and specifically, the embodiment of the method may be implemented in a cloud service system (for example, a cloud product metering system), and the cloud service system may not be affected by the change of the resource scheduling system algorithm under the condition that the mixed use of multiple types of resources is balanced.
Optionally, as shown in fig. 3, the cloud service system 300 includes: a charging processing system 301, a first storage area 302, and a second storage area 303. The execution main body of the method embodiment is the charging processing system.
Optionally, the first storage area may be a reserved resource pool, and is configured to store a first metering value; the second storage area may be a resource pool for storing a second metering value; the charging processing system is configured to obtain the first measurement value from the first storage area, obtain the second measurement value from the second storage area, and determine a target measurement result based on the first measurement value and the second measurement value.
Optionally, the first resource includes: the second resource is the exclusive type resource and the volume-based charging type resource, namely the reserved resource and the volume-based resource, which are consumed by the multiple call requests received by the cloud service system. The reserved resources refer to a batch of resources which are manually created in advance by a user (namely a user of the cloud service system) and reside in the cloud service system, the reserved resources only provide services for a creator, the creation and release of the reserved resources are determined by user granularity, and the user needs to pay for the whole life cycle of the reserved resources; the method for using the volume resources as the volume charging type resources includes temporarily creating a batch of resources meeting user requirements according to load requested by a user, and gradually releasing idle volume resources by the cloud service system according to a certain algorithm after the user request is finished.
In a scenario where a reservation mode and a metering mode are used in a mixed manner, different from a manner in the prior art in which a second metering value is obtained by metering only a metering resource, in order to avoid that an optimizable behavior of a resource scheduling system affects a metering value of a user and break through a principle that a user cost can be expected, in the embodiment of the present application, "reservation resource + metering resource" consumed by all invocation requests is metered to obtain the second metering value, and by acquiring a first metering value from a first storage area and a second metering value from a second storage area, a target metering result can be determined based on the first metering value and the second metering value.
In an alternative embodiment, fig. 4 is a flowchart of a processing method of alternative resource metering according to an embodiment of the present application, and as shown in fig. 4, determining the target metering result based on the first metering value and the second metering value includes:
step S302, calculating by using the first metering value and the second metering value to obtain an intermediate result;
step S304, comparing the intermediate result with a preset threshold value to obtain a comparison result;
and S306, selecting a resource usage calculation mode according to the comparison result, and acquiring a target metering result according to the resource usage calculation mode.
Optionally, the intermediate result is a calculation result obtained by performing subtraction operation on the first metering value according to the larger value of the first metering value and the second metering value; the preset threshold may be, but is not limited to, set to 0; it should be noted that other preset thresholds may be selected according to actual situations in the embodiments of the present application, so as to implement the embodiments of the present application.
In the above optional embodiment, since the first metering value is the metering information of the exclusive type resource, the second metering value is the metering information of the exclusive type resource and the volume charging type resource; comparing the first metering value with the second metering value, selecting the larger value of the first metering value and the second metering value, and carrying out subtraction operation on the selected maximum value and the first metering value to obtain an intermediate result; comparing the intermediate result with a preset threshold value, namely judging whether the intermediate result is greater than 0 to obtain a comparison result; and then selecting a resource usage calculation mode according to the comparison result, and acquiring the target metering result according to the resource usage calculation mode.
In an alternative embodiment, as shown in fig. 5, the step S302 of calculating the intermediate result by using the first metric and the second metric may be implemented by the following steps:
s402, comparing the first metering value with the second metering value, and selecting a larger value;
and S404, subtracting the larger value and the first metering value to obtain an intermediate result.
In the above optional embodiment, since the first metering value is the metering information of the exclusive type resource, the second metering value is the metering information of the exclusive type resource and the volume charging type resource; and comparing the first metering value with the second metering value, selecting the larger value of the first metering value and the second metering value, and subtracting the selected maximum value from the first metering value to obtain an intermediate result.
In an alternative embodiment, as shown in fig. 5, in the step S306, the resource usage amount calculation method is selected according to the comparison result, and the target metering result is obtained according to the resource usage amount calculation method, which may be implemented by the following method steps:
step S502, determining that the intermediate result is larger than a preset threshold value according to the comparison result, determining the usage amount of a third resource through the intermediate result and determining the usage amount of the first resource through a first metering value, wherein the third resource is a resource of a metering type;
step S504, the third resource usage and the first resource usage are added to obtain a target metering result.
Optionally, the third resource is the above-mentioned volume charging type resource, that is, volume resource.
In the above optional embodiment, if the comparison result indicates that the intermediate result is greater than 0, determining a third resource usage amount, that is, a resource usage amount of a pay-per-view type, according to the intermediate result, and determining a first resource usage amount, that is, a resource usage amount of an exclusive type, according to the first metering value; and adding the third resource usage amount and the first resource usage amount to obtain the sum of the usage amounts of the pay-per-volume type resource usage amount and the exclusive type resource usage amount, so as to obtain the target metering result.
In an alternative embodiment, as shown in fig. 5, in the step S306, the resource usage amount calculation method is selected according to the comparison result, and the target metering result is obtained according to the resource usage amount calculation method, which may be implemented by the following method steps:
step S602, determining that the intermediate result is less than or equal to a preset threshold value according to the comparison result, determining the usage amount of a third resource through the preset threshold value and determining the usage amount of the first resource through a first metering value, wherein the third resource is the resource of the accounting type according to the amount;
step S604, add the third resource usage amount and the first resource usage amount to obtain a target metering result.
In the above optional embodiment, if the comparison result indicates that the intermediate result is less than or equal to 0, it is determined that the usage amount of the third resource is equal to the preset threshold, that is, it is determined that the usage amount of the third resource is equal to 0; determining a first resource usage amount, namely an exclusive type resource usage amount, according to the first metering value; and adding the first resource usage and the third resource usage to obtain the sum of the usage of the resource of the accounting type and the exclusive type, and obtaining the target metering result.
In the above embodiment, it is determined that the third resource usage amount is equal to 0 by the preset threshold, and the third resource usage amount is added to the first resource usage amount to obtain the target metering result, i.e., the target metering result is substantially equal to the first resource usage amount.
In an optional embodiment, the method further includes:
step S702, determining a bill for the charge by using the target metering result and the pre-configured metering unit price.
In the above embodiment, the cloud service system may determine, based on the target metering result, the fee billing information that is visible to the user in combination with the metering unit price that is pre-configured by the cloud product side.
As an alternative embodiment, as shown in fig. 3, the cloud service system 300 may further push the target metering result to the metering system 400 through the metering processing system, and the metering system 400 is used to determine the bill for the fee according to the target metering result and the pre-configured metering unit price.
In an optional embodiment, the method further includes:
step S802, receiving a creation request, where the creation request is used to create the first resource in the cloud service system, and information carried in the creation request includes: user information;
step S804, in response to the creation request, creating the first resource in a cloud service resource pool of the cloud service system;
step S806, recording a mapping relationship between the user information and the first resource in a distributed resource scheduling system;
step S808, storing the user information, the resource amount of the first resource, and the effective duration of the first resource in the first storage area based on the mapping relationship.
As shown in fig. 3, the cloud service system further includes: a routing service system (such as routing service system 1, routing service system 2, routing service system 3 … … routing service system N shown in fig. 3), a distributed resource scheduling system 304 and a cloud service resource pool 305.
As an alternative embodiment, the clients (such as the client a, the client B, and the client C shown in fig. 3) may send the creation request to the routing service systems (such as the routing service system 1, the routing service system 2, and the routing service system 3 … … routing service system N shown in fig. 3) through the load balancing system 401, where the routing service systems are API service modules of the cloud service systems, and receive and forward the creation request of the clients to the distributed resource scheduling system.
Optionally, the load balancing system is configured to provide a traffic distribution control service for distributing a creation request traffic of a user to multiple cloud service systems according to a predetermined forwarding policy.
Optionally, the distributed resource scheduling system is configured to provide a management task of cloud service resources and a decision task of forwarding a creation request. In the embodiment of the present application, the distributed resource scheduling system may determine, according to a scheduling algorithm, whether to forward a creation request of a user to a reserved resource or to execute the request in a quantitative resource, and meanwhile, the distributed resource scheduling system also undertakes the tasks of creation, release, affiliation, and the like of resources.
In an optional embodiment, the distributed resource scheduling system is configured to receive a creation request and forward the creation request to the cloud service resource pool, where the creation request is used to create the first resource in the cloud service system, and information carried in the creation request includes: user information; specifically, the first resource is created in a cloud service resource pool of the cloud service system in response to the creation request.
Optionally, in the reservation and volume-based mixed mode, the cloud service resource pool may simultaneously manage a first resource and a second resource, where the first resource is divided according to a user dimension or a finer-grained dimension, owned by a creator, and only provides a service for the creator. The volume resources in the volume resource pool are shared by all users in a cluster, and the total volume is dynamically scaled along with the change of the load of the cluster users.
In another optional embodiment, the distributed resource scheduling system is further configured to record a mapping relationship between the user information and the first resource; and storing the user information, the resource amount of the first resource and the effective duration of the first resource in the first storage area based on the mapping relationship.
In an optional embodiment, the method further includes:
step S902, respectively counting the resource amount consumed by each calling request in a metering information collecting system to obtain the second metering value;
step S904 stores the second measurement value in the second storage area.
As an optional embodiment, the cloud service system further includes: the metering information collection system, that is, the metering information collection system 306 shown in fig. 3, is connected to the cloud service resource pool 305, the first storage area 302, and the second storage area 303, and the metering information collection system 306 is configured to count the resource amount consumed by each call request in the metering information collection system, respectively, to obtain the second metering value; and storing the second metering value into the second storage area to provide a metering data source for the metering processing system.
Optionally, in this embodiment of the application, the metering processing system collects metering information of the first storage area and the second storage area, generates a target metering result of an hour, a day, a month, and the like after calculation and aggregation processing, and pushes the target metering result to the metering system, and the metering system determines the bill of charge according to the target metering result and a pre-configured metering unit price.
The following describes in detail an optional resource metering processing method provided in an embodiment of the present application by an optional embodiment, and as shown in fig. 3, the optional resource metering processing method includes:
step S1, the client may decide whether to create reserved resources according to the user requirement;
wherein, if the user needs to create the reserved resource, the number of creating the reserved resource is specified and a creating request is sent. For example, the client a and the client B initiate a creation request for creating reserved resources to the cloud service system.
In step S2, the load balancing system forwards the creation request of the user to a routing service system in the cloud service system.
Step S3, the routing service system forwards the creation request to a distributed resource scheduling system in the cloud service system.
Step S4, when receiving the creation request for creating the reserved resource from the user, the distributed resource scheduling system initiates a request for creating the reserved resource to the cloud service resource pool.
Step S5, after the reserved resource is successfully created in the cloud service resource pool, the resource scheduling system is notified, and the resource scheduling system records the mapping relationship between the user and the reserved resource and persists the mapping relationship to a memory or a database, so as to later determine to forward the request of the user to which part of the reserved instance in the cloud service resource pool.
Step S6, where the distributed resource scheduling system is further configured to record a mapping relationship between the user information and the first resource, and store the user information, the resource amount of the first resource, and the effective duration of the first resource in the first storage area based on the mapping relationship.
It should be noted that the steps S1 to S6 are a flow of steps in which the cloud service system creates reserved resources for the user.
In step S7, the client initiates a call request to the cloud service system.
In step S8, the load balancing system forwards the call request of the user to a routing service system in the cloud service system.
Step S9, the routing service system forwards the call request to a distributed resource scheduling system in the cloud service system.
Step S10, the distributed resource scheduling system determines, according to a certain scheduling algorithm policy, that the call request is forwarded to a virtual machine instance of a reserved resource pool or a quantum resource pool in the cloud service pool for execution, and if it is determined that the call request is forwarded to the quantum resource pool and no idle quantum resource is found in the quantum resource pool, the resource scheduling system requests the cloud service resource pool to temporarily create a batch of quantum resource pools to service the call request.
For example, in the embodiment of the present application, since the client a and the client B initiate a creation request for creating reserved resources to the cloud service system, the call request of the client a and the call request of the client B may be forwarded to the reserved resource pool or the quantum resource pool, but the call request sent by the client is necessarily forwarded to the quantum resource pool.
It should be noted that, for the client a and the client B, even if the reserved resource pool owned by the user is not fully utilized, the distributed resource scheduling system may still forward the request to the measured resource pool.
Step S11, after each call request of the user is finished, the cloud service system counts the resource amount consumed by the call request, namely a target metering result; and uploading the target metering result to a metering information collection system.
It should be noted that, as an alternative embodiment, for the reservation charging mode and the volume charging mode provided by most cloud providers, since the resource consumed by the call request on the reserved resource is the reserved resource owned by the user, and the first metering value of the reserved resource is independent of the call request and only related to the life cycle and the reserved resource volume, and the first metering value is already stored in the first storage area, the metering information collecting system does not collect the first metering value of the request level on the reserved resource (i.e. step S11-2 and step S11-3), and only needs to collect the second metering value of the request level on the volume resource (i.e. step S11-1).
Step S12, the second metering value is persisted to the second storage area through the customization process of the metering information collecting system, and the second storage area stores the second metering value of all the request levels of the user, not only the second metering value of the call request forwarded to the quantum resource.
And step S13, the metering processing system processes the metering tasks at regular time according to a preset period and pushes the metering tasks to the metering system after the metering tasks are processed.
In the embodiment of the application, the metering processing system can determine to process the metering information on line or off line according to the requirements of different cloud products, reserve the metering data source as a first storage area, and meter the data source as a second storage area according to the quantity or the total request.
Step S13-1, the metering processing system pulls the reserved resource usage of a certain metering period from the first storage area; in step S13-2, the metering processing system pulls the usage of the resources in a metering cycle from the second storage area.
And step S14, after the processing of the metering processing system is finished, the final target metering result is pushed to the metering system, and the metering system outputs the cost bill of the user in combination with the metering unit price configured by the cloud product.
Optionally, in this embodiment of the present application, the metering system may be used to determine the bill for the fee according to the target metering result and the pre-configured metering unit price.
According to an embodiment of the present application, there is provided another embodiment of a processing method for resource metering, where the method is applied to a cloud service system, and the cloud service system includes: the system comprises a first database, a second database and a cloud service resource pool, wherein the cloud service resource pool comprises: exclusive type resources and charging type resources according to the amount reserved based on the user granularity; fig. 6 is a flowchart of another processing method for resource metering according to an embodiment of the present application, and as shown in fig. 6, the processing method for resource metering includes the following method steps:
step S1002, obtaining a first metering value from the first database, where the first metering value is metering information of the exclusive type resource;
step S1004, obtaining a second metering value from the second database, where the second metering value is metering information of the exclusive type resource and the amount-based charging type resource consumed by the plurality of invocation requests received by the cloud service system;
step S1006 is to determine a target measurement result based on the first measurement value and the second measurement value.
In the embodiment of the application, a first metering value is obtained from a first database, wherein the first metering value is metering information of an exclusive type resource; acquiring a second metering value from a second database, wherein the second metering value is metering information of exclusive type resources and volume charging type resources consumed by a plurality of call requests received by a cloud service system; and determining a target metering result based on the first metering value and the second metering value.
It is easily noted that, in the embodiment of the present application, by storing the first metering value of the first resource in the first database, and storing the second metering value of the second resource in the second database, and since the second resource is the above-mentioned exclusive type resource and the accounting-by-volume type resource consumed by the multiple invocation requests received by the cloud service system, by obtaining the first metering value from the first database and obtaining the second metering value from the second database, the target metering result may be determined based on the first metering value and the second metering value.
Therefore, the method and the device achieve the purpose of determining the user metering value without being influenced by the algorithm change of the resource scheduling system under the scene of mixed use of the reservation mode and the metering mode, achieve the technical effect of improving the metering accuracy of the user metering value, and further solve the technical problem that the algorithm change of the resource scheduling system influences the user metering value under the scene of mixed use of the reservation mode and the metering mode in the prior art.
It should be noted that the processing method for resource metering provided in the embodiment of the present application may be applied to a scenario in which a reservation mode and a volume mode are used in a mixed manner, and specifically, the embodiment of the method may be implemented in a cloud service system (for example, a cloud product metering system), and the cloud service system may not be affected by the change of the resource scheduling system algorithm under the condition that the mixed use of multiple types of resources is balanced.
Optionally, an execution subject of the method embodiment is the charging processing system, and the cloud service system includes: the system comprises a first database, a second database and a cloud service resource pool, wherein the cloud service resource pool comprises: exclusive type resources and charging by volume type resources reserved based on user granularity.
Optionally, the first database may be a reserved resource database, and is configured to store the first metering value; the second database may be a resource-by-quantity database for storing a second metering value; the charging processing system is configured to obtain the first metering value from the first database, obtain the second metering value from the second database, and determine a target metering result based on the first metering value and the second metering value.
Optionally, the first resource includes: the second resource is the exclusive type resource and the volume-based charging type resource, namely the reserved resource and the volume-based resource, which are consumed by the multiple call requests received by the cloud service system. The reserved resources refer to a batch of resources which are manually created in advance by a user (namely a user of the cloud service system) and reside in the cloud service system, the reserved resources only provide services for a creator, the creation and release of the reserved resources are determined by user granularity, and the user needs to pay for the whole life cycle of the reserved resources; the method for using the volume resources as the volume charging type resources includes temporarily creating a batch of resources meeting user requirements according to load requested by a user, and gradually releasing idle volume resources by the cloud service system according to a certain algorithm after the user request is finished.
In a scenario where a reservation mode and a volume mode are used in a mixed manner, different from a manner in the prior art in which a second metering value is obtained by metering only a volume resource, in order to avoid that an optimizable behavior of a resource scheduling system affects a metering value of a user and break through a principle that user cost can be expected, in the embodiment of the present application, "reservation resource + volume resource" consumed by all invocation requests is metered to obtain the second metering value, and by obtaining the first metering value from the first database and the second metering value from the second database, a target metering result may be determined based on the first metering value and the second metering value.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present application.
Example 2
According to an embodiment of the present application, there is further provided an embodiment of a cloud service system for implementing the processing method for resource metering, fig. 7 is a schematic structural diagram of a cloud service system according to an embodiment of the present application, and as shown in fig. 7, the cloud service system 300 includes: a charging processing system 301, a first storage area 302, and a second storage area 303.
The first storage area 302 is configured to store a first metering value, where the first metering value is metering information of a first resource, and the first resource includes: reserving exclusive type resources based on user granularity; the second storage area 303 is configured to store a second metering value, where the second metering value is metering information of a second resource, and the second resource is the exclusive type resource and the volume charging type resource that are consumed by a plurality of call requests received by the cloud service system; the billing system 301 is configured to obtain the first metering value from the first storage area, obtain the second metering value from the second storage area, and determine a target metering result based on the first metering value and the second metering value.
In an embodiment of the present application, a first metering value is obtained from a first storage area, where the first metering value is metering information of a first resource, and the first resource includes: reserving exclusive type resources based on user granularity; acquiring a second metering value from a second storage area, wherein the second metering value is metering information of a second resource, and the second resource is the exclusive type resource and the volume charging type resource consumed by a plurality of call requests received by a cloud service system; and determining a target metering result based on the first metering value and the second metering value.
It is easily noted that, in the embodiment of the present application, by storing the first metering value of the first resource in the first storage area, and storing the second metering value of the second resource in the second storage area, and since the second resource is the above-mentioned exclusive type resource and the accounting-by-volume type resource consumed by the multiple invocation requests received by the cloud service system, by obtaining the first metering value from the first storage area and obtaining the second metering value from the second storage area, the target metering result may be determined based on the first metering value and the second metering value.
Therefore, the method and the device achieve the purpose of determining the user metering value without being influenced by the algorithm change of the resource scheduling system under the scene of mixed use of the reservation mode and the metering mode, achieve the technical effect of improving the metering accuracy of the user metering value, and further solve the technical problem that the algorithm change of the resource scheduling system influences the user metering value under the scene of mixed use of the reservation mode and the metering mode in the prior art.
Optionally, the first storage area is configured to store a first metering value, for example, a reserved resource pool; the second storage area is used for storing a second metering value, for example, a metering resource pool; the charging processing system is configured to obtain the first measurement value from the first storage area, obtain the second measurement value from the second storage area, and determine a target measurement result based on the first measurement value and the second measurement value.
Optionally, the first resource includes: the second resource is the exclusive type resource and the volume-based charging type resource, namely the reserved resource and the volume-based resource, which are consumed by the multiple call requests received by the cloud service system. The reserved resources refer to a batch of resources which are manually created in advance by a user (namely a user of the cloud service system) and reside in the cloud service system, the reserved resources only provide services for a creator, the creation and release of the reserved resources are determined by the user, and the user needs to pay for the whole life cycle of the reserved resources; the method for using the volume resources as the volume charging type resources includes temporarily creating a batch of resources meeting user requirements according to load requested by a user, and gradually releasing idle volume resources by the cloud service system according to a certain algorithm after the user request is finished.
In a scenario where a reservation mode and a metering mode are used in a mixed manner, different from a manner in the prior art in which a second metering value is obtained by metering only a metering resource, in order to avoid that an optimizable behavior of a resource scheduling system affects a metering value of a user and break through a principle that a user cost can be expected, in the embodiment of the present application, "reservation resource + metering resource" consumed by all invocation requests is metered to obtain the second metering value, and by acquiring a first metering value from a first storage area and a second metering value from a second storage area, a target metering result can be determined based on the first metering value and the second metering value.
In an optional embodiment, the charging processing system is further configured to calculate an intermediate result by using the first metering value and the second metering value; comparing the intermediate result with a preset threshold value to obtain a comparison result; and selecting a resource usage calculation mode according to the comparison result, and acquiring the target metering result according to the resource usage calculation mode.
In an optional embodiment, the charging processing system is further configured to compare the first measurement value with the second measurement value, and select a larger value; and subtracting the larger value from the first metering value to obtain the intermediate result.
Optionally, the intermediate result is a calculation result obtained by performing subtraction operation on the first metering value according to the larger value of the first metering value and the second metering value; the preset threshold may be, but is not limited to, set to 0; it should be noted that other preset thresholds may be selected according to actual situations in the embodiments of the present application, so as to implement the embodiments of the present application.
In the above optional embodiment, since the first metering value is the metering information of the exclusive type resource, the second metering value is the metering information of the exclusive type resource and the volume charging type resource; comparing the first metering value with the second metering value, selecting the larger value of the first metering value and the second metering value, and carrying out subtraction operation on the selected maximum value and the first metering value to obtain an intermediate result; comparing the intermediate result with a preset threshold value, namely judging whether the intermediate result is greater than 0 to obtain a comparison result; and then selecting a resource usage calculation mode according to the comparison result, and acquiring the target metering result according to the resource usage calculation mode.
In an optional embodiment, the charging processing system is further configured to determine, according to the comparison result, that the intermediate result is greater than the preset threshold, determine, according to the intermediate result, a third resource usage amount and determine, according to the first metering value, a first resource usage amount, where the third resource is the volume-based charging type resource; and adding the third resource usage amount and the first resource usage amount to obtain the target metering result.
Optionally, the third resource is the above-mentioned volume charging type resource, that is, volume resource.
In the above optional embodiment, if the comparison result indicates that the intermediate result is greater than 0, determining a third resource usage amount, that is, a resource usage amount of a pay-per-view type, according to the intermediate result, and determining a first resource usage amount, that is, a resource usage amount of an exclusive type, according to the first metering value; and adding the third resource usage amount and the first resource usage amount to obtain the sum of the usage amounts of the pay-per-volume type resource usage amount and the exclusive type resource usage amount, so as to obtain the target metering result.
In an optional embodiment, the charging processing system is further configured to determine, according to the comparison result, that the intermediate result is less than or equal to the preset threshold, determine a third resource usage amount according to the preset threshold, and determine a first resource usage amount according to the first metering value, where the third resource is the charging-by-volume type resource; and adding the third resource usage amount and the first resource usage amount to obtain the target metering result.
In the above optional embodiment, if the comparison result indicates that the intermediate result is less than or equal to 0, it is determined that the usage amount of the third resource is equal to the preset threshold, that is, it is determined that the usage amount of the third resource is equal to 0; determining a first resource usage amount, namely an exclusive type resource usage amount, according to the first metering value; and adding the first resource usage and the third resource usage to obtain the sum of the usage of the resource of the accounting type and the exclusive type, and obtaining the target metering result.
In the above embodiment, it is determined that the third resource usage amount is equal to 0 by the preset threshold, and the third resource usage amount is added to the first resource usage amount to obtain the target metering result, i.e., the target metering result is substantially equal to the first resource usage amount.
In an optional embodiment, the charging processing system is further configured to send the target metering result to a metering system, so that the metering system determines a bill for the fee by using the target metering result and a pre-configured metering unit price.
In the above embodiment, the cloud service system may determine, based on the target metering result, the fee billing information that is visible to the user in combination with the metering unit price that is pre-configured by the cloud product side.
As an alternative embodiment, as shown in fig. 3, the cloud service system 300 may further push the target metering result to the metering system 400 through the metering processing system, and the metering system 400 is used to determine the bill for the fee according to the target metering result and the pre-configured metering unit price.
In an optional embodiment, the system further includes: a distributed resource scheduling system and a cloud service resource pool; the distributed resource scheduling system is configured to receive a creation request and forward the creation request to the cloud service resource pool, where the creation request is used to create the first resource in the cloud service system, and information carried in the creation request includes: user information; recording the mapping relation between the user information and the first resource in a distributed resource scheduling system; and storing the user information, the resource amount of the first resource and the effective duration of the first resource in the first storage area based on the mapping relation; the cloud service resource pool is used for responding to the creation request and creating the first resource.
As shown in fig. 3, the cloud service system further includes: a routing service system (such as routing service system 1, routing service system 2, routing service system 3 … … routing service system N shown in fig. 3), a distributed resource scheduling system 304 and a cloud service resource pool 305.
As an alternative embodiment, the clients (such as the client a, the client B, and the client C shown in fig. 3) may send the creation request to the routing service systems (such as the routing service system 1, the routing service system 2, and the routing service system 3 … … routing service system N shown in fig. 3) through the load balancing system 401, where the routing service systems are API service modules of the cloud service systems, and receive and forward the creation request of the clients to the distributed resource scheduling system.
Optionally, in this embodiment of the application, the load balancing system is configured to provide a traffic distribution control service for distributing a creation request traffic of a user to multiple cloud service systems according to a predetermined forwarding policy.
Optionally, in this embodiment of the application, the distributed resource scheduling system is configured to provide a management task of cloud service resources and a decision task of forwarding a creation request. In the embodiment of the present application, the distributed resource scheduling system may determine, according to a scheduling algorithm, whether to forward a creation request of a user to a reserved resource or to execute the request in a quantitative resource, and meanwhile, the distributed resource scheduling system also undertakes the tasks of creation, release, affiliation, and the like of resources.
Optionally, in the embodiment of the present application, in the reservation and volume-based mixed mode, the cloud service resource pool may simultaneously manage a first resource and a second resource, where the first resource is divided according to a user dimension or a finer-grained dimension, is owned by a creator, and provides a service only for the creator. The volume resources in the volume resource pool are shared by all users in a cluster, and the total volume is dynamically scaled along with the change of the load of the cluster users.
In an optional embodiment, the system further includes: a metering information collection system; the metering information collecting system is used for respectively counting the resource amount consumed by each calling request to obtain the second metering value; and storing the second measurement value in the second storage area.
As an optional embodiment, the cloud service system further includes: the metering information collection system, that is, the metering information collection system 306 shown in fig. 3, is connected to the cloud service resource pool 305, the first storage area 302, and the second storage area 303, and the metering information collection system 306 is configured to count the resource amount consumed by each call request in the metering information collection system, respectively, to obtain the second metering value; and storing the second metering value into the second storage area to provide a metering data source for the metering processing system.
Optionally, in this embodiment of the application, the metering processing system collects metering information of the first storage area and the second storage area, generates a target metering result of an hour, a day, a month, and the like after calculation and aggregation processing, and pushes the target metering result to the metering system, and the metering system determines the bill of charge according to the target metering result and a pre-configured metering unit price.
Example 3
According to an embodiment of the present application, there is further provided an embodiment of a processing apparatus for resource metering for implementing the processing method for resource metering, and fig. 8 is a schematic structural diagram of the processing apparatus for resource metering according to the embodiment of the present application, and as shown in fig. 8, the apparatus includes: a first acquisition module 700, a second acquisition module 702, and a processing module 704, wherein:
a first obtaining module 700, configured to obtain a first metering value from a first storage area, where the first metering value is metering information of a first resource, and the first resource includes: reserving exclusive type resources based on user granularity; a second obtaining module 702, configured to obtain a second metering value from a second storage area, where the second metering value is metering information of a second resource, and the second resource is the exclusive type resource and the volume charging type resource that are consumed by multiple call requests received by the cloud service system; the processing module 704 is configured to determine a target metering result based on the first metering value and the second metering value.
In an embodiment of the present application, a first metering value is obtained from a first storage area, where the first metering value is metering information of a first resource, and the first resource includes: reserving exclusive type resources based on user granularity; acquiring a second metering value from a second storage area, wherein the second metering value is metering information of a second resource, and the second resource is the exclusive type resource and the volume charging type resource consumed by a plurality of call requests received by a cloud service system; and determining a target metering result based on the first metering value and the second metering value.
It is easily noted that, in the embodiment of the present application, by storing the first metering value of the first resource in the first storage area, and storing the second metering value of the second resource in the second storage area, and since the second resource is the above-mentioned exclusive type resource and the accounting-by-volume type resource consumed by the multiple invocation requests received by the cloud service system, by obtaining the first metering value from the first storage area and obtaining the second metering value from the second storage area, the target metering result may be determined based on the first metering value and the second metering value.
Therefore, the method and the device achieve the purpose of determining the user metering value without being influenced by the algorithm change of the resource scheduling system under the scene of mixed use of the reservation mode and the metering mode, achieve the technical effect of improving the metering accuracy of the user metering value, and further solve the technical problem that the algorithm change of the resource scheduling system influences the user metering value under the scene of mixed use of the reservation mode and the metering mode in the prior art.
It should be noted here that the first acquiring module 700, the second acquiring module 702 and the processing module 704 correspond to steps S202 to S206 in embodiment 1, and the modules are the same as the corresponding steps in implementation examples and application scenarios, but are not limited to the disclosure in embodiment 1. It should be noted that the modules described above as a part of the apparatus may be operated in the computer terminal provided in embodiment 1.
It should be further noted that, for a preferred implementation of this embodiment, reference may be made to the relevant description in embodiment 1, and details are not described here again.
Example 4
According to the embodiment of the application, the embodiment of the computer terminal is also provided, and the computer terminal can be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the computer terminal may also be replaced with a terminal device such as a mobile terminal.
Optionally, in this embodiment, the computer terminal may be located in at least one network device of a plurality of network devices of a computer network.
In this embodiment, the computer terminal may execute the program code of the following steps in the processing method for resource metering: obtaining a first metering value from a first storage area, wherein the first metering value is metering information of a first resource, and the first resource comprises: reserving exclusive type resources based on user granularity; acquiring a second metering value from a second storage area, wherein the second metering value is metering information of a second resource, and the second resource is the exclusive type resource and the volume charging type resource consumed by a plurality of call requests received by a cloud service system; and determining a target metering result based on the first metering value and the second metering value.
Optionally, fig. 9 is a block diagram of another structure of a computer terminal according to an embodiment of the present application, and as shown in fig. 9, the computer terminal may include: one or more processors 802 (only one of which is shown), a memory 804, and a peripheral interface 806.
The memory may be configured to store software programs and modules, such as program instructions/modules corresponding to the resource metering processing method and apparatus in the embodiments of the present application, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, the processing method for resource metering described above is implemented. The memory may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory may further include memory located remotely from the processor, and these remote memories may be connected to the computer terminal through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The processor can call the information and application program stored in the memory through the transmission device to execute the following steps: obtaining a first metering value from a first storage area, wherein the first metering value is metering information of a first resource, and the first resource comprises: reserving exclusive type resources based on user granularity; acquiring a second metering value from a second storage area, wherein the second metering value is metering information of a second resource, and the second resource is the exclusive type resource and the volume charging type resource consumed by a plurality of call requests received by a cloud service system; and determining a target metering result based on the first metering value and the second metering value.
Optionally, the processor may further execute the program code of the following steps: calculating by using the first metering value and the second metering value to obtain an intermediate result; comparing the intermediate result with a preset threshold value to obtain a comparison result; and selecting a resource usage calculation mode according to the comparison result, and acquiring the target metering result according to the resource usage calculation mode.
Optionally, the processor may further execute the program code of the following steps: comparing the first metering value with the second metering value, and selecting a larger value; and subtracting the larger value from the first metering value to obtain the intermediate result.
Optionally, the processor may further execute the program code of the following steps: determining that the intermediate result is greater than the preset threshold according to the comparison result, determining a third resource usage amount according to the intermediate result and determining a first resource usage amount according to the first metering value, wherein the third resource is the pay-per-view type resource; and adding the third resource usage amount and the first resource usage amount to obtain the target metering result.
Optionally, the processor may further execute the program code of the following steps: determining that the intermediate result is less than or equal to the preset threshold according to the comparison result, determining a third resource usage amount according to the preset threshold, and determining a first resource usage amount according to the first metering value, wherein the third resource is the pay-per-volume type resource; and adding the third resource usage amount and the first resource usage amount to obtain the target metering result.
Optionally, the processor may further execute the program code of the following steps: and determining a bill of charge by using the target metering result and the pre-configured metering unit price.
Optionally, the processor may further execute the program code of the following steps: receiving a creation request, where the creation request is used to create the first resource in the cloud service system, and information carried in the creation request includes: user information; creating the first resource in a cloud service resource pool of the cloud service system in response to the creation request; recording the mapping relation between the user information and the first resource in a distributed resource scheduling system; and storing the user information, the resource amount of the first resource and the effective duration of the first resource in the first storage area based on the mapping relation.
Optionally, the processor may further execute the program code of the following steps: respectively counting the resource amount consumed by each calling request in a metering information collecting system to obtain the second metering value; and storing the second measurement value in the second storage area.
By adopting the embodiment of the application, a processing scheme for resource metering is provided. Obtaining a first metering value from a first storage area, wherein the first metering value is metering information of a first resource, and the first resource comprises: reserving exclusive type resources based on user granularity; acquiring a second metering value from a second storage area, wherein the second metering value is metering information of a second resource, and the second resource is the exclusive type resource and the volume charging type resource consumed by a plurality of call requests received by a cloud service system; and determining a target metering result based on the first metering value and the second metering value.
It is easily noted that, in the embodiment of the present application, by storing the first metering value of the first resource in the first storage area, and storing the second metering value of the second resource in the second storage area, and since the second resource is the above-mentioned exclusive type resource and the accounting-by-volume type resource consumed by the multiple invocation requests received by the cloud service system, by obtaining the first metering value from the first storage area and obtaining the second metering value from the second storage area, the target metering result may be determined based on the first metering value and the second metering value.
Therefore, the method and the device achieve the purpose of determining the user metering value without being influenced by the algorithm change of the resource scheduling system under the scene of mixed use of the reservation mode and the metering mode, achieve the technical effect of improving the metering accuracy of the user metering value, and further solve the technical problem that the algorithm change of the resource scheduling system influences the user metering value under the scene of mixed use of the reservation mode and the metering mode in the prior art.
It can be understood by those skilled in the art that the structure shown in fig. 9 is only an illustration, and the computer terminal may also be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palmtop computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 9 is a diagram illustrating a structure of the electronic device. For example, the computer terminal may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 9, or have a different configuration than shown in FIG. 9.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
Example 5
According to an embodiment of the present application, there is also provided an embodiment of a storage medium. Optionally, in this embodiment, the storage medium may be configured to store program codes executed by the processing method for resource metering provided in embodiment 1.
Optionally, in this embodiment, the storage medium may be located in any one of computer terminals in a computer terminal group in a computer network, or in any one of mobile terminals in a mobile terminal group.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: obtaining a first metering value from a first storage area, wherein the first metering value is metering information of a first resource, and the first resource comprises: reserving exclusive type resources based on user granularity; acquiring a second metering value from a second storage area, wherein the second metering value is metering information of a second resource, and the second resource is the exclusive type resource and the volume charging type resource consumed by a plurality of call requests received by a cloud service system; and determining a target metering result based on the first metering value and the second metering value.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: calculating by using the first metering value and the second metering value to obtain an intermediate result; comparing the intermediate result with a preset threshold value to obtain a comparison result; and selecting a resource usage calculation mode according to the comparison result, and acquiring the target metering result according to the resource usage calculation mode.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: comparing the first metering value with the second metering value, and selecting a larger value; and subtracting the larger value from the first metering value to obtain the intermediate result.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: determining that the intermediate result is greater than the preset threshold according to the comparison result, determining a third resource usage amount according to the intermediate result and determining a first resource usage amount according to the first metering value, wherein the third resource is the pay-per-view type resource; and adding the third resource usage amount and the first resource usage amount to obtain the target metering result.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: determining that the intermediate result is less than or equal to the preset threshold according to the comparison result, determining a third resource usage amount according to the preset threshold, and determining a first resource usage amount according to the first metering value, wherein the third resource is the pay-per-volume type resource; and adding the third resource usage amount and the first resource usage amount to obtain the target metering result.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: and determining a bill of charge by using the target metering result and the pre-configured metering unit price.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: receiving a creation request, where the creation request is used to create the first resource in the cloud service system, and information carried in the creation request includes: user information; creating the first resource in a cloud service resource pool of the cloud service system in response to the creation request; recording the mapping relation between the user information and the first resource in a distributed resource scheduling system; and storing the user information, the resource amount of the first resource and the effective duration of the first resource in the first storage area based on the mapping relation.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: respectively counting the resource amount consumed by each calling request in a metering information collecting system to obtain the second metering value; and storing the second measurement value in the second storage area.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (20)

1. A processing method of resource metering comprises the following steps:
obtaining a first metering value from a first storage area, wherein the first metering value is metering information of a first resource, and the first resource comprises: reserving exclusive type resources based on user granularity;
acquiring a second metering value from a second storage area, wherein the second metering value is metering information of a second resource, and the second resource is the exclusive type resource and the volume charging type resource consumed by a plurality of call requests received by a cloud service system;
a target metrology result is determined based on the first metrology value and the second metrology value.
2. The method of claim 1, wherein determining the target metering result based on the first metering value and the second metering value comprises:
calculating by using the first metering value and the second metering value to obtain an intermediate result;
comparing the intermediate result with a preset threshold value to obtain a comparison result;
and selecting a resource usage calculation mode according to the comparison result, and acquiring the target metering result according to the resource usage calculation mode.
3. The method of claim 2, wherein calculating the intermediate result using the first metric value and the second metric value comprises:
comparing the first metering value with the second metering value, and selecting a larger value;
and subtracting the larger value from the first metering value to obtain the intermediate result.
4. The method of claim 2, wherein selecting the resource usage calculation method according to the comparison result, and obtaining the target metering result according to the resource usage calculation method comprises:
determining that the intermediate result is greater than the preset threshold value according to the comparison result, determining the usage amount of a third resource according to the intermediate result and determining the usage amount of the first resource according to the first metering value, wherein the third resource is the resource of the metering type;
and adding the third resource usage and the first resource usage to obtain the target metering result.
5. The method of claim 2, wherein selecting the resource usage calculation method according to the comparison result, and obtaining the target metering result according to the resource usage calculation method comprises:
determining that the intermediate result is less than or equal to the preset threshold according to the comparison result, determining the usage amount of a third resource according to the preset threshold and determining the usage amount of the first resource according to the first metering value, wherein the third resource is the resource of the accounting type according to the amount;
and adding the third resource usage and the first resource usage to obtain the target metering result.
6. The method of claim 1, wherein the method further comprises:
and determining a bill of charge by using the target metering result and a pre-configured metering unit price.
7. The method of claim 1, wherein the method further comprises:
receiving a creation request, wherein the creation request is used for creating the first resource in the cloud service system, and information carried in the creation request includes: user information;
creating the first resource in a cloud service resource pool of the cloud service system in response to the creation request;
recording the mapping relation between the user information and the first resource in a distributed resource scheduling system;
and storing the user information, the resource amount of the first resource and the effective duration of the first resource in the first storage area based on the mapping relation.
8. The method of claim 1, wherein the method further comprises:
respectively counting the resource amount consumed by each calling request in a metering information collecting system to obtain a second metering value;
storing the second metering value to the second storage area.
9. A processing method of resource metering is applied to a cloud service system, and the cloud service system comprises: a first database, a second database, and a cloud service resource pool, the cloud service resource pool comprising: exclusive type resources and charging type resources according to the amount reserved based on the user granularity; the method comprises the following steps:
obtaining a first metering value from the first database, wherein the first metering value is metering information of the exclusive type resource;
obtaining a second metering value from the second database, wherein the second metering value is metering information of the exclusive type resource and the volume-based charging type resource consumed by the plurality of call requests received by the cloud service system;
a target metrology result is determined based on the first metrology value and the second metrology value.
10. A cloud service system, comprising: the system comprises a charging processing system, a first storage area and a second storage area;
the first storage area is configured to store a first metering value, where the first metering value is metering information of a first resource, and the first resource includes: reserving exclusive type resources based on user granularity;
the second storage area is configured to store a second metering value, where the second metering value is metering information of a second resource, and the second resource is the exclusive type resource and the volume charging type resource that are consumed by the multiple call requests received by the cloud service system;
the charging processing system is configured to obtain the first metering value from the first storage area, obtain the second metering value from the second storage area, and determine a target metering result based on the first metering value and the second metering value.
11. The system of claim 10, wherein the billing processing system is further configured to calculate an intermediate result using the first metering value and the second metering value; comparing the intermediate result with a preset threshold value to obtain a comparison result; and selecting a resource usage calculation mode according to the comparison result, and acquiring the target metering result according to the resource usage calculation mode.
12. The system of claim 11, wherein the billing processing system is further configured to compare the first metering value with the second metering value, and select the larger value; and subtracting the larger value from the first metering value to obtain the intermediate result.
13. The system of claim 11, wherein the billing processing system is further configured to determine, according to the comparison result, that the intermediate result is greater than the preset threshold, determine a third resource usage amount through the intermediate result, and determine a first resource usage amount through the first metering value, wherein the third resource is the volume-based billing type resource; and adding the third resource usage amount and the first resource usage amount to obtain the target metering result.
14. The system of claim 11, wherein the billing processing system is further configured to determine, according to the comparison result, that the intermediate result is less than or equal to the preset threshold, determine a third resource usage amount through the preset threshold, and determine a first resource usage amount through the first metering value, wherein the third resource is the pay-per-view type resource; and adding the third resource usage amount and the first resource usage amount to obtain the target metering result.
15. The system of claim 10, wherein the billing processing system is further configured to send the target metering result to a metering system to cause the metering system to determine a bill for the fee using the target metering result and a preconfigured metering unit price.
16. The system of claim 10, wherein the system further comprises: a distributed resource scheduling system and a cloud service resource pool;
the distributed resource scheduling system is configured to receive a creation request and forward the creation request to the cloud service resource pool, where the creation request is used to create the first resource in the cloud service system, and information carried in the creation request includes: user information; recording the mapping relation between the user information and the first resource in a distributed resource scheduling system; based on the mapping relation, storing the user information, the resource amount of the first resource and the effective duration of the first resource in the first storage area;
the cloud service resource pool is used for responding to the creation request and creating the first resource.
17. The system of claim 10, wherein the system further comprises: a metering information collection system;
the metering information collecting system is used for respectively counting the resource amount consumed by each calling request to obtain the second metering value; and storing the second metering value to the second storage area.
18. A processing apparatus for resource metering, comprising:
a first obtaining module, configured to obtain a first metering value from a first storage area, where the first metering value is metering information of a first resource, and the first resource includes: reserving exclusive type resources based on user granularity;
a second obtaining module, configured to obtain a second metering value from a second storage area, where the second metering value is metering information of a second resource, and the second resource is the exclusive type resource and the volume charging type resource that are consumed by multiple call requests received by a cloud service system;
a processing module to determine a target metrology result based on the first metrology value and the second metrology value.
19. A storage medium comprising a stored program, wherein when the program is executed, a device in which the storage medium is located is controlled to execute the processing method for resource metering according to any one of claims 1 to 9.
20. A processor for executing a program, wherein the program executes to perform the processing method of resource metering of any one of claims 1 to 9.
CN202010734142.6A 2020-07-27 2020-07-27 Resource metering processing method and device and cloud service system Active CN113315642B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010734142.6A CN113315642B (en) 2020-07-27 2020-07-27 Resource metering processing method and device and cloud service system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010734142.6A CN113315642B (en) 2020-07-27 2020-07-27 Resource metering processing method and device and cloud service system

Publications (2)

Publication Number Publication Date
CN113315642A true CN113315642A (en) 2021-08-27
CN113315642B CN113315642B (en) 2023-03-24

Family

ID=77370631

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010734142.6A Active CN113315642B (en) 2020-07-27 2020-07-27 Resource metering processing method and device and cloud service system

Country Status (1)

Country Link
CN (1) CN113315642B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115225714A (en) * 2022-06-06 2022-10-21 阿里巴巴(中国)有限公司 Resource processing method and system for cloud service

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102567116A (en) * 2010-12-31 2012-07-11 青岛海尔软件有限公司 Cloud computing and virtualization system of digital home
CN102681899A (en) * 2011-03-14 2012-09-19 金剑 Virtual computing resource dynamic management system of cloud computing service platform
CN104320266A (en) * 2014-10-17 2015-01-28 浪潮(北京)电子信息产业有限公司 Charging method and device under cloud computing operation system
CN105592160A (en) * 2015-12-30 2016-05-18 南京邮电大学 Service-consumer-oriented resource configuration method in cloud computing environment
CN106257524A (en) * 2016-05-13 2016-12-28 浙江大学 A kind of charging method of cloud infrastructure services
CN106789118A (en) * 2016-11-28 2017-05-31 上海交通大学 Cloud computing charging method based on service-level agreement
WO2017212338A1 (en) * 2016-06-06 2017-12-14 Alcatel Lucent Method, system and device for online charging in cloud system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102567116A (en) * 2010-12-31 2012-07-11 青岛海尔软件有限公司 Cloud computing and virtualization system of digital home
CN102681899A (en) * 2011-03-14 2012-09-19 金剑 Virtual computing resource dynamic management system of cloud computing service platform
CN104320266A (en) * 2014-10-17 2015-01-28 浪潮(北京)电子信息产业有限公司 Charging method and device under cloud computing operation system
CN105592160A (en) * 2015-12-30 2016-05-18 南京邮电大学 Service-consumer-oriented resource configuration method in cloud computing environment
CN106257524A (en) * 2016-05-13 2016-12-28 浙江大学 A kind of charging method of cloud infrastructure services
WO2017212338A1 (en) * 2016-06-06 2017-12-14 Alcatel Lucent Method, system and device for online charging in cloud system
CN106789118A (en) * 2016-11-28 2017-05-31 上海交通大学 Cloud computing charging method based on service-level agreement

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘征驰等: "云服务环境下的互联网市场结构变迁", 《***工程理论与实践》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115225714A (en) * 2022-06-06 2022-10-21 阿里巴巴(中国)有限公司 Resource processing method and system for cloud service

Also Published As

Publication number Publication date
CN113315642B (en) 2023-03-24

Similar Documents

Publication Publication Date Title
CN110418022B (en) Method and device for adjusting flow package for multiple user identifications
EP3644264A1 (en) Diagnostic device rental method, server, and storage medium
US9544195B1 (en) Bandwidth monitoring for data plans
CN110612779A (en) Enhanced interface for network slice selection based on charging rules
US20150271342A1 (en) Network resource allocation in communication networks
US8396771B2 (en) Using cloud brokering services for an opportunistic cloud offering
CN110839069B (en) Node data deployment method, node data deployment system and medium
CN113315642B (en) Resource metering processing method and device and cloud service system
CN111209060A (en) Capability development platform processing method and device
CN113037510A (en) Charging method, charging device and computer readable storage medium
CN112395075A (en) Resource processing method and device and resource scheduling system
CN112073486A (en) Resource transfer method and device, storage medium and electronic device
CN109151747B (en) Business exchange processing method, operation server and business server
CN114240416A (en) Data processing method, data processing device, computer equipment and storage medium
CN103971165A (en) Information processing system and information processing method
CN114219468A (en) Micro-service charging method and device based on private container cloud and related components
CN111861612B (en) Resource allocation method, device, equipment and medium
CN112737796B (en) Cross-region user communication fee transfer method, device, equipment, medium and product
CN111818471B (en) Resource charging method, MEC management system and MEC host
CN113037512A (en) Statistical method and device for network resource consumption and server
CN116708186A (en) Bandwidth use efficiency determining method and device, electronic equipment and storage medium
CN103326870A (en) Ticket recalculating device and method for on-line charging
WO2024067672A1 (en) Cloud resource charging method, cloud management platform, computing device, and storage medium
KR102608750B1 (en) Automated prepaid phone recharge processing system with online easy payment
KR101090445B1 (en) Network integrated mediation system and method thereof

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40059829

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant