CN113037512A - Statistical method and device for network resource consumption and server - Google Patents

Statistical method and device for network resource consumption and server Download PDF

Info

Publication number
CN113037512A
CN113037512A CN202110232982.7A CN202110232982A CN113037512A CN 113037512 A CN113037512 A CN 113037512A CN 202110232982 A CN202110232982 A CN 202110232982A CN 113037512 A CN113037512 A CN 113037512A
Authority
CN
China
Prior art keywords
available resource
resource
machine room
package
packages
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.)
Pending
Application number
CN202110232982.7A
Other languages
Chinese (zh)
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.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Cloud Network Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN202110232982.7A priority Critical patent/CN113037512A/en
Publication of CN113037512A publication Critical patent/CN113037512A/en
Pending legal-status Critical Current

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/1453Methods or systems for payment or settlement of the charges for data transmission involving significant interaction with the data transmission network
    • 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/1453Methods or systems for payment or settlement of the charges for data transmission involving significant interaction with the data transmission network
    • H04L12/1467Methods or systems for payment or settlement of the charges for data transmission involving significant interaction with the data transmission network involving prepayment

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a statistical method, a device and a server for network resource consumption, which are used for receiving instance running information aiming at a target instance; acquiring available resource packages corresponding to the target instance, and if the available resource packages comprise a plurality of available resource packages, determining the consumption sequence of the available resource packages based on the applicable machine room of each available resource package; and updating the residual resource amount of the available resource package according to the consumption sequence and the resource usage amount of the target instance contained in the instance running information. The method is provided with the virtual machine rooms, the virtual machine rooms correspond to the physical machine rooms, and the resource consumption of running examples of the physical machine rooms corresponding to the virtual machine rooms can be deducted when a user purchases resource packages suitable for the virtual machine rooms, so that the user does not need to purchase resource packages in each physical machine room; meanwhile, when the available resource packages comprise a plurality of available resource packages, the consumption sequence of the available resource packages is optimized based on the applicable machine rooms of the resource packages, so that the cost of purchasing and using the resource packages by users is reduced.

Description

Statistical method and device for network resource consumption and server
Technical Field
The invention relates to the technical field of information processing, in particular to a statistical method, a statistical device and a statistical server for network resource consumption.
Background
The advent of resource package systems has provided prepaid capabilities for "log-like" product lines, where resource packages typically include storage packages and traffic packages, etc. that a user can use in a deductive fashion after purchasing resources. In general, most cloud computing manufacturers sell resource packages, and the physical machine rooms actually used by the resource packages must be consistent with the physical machine room opened by the instance, for example: when a user opens an example in the physical machine room A, the user must purchase a resource package which can be used in the physical machine room A when purchasing the resource package, and the resource packages purchasing other physical machine rooms cannot cover the resource usage amount of the physical machine room A; if a user opens an instance in a plurality of physical machine rooms, the user needs to purchase a resource package in each physical machine room, which results in higher cost for the user to purchase and use the resource package.
Disclosure of Invention
The invention aims to provide a statistical method, a statistical device and a statistical server for network resource consumption, which are used for reducing the cost of purchasing and using a resource package by a user.
The invention provides a statistical method of network resource consumption, which comprises the following steps: receiving instance running information for a target instance; the instance running information comprises a first physical machine room for running the target instance and the resource usage of the target instance; acquiring available resource packages corresponding to the target instance, and if the available resource packages comprise a plurality of available resource packages, determining the consumption sequence of the available resource packages based on the applicable machine room of each available resource package; the applicable machine room comprises the first physical machine room or a preset virtual machine room; the virtual machine room is correspondingly provided with: a plurality of physical rooms including the first physical room; updating the remaining resource amount of the available resource package based on the consumption order of the plurality of available resource packages and the resource usage amount of the target instance.
Further, the instance running information further includes an identifier of the available resource packet corresponding to the target instance; the step of obtaining the available resource package corresponding to the target instance comprises: and acquiring the available resource packet corresponding to the identifier of the available resource packet.
Further, if an applicable machine room exists in the available resource packages and is a target available resource package of the virtual machine room, the applicable machine room of the target available resource package is set as the virtual machine room in advance by the following method: creating the target available resource package in response to a creation instruction for the target available resource package; the creating instruction of the target available resource packet comprises specification and price information of the target available resource packet; acquiring identification information of the target available resource packet; and responding to an instruction for determining the vending machine room of the target available resource package as the virtual machine room, and storing the identification information into a function list corresponding to the target available resource package so as to set the applicable machine room of the target available resource package as the virtual machine room.
Further, the available resource packages include a first available resource package and a second available resource package, an applicable machine room of the first available resource package is the first physical machine room, and an applicable machine room of the second available resource package is the virtual machine room; the step of determining the consumption sequence of a plurality of available resource packages based on the applicable machine room of each available resource package if the available resource packages include a plurality of available resource packages comprises: the order of consumption of the first available resource package is prioritized over the order of consumption of the second available resource package.
Further, the available resource packages include a first available resource package and a second available resource package, an applicable machine room of the first available resource package is the first physical machine room, an applicable machine room of the second available resource package is the virtual machine room, and the first available resource package has a higher consumption priority than the second available resource package; the step of updating the remaining resource amount of the available resource package based on the consumption order of the plurality of available resource packages and the resource usage amount of the target instance comprises: consuming an amount of resources of the first available resource package based on the amount of resources used by the target instance; and if the resource usage of the target instance is larger than the resource amount of the first available resource packet, when the remaining resource amount of the first available resource packet is zero, continuously consuming the resource amount of the second available resource packet, and updating the remaining resource amount of the second available resource packet.
Further, the method further comprises: updating the remaining amount of resources of the first available resource package if the resource usage of the target instance is not greater than the amount of resources of the first available resource package.
Further, the number of the available resource packages is one, and an applicable machine room of the available resource packages is the virtual machine room; the step of updating the remaining resource amount of the available resource package based on the consumption order of the plurality of available resource packages and the resource usage amount of the target instance comprises: consuming the amount of resources of the available resource package based on the amount of resources used by the target instance; and updating the residual resource amount of the available resource packet.
Further, after the step of updating the remaining resource amount of the available resource package based on the consumption order of the plurality of available resource packages and the resource usage amount of the target instance, the method further comprises: generating statistical data based on the remaining resource amount of the available resource package; wherein the statistical data is used for counting resource consumption data of the available resource packets; and sending the statistical data to a designated device so that the designated device charges the target instance based on the statistical data.
The invention provides a statistical device for network resource consumption, which comprises: the receiving module is used for receiving the instance running information aiming at the target instance; the instance running information comprises a first physical machine room for running the target instance and the resource usage of the target instance; a determining module, configured to obtain an available resource package corresponding to the target instance, and if the available resource package includes multiple available resource packages, determine a consumption order of the multiple available resource packages based on an applicable machine room of each available resource package; the applicable machine room comprises the first physical machine room or a preset virtual machine room; the virtual machine room is correspondingly provided with: a plurality of physical rooms including the first physical room; and the updating module is used for updating the residual resource amount of the available resource packets based on the consumption sequence of the available resource packets and the resource usage amount of the target instance.
The invention provides a server, which comprises a processor and a memory, wherein the memory stores machine executable instructions capable of being executed by the processor, and the processor executes the machine executable instructions to realize the statistical method of network resource consumption.
The present invention provides a machine-readable storage medium having stored thereon machine-executable instructions that, when invoked and executed by a processor, cause the processor to implement any of the above described statistical methods of network resource consumption.
According to the statistical method, the statistical device and the server for network resource consumption, provided by the invention, the example running information aiming at a target example is received; then obtaining available resource packages corresponding to the target instance, and if the available resource packages comprise a plurality of available resource packages, determining the consumption sequence of the available resource packages based on the applicable machine room of each available resource package; and finally updating the residual resource amount of the available resource packets according to the determined consumption sequence of the plurality of available resource packets and the resource usage amount of the target instance contained in the instance running information. The method is provided with the virtual machine rooms, the virtual machine rooms correspond to the physical machine rooms, and the resource consumption of running examples of the physical machine rooms corresponding to the virtual machine rooms can be deducted when a user purchases resource packages suitable for the virtual machine rooms, so that the user does not need to purchase resource packages in each physical machine room; meanwhile, when the available resource packages comprise a plurality of available resource packages, the consumption sequence of the available resource packages is optimized based on the applicable machine rooms of the resource packages, so that the cost of purchasing and using the resource packages by users is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of a statistical method for network resource consumption according to an embodiment of the present invention;
FIG. 2 is a flowchart of another statistical method for network resource consumption according to an embodiment of the present invention;
FIG. 3 is a flowchart of another statistical method for network resource consumption according to an embodiment of the present invention;
FIG. 4 is a flowchart of another statistical method for network resource consumption according to an embodiment of the present invention;
FIG. 5 is a flowchart of another statistical method for network resource consumption according to an embodiment of the present invention;
FIG. 6 is a flowchart of another statistical method for network resource consumption according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a network resource consumption statistics apparatus according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the following embodiments, and it should be understood that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The log-type product line has two selling modes of real-time payment and post-payment, the resource package system provides prepayment capability for the log-type product line, such as EIP (Elastic IP), CDN (Content Delivery Network) and other products, and a user can use the resource package in a mode of purchasing resources first and then deducting the resources.
In general, most cloud computing manufacturers sell resource packages, and the physical machine rooms actually used by the resource packages must be consistent with the physical machine room opened by the instance, for example: the user opens the example of the Beijing computer lab, and when purchasing the resource package, also must purchase the resource package that can use in the Beijing computer lab, purchase the resource package of other areas and can't compensate the resource usage of the Beijing computer lab. If the user opens the examples in the multiple physical machine rooms, the resource packages need to be purchased in each physical machine room respectively, although the method can meet the use requirements of the user, the flexibility of the selling method of the resource packages is poor, the intelligent degree is low, and the cost for purchasing and using the resource packages by the user is high.
Based on this, the embodiment of the invention provides a statistical method, a statistical device and a server for network resource consumption, and the technology can be applied to mobile terminals, computers and other devices, and especially can be applied to devices capable of performing statistics on network resource consumption.
In order to facilitate understanding of the embodiment, first, a detailed description is given to a statistical method for network resource consumption disclosed in the embodiment of the present invention; as shown in fig. 1, the method comprises the steps of:
step S102, receiving instance running information aiming at a target instance; the instance running information comprises a first physical machine room for running the target instance and the resource usage of the target instance.
Firstly, describing the meaning of an example, the cloud computing may use an operation and development environment of an application program as a service, where the operation and development environment refers to a cloud platform capable of providing resources such as a Central Processing Unit (CPU), a memory, and a disk, which are required when the application program operates, and generally the cloud platform includes a plurality of virtual machines, an application program of an application may be deployed in the virtual machines, and a certain resource may be allocated to the application program, and the application program generally deployed may be referred to as an example of the application; the first physical machine room can be understood as a machine room consisting of real physical servers; the resource usage can be understood as the resource amount consumed by the target instance in operation; in actual implementation, when the network resource consumption condition of the target instance needs to be counted, the instance running information including the first physical machine room running the target instance, the resource usage of the target instance, and the like needs to be received first.
Step S104, obtaining available resource packages corresponding to the target instance, and if the available resource packages comprise a plurality of available resource packages, determining the consumption sequence of the available resource packages based on the applicable machine room of each available resource package; the applicable machine room comprises a first physical machine room or a preset virtual machine room; the virtual machine room corresponds to: a plurality of physical rooms including a first physical room.
The resource package can be understood as a resource amount which can be purchased by a user in advance and has a certain specification and a certain validity period, and the resource amount includes but is not limited to storage amount, flow, request times and the like; the above-mentioned available resource package may be understood as a resource package that can be consumed by the target instance by the amount of resources; the virtual machine room can be understood as a general name of a plurality of physical machine rooms and is a collection of the plurality of physical machine rooms; in actual implementation, the available resource packages corresponding to different instances are usually different, when the network resource consumption condition of a target instance needs to be counted, an available resource package that can be consumed by the target instance needs to be acquired, the number of the available resource packages may be multiple, an applicable machine room of each available resource package may be a first physical machine room, or may be a preset virtual machine room, and a consumption sequence of multiple available resource packages needs to be determined according to the applicable machine room of each available resource package; for example, the number of the available resource packages may be two, where the applicable machine room of one of the available resource packages is the first physical machine room, and the applicable machine room of the other available resource package is the preset virtual machine room, and the determined consumption sequence of the two available resource packages is that the available resource package of the applicable machine room is consumed first, and then the available resource package of the applicable machine room is consumed second. The virtual machine room can have a corresponding relationship with a plurality of other physical machine rooms besides the first physical machine room, and it can also be understood that an applicable machine room provides a resource package of the virtual machine room and a consumable resource amount for running examples of the corresponding other physical machine rooms.
And step S106, updating the residual resource amount of the available resource packets based on the consumption sequence of the plurality of available resource packets and the resource usage amount of the target instance.
The remaining resource amount can be understood as the resource amount remaining after the available resource packet consumes a part of the resource amount; in practical implementation, the remaining resource amount of the available resource packages may be updated based on the determined consumption order of the multiple available resource packages and the received resource amount of the target instance, for example, the number of the available resource packages may be two, and the applicable rooms of the two available resource packages are the first physical room and the virtual room, respectively, the determined consumption order is that the available resource package of the applicable room is consumed first for the first physical room, and then the available resource package of the applicable room is consumed for the preset virtual room, assuming that the resource amount of the target instance is 50M and the resource amounts of the two available resource packages are both 100M, the remaining resource amount of the available resource package of the applicable room is consumed first for the first physical room according to the consumption order of the two resource packages, and the consumed resource amount is 50M, then the remaining resource amount of the available resource package of the applicable room is the first physical room is 100M-50M, which is 50M, since the available resource package with the applicable computer room as the virtual machine room is not consumed, the remaining resource amount of the available resource package with the applicable computer room as the virtual machine room is still 100M.
The embodiment of the invention provides a statistical method for network resource consumption, which comprises the steps of firstly receiving example running information aiming at a target example; then obtaining available resource packages corresponding to the target instance, and if the available resource packages comprise a plurality of available resource packages, determining the consumption sequence of the available resource packages based on the applicable machine room of each available resource package; and finally updating the residual resource amount of the available resource packets according to the determined consumption sequence of the plurality of available resource packets and the resource usage amount of the target instance contained in the instance running information. The method is provided with the virtual machine rooms, the virtual machine rooms correspond to the physical machine rooms, and the resource consumption of running examples of the physical machine rooms corresponding to the virtual machine rooms can be deducted when a user purchases resource packages suitable for the virtual machine rooms, so that the user does not need to purchase resource packages in each physical machine room; meanwhile, when the available resource packages comprise a plurality of available resource packages, the consumption sequence of the available resource packages is optimized based on the applicable machine rooms of the resource packages, so that the cost of purchasing and using the resource packages by users is reduced.
The embodiment of the invention also provides another statistical method for network resource consumption, which is realized on the basis of the method of the embodiment; in the method, the specific process of acquiring the available resource packet corresponding to the target instance is mainly described, and in the method, the instance operation information also comprises an identifier of the available resource packet corresponding to the target instance; the identifier of the available resource packet may be represented by an ID (Identity), or may be represented in other manners, and identifiers of available resource packets corresponding to different instances are usually different, for example, a user opens an IP (Internet Protocol) and a CDN, the IP and the CDN belong to two different instances, and both of the two instances have respective available resource packets, for example, the identifier of the available resource packet corresponding to the IP is 11, and the identifier of the available resource packet corresponding to the CDN is 22; as shown in fig. 2, the method comprises the steps of:
step S202, receiving instance running information aiming at a target instance; the instance running information comprises a first physical machine room for running the target instance and the resource usage of the target instance.
Step S204, the available resource packet corresponding to the identifier of the available resource packet is obtained.
In actual implementation, because the identifiers corresponding to different available resource packages are usually different, the available resource package corresponding to the identifier can be obtained according to the identifier of the available resource package corresponding to the target instance contained in the instance running information; for example, the identifier of the available resource package corresponding to the IP is 11, and the identifier of the available resource package corresponding to the CDN is 22, and the available resource package corresponding to the identifier 11 may be obtained according to the identifier 11, and the available resource package corresponding to the identifier 22 may be obtained according to the identifier 22.
Step S206, if the available resource packages comprise a plurality of available resource packages, determining the consumption sequence of the available resource packages based on the applicable machine room of each available resource package; the applicable machine room comprises a first physical machine room or a preset virtual machine room; the virtual machine room corresponds to: a plurality of physical rooms including a first physical room.
In actual implementation, if an applicable machine room is a target available resource package of a virtual machine room in the available resource packages, the applicable machine room of the target available resource package may be set as the virtual machine room in advance by the following method:
step one, responding to a creation instruction aiming at a target available resource packet, and creating the target available resource packet; the creating instruction of the target available resource packet comprises the specification and price information of the target available resource packet.
The creating instruction can be used for indicating that the available resource package is created, and the creating instruction is generally an instruction sent by a person having the authority of creating the resource package; the specification of the target available resource packet may include a storage size, a traffic size, or a request number of the target available resource packet; in practical implementation, a person having the authority to create the resource package may send a creation instruction for the target available resource package, specifically, the person may create a resource package product line in the commodity system to create the target available resource package, and configure information such as specification and price of the target available resource package at the same time.
And step two, acquiring the identification information of the target available resource packet.
The identification information may be represented by an ID, but may be represented in other ways; in actual implementation, after the target available resource package is created through the first step, the identification information corresponding to the target available resource package is usually automatically generated; when an applicable machine room of a target available resource package needs to be set as a virtual machine room, identification information corresponding to the target available resource package needs to be acquired first.
And step three, responding to an instruction for determining the selling machine room of the target available resource package as the virtual machine room, and storing the identification information into a function list corresponding to the target available resource package so as to set the applicable machine room of the target available resource package as the virtual machine room.
The function list can be understood as a virtual machine room function list, and the function list is generated synchronously after a target available resource package is created; in actual implementation, a person having the authority to create the resource package may send an instruction to determine the vending machine room of the target available resource package as a virtual machine room, for example, the person may select the vending machine room of the target available resource package as a designated general virtual machine room, and click to store the vending machine room; the system bottom layer records the identification information of the target available resource package into the function list, so that the function of the virtual machine room of the target available resource package can be automatically started, and the system bottom layer can also be understood as setting the applicable machine room of the target available resource package as the virtual machine room.
And step S208, updating the residual resource amount of the available resource packages based on the consumption sequence of the plurality of available resource packages and the resource usage amount of the target instance.
The embodiment of the invention provides a statistical method for network resource consumption, which comprises the steps of firstly receiving example running information aiming at a target example; and then acquiring the available resource packet corresponding to the identification of the available resource packet. If the available resource packages comprise a plurality of available resource packages, determining the consumption sequence of the available resource packages based on the applicable machine room of each available resource package; and finally updating the residual resource amount of the available resource packets according to the determined consumption sequence of the plurality of available resource packets and the resource usage amount of the target instance contained in the instance running information. The method is provided with the virtual machine rooms, the virtual machine rooms correspond to the physical machine rooms, and the resource consumption of running examples of the physical machine rooms corresponding to the virtual machine rooms can be deducted when a user purchases resource packages suitable for the virtual machine rooms, so that the user does not need to purchase resource packages in each physical machine room; meanwhile, when the available resource packages comprise a plurality of available resource packages, the consumption sequence of the available resource packages is optimized based on the applicable machine rooms of the resource packages, so that the cost of purchasing and using the resource packages by users is reduced.
The embodiment of the invention also provides another statistical method for network resource consumption, which is realized on the basis of the method of the embodiment; the method focuses on describing a specific process of determining the consumption sequence of a plurality of available resource packages based on the applicable machine room of each available resource package if the available resource packages include a plurality of available resource packages, as shown in fig. 3, the method includes the following steps:
step S302, receiving instance running information aiming at a target instance; the instance running information comprises a first physical machine room for running the target instance and the resource usage of the target instance.
In actual implementation, the instance running information may be sent to the resource package system by the real-time payment system through an interface, the resource package system receives the instance running information, in the instance running information, a first physical machine room for running a target instance is usually represented by a code of the first physical machine room, and in the instance running information, besides the first physical machine room for running the target instance and the resource usage of the target instance, the instance running information usually includes information such as a user ID, an ID of the target instance, and an ID of an available resource package to which the target instance belongs; the user IDs of different users are usually different, that is, the user and the user ID are usually in a one-to-one correspondence relationship; the instance IDs of the different instances are usually different, and each type of instance may correspond to an instance ID, for example, the user opens a host and an IP, the host and the IP belong to two different types of instances, and the two different types of instances may have respective corresponding identifiers, for example, the instance ID corresponding to the host is 1, the instance ID corresponding to the IP is 2, and the like.
Step S304, acquiring an available resource packet corresponding to the target instance; the available resource packages comprise a first available resource package and a second available resource package, an applicable machine room of the first available resource package is a first physical machine room, and an applicable machine room of the second available resource package is a virtual machine room; the virtual machine room corresponds to: a plurality of physical rooms including a first physical room.
In actual implementation, when a user purchases a resource package for a target instance, a first available resource package of which an applicable machine room is only a first physical machine room and a second available resource package of which the applicable machine room is a virtual machine room can be purchased at the same time; the first available resource package can only be operated in a target instance of the first physical machine room to offset corresponding resource amount, the virtual machine room corresponds to a plurality of physical machine rooms including the first physical machine room, specifically, the corresponding relation between the virtual machine room and the plurality of physical machine rooms can be configured in the resource package system manually, the configuration is finished and then clicking is carried out for storage, and the mapping relation is recorded in a machine room mapping relation queue at the bottom layer of the resource package system; for example, taking the virtual machine room corresponding to the EIP as a sub-ethernet machine room, which can support specific physical machine room operation examples in china, malaysia and thailand, because there are various types of physical machine rooms, some physical machine room operation examples are not suitable for consuming resource packages suitable for machine rooms as virtual machine rooms, at this time, these unsuitable physical machine rooms need to be eliminated, and specifically, the virtual machine room needs to be manually associated with the specific physical machine room. The second available resource packet of the applicable machine room as the virtual machine room can provide withstandable resource quantity for the target instance running in the first physical machine room, and can also provide consumable resource quantity for other corresponding instances running in the physical machine rooms.
In this embodiment, after the available resource package corresponding to the target instance is obtained, it is usually determined whether the available resource package includes an available resource package for which an applicable machine room is a virtual machine room, and if the available resource package includes the available resource package for which the machine room is a virtual machine room, the machine room mapping relationship queue is obtained.
In step S306, the consumption order of the first available resource packet is prioritized over the consumption order of the second available resource packet.
In actual implementation, because the first available resource package can only be withheld by the target instance running in the first physical machine room by the corresponding resource amount, and the second available resource package can provide the withheld resource amount for the target instance running in the first physical machine room, and can also provide the consumable resource amount for the corresponding instances running in other physical machine rooms, that is, the applicable range of the first available resource package is smaller than that of the second available resource package, for the target instance, the resource amount of the first available resource package is withheld preferentially, and then the resource amount of the second available resource package is withheld preferentially, that is, in a machine room mapping relation queue at the bottom of the resource package system, the first physical machine room is arranged in front of the virtual machine room, and the available resource packages are sequentially searched and consumed according to the queue order; for example, a user needs to use an IP service, opens an IP address in the beijing area, and purchases two resource packages, where an applicable machine room of the first resource package is a physical machine room of beijing, and an applicable machine room of the second resource package is a asia-pacific general machine room, and when consuming a resource package, the first resource package is usually consumed first, and then the second resource package is consumed.
Usually, a machine room name for displaying is configured for the virtual machine room in the resource package system manually, for example, the machine room name is a sub-general machine room; after the corresponding relation between the virtual machine room and the physical machine room is finished and the machine room name of the virtual machine room is configured, the function setting of the virtual machine room is basically finished, and the resource packages which are suitable for the machine room and are used as the virtual machine room can be sold on line; it should be noted that the virtual machine room may be understood as an identifier, and according to different applications or requirements, the virtual machine room may correspond to different physical machine rooms, and corresponding machine room names may also be different.
Step S308, based on the consumption sequence of the plurality of available resource packages and the resource usage of the target instance, the residual resource amount of the available resource packages is updated.
The embodiment of the invention provides a statistical method for network resource consumption, which comprises the steps of firstly receiving example running information aiming at a target example; then, acquiring an available resource packet corresponding to the target instance; the available resource package comprises a first available resource package and a second available resource package, wherein an applicable machine room of the first available resource package is a first physical machine room, and an applicable machine room of the second available resource package is a virtual machine room; the virtual machine room corresponds to: a plurality of physical machine rooms including a first physical machine room; and, the order of consumption of the first available resource package is prioritized over the order of consumption of the second available resource package. And finally updating the residual resource amount of the available resource packets based on the consumption sequence of the plurality of available resource packets and the resource usage amount of the target instance. The method is provided with the virtual machine rooms, the virtual machine rooms correspond to the physical machine rooms, and the resource consumption of running examples of the physical machine rooms corresponding to the virtual machine rooms can be deducted when a user purchases resource packages suitable for the virtual machine rooms, so that the user does not need to purchase resource packages in each physical machine room; meanwhile, when the available resource packages comprise a plurality of available resource packages, the consumption sequence of the available resource packages is optimized based on the applicable machine rooms of the resource packages, so that the cost of purchasing and using the resource packages by users is reduced.
The embodiment of the invention also provides another statistical method for network resource consumption, which is realized on the basis of the method of the embodiment; the method mainly describes a specific process of updating the residual resource amount of available resource packages based on the consumption sequence of a plurality of available resource packages and the resource usage of a target instance, wherein the available resource packages comprise a first available resource package and a second available resource package, an applicable machine room of the first available resource package is a first physical machine room, an applicable machine room of the second available resource package is a virtual machine room, and the consumption priority of the first available resource package is higher than that of the second available resource package; as shown in fig. 4, the method includes the steps of:
step S402, receiving instance running information aiming at a target instance; the instance running information comprises a first physical machine room for running the target instance and the resource usage of the target instance.
Step S404, obtaining available resource packages corresponding to the target instance, and if the available resource packages comprise a plurality of available resource packages, determining the consumption sequence of the available resource packages based on the applicable machine room of each available resource package; the applicable machine room comprises a first physical machine room or a preset virtual machine room; the virtual machine room corresponds to: a plurality of physical rooms including a first physical room.
Step S406, based on the resource usage of the target instance, the resource usage of the first available resource package is consumed.
In actual implementation, since the first available resource packet has a higher consumption priority than the second available resource packet, the resource amount of the first available resource packet may be preferentially deducted based on the received resource amount consumed by the target instance during running.
Step S408, if the resource usage of the target instance is greater than the resource amount of the first available resource packet, when the remaining resource amount of the first available resource packet is zero, continuously consuming the resource amount of the second available resource packet, and updating the remaining resource amount of the second available resource packet.
If the resource usage of the target instance is greater than the resource amount of the first available resource packet, that is, the resource amount of the first available resource packet is not sufficient to deduct the resource usage of the target instance, the resource amount of the second available resource packet is continuously consumed when the remaining resource amount after the resource amount of the first available resource packet is deducted is zero, for example, if the resource usage of the target instance is 100M, the resource amount of the first available resource packet is 80M, the resource amount of the second available resource packet is 150M, since the resource amount of the target instance is greater than the resource amount of the first available resource packet, the resource amount of the first available resource packet is usually consumed first, that is, 80M is consumed first, and then the remaining 20M is continuously consumed from the second available resource packet, at this time, the remaining resource amount of the second available resource packet is 150M-20M ═ 130M.
In step S410, if the resource usage of the target instance is not greater than the resource usage of the first available resource package, the remaining resource usage of the first available resource package is updated.
If the resource usage of the target instance is not greater than the resource usage of the first available resource package, that is, the resource usage of the first available resource package is sufficient to offset the resource usage of the target instance, only the resource usage of the first available resource package is consumed, and the resource usage of the second available resource package is not consumed; for example, if the resource usage of the target instance is 100M, the resource amount of the first available resource packet is 150M, and the resource amount of the first available resource packet is greater than the resource usage of the target instance, only the resource amount of the first available resource packet is consumed to meet the resource usage requirement of the target instance, that is, 100M of resource amount is consumed from the first available resource packet, and the remaining resource amount in the first available resource packet is 150M-100M — 50M.
The embodiment of the invention provides a statistical method for network resource consumption, which comprises the steps of firstly receiving example running information aiming at a target example; then obtaining available resource packages corresponding to the target instance, and if the available resource packages comprise a plurality of available resource packages, determining the consumption sequence of the available resource packages based on the applicable machine room of each available resource package; consuming the amount of resources of the first available resource package based on the amount of resources used by the target instance; if the resource usage of the target instance is larger than the resource amount of the first available resource packet, when the remaining resource amount of the first available resource packet is zero, continuing to consume the resource amount of the second available resource packet, and updating the remaining resource amount of the second available resource packet; if the resource usage of the target instance is not greater than the resource amount of the first available resource package, the remaining resource amount of the first available resource package is updated. The method is provided with the virtual machine rooms, the virtual machine rooms correspond to the physical machine rooms, and the resource consumption of running examples of the physical machine rooms corresponding to the virtual machine rooms can be deducted when a user purchases resource packages suitable for the virtual machine rooms, so that the user does not need to purchase resource packages in each physical machine room; meanwhile, when the available resource packages comprise a plurality of available resource packages, the consumption sequence of the available resource packages is optimized based on the applicable machine rooms of the resource packages, so that the cost of purchasing and using the resource packages by users is reduced.
In the method, the virtual machine room logic is made on the bottom layer of the resource package system, and one virtual machine room is mapped with one to a plurality of physical machine rooms, so that the function of deducting the resource usage amount of the running examples of one to a plurality of physical machine rooms when a resource package which is suitable for the machine room as the virtual machine room is purchased is realized; meanwhile, the deduction sequence logic is added, the resource packet with the applicable machine room as the physical machine room is consumed firstly, and then the resource packet with the applicable machine room as the virtual machine room is consumed, so that the logic of selling the resource packet according to the virtual machine room is realized; the flexibility of selling the resource packages is improved, and the cost of purchasing and using the resource packages by the user is further reduced.
The embodiment of the invention also provides another statistical method for network resource consumption, which is realized on the basis of the method of the embodiment; the method mainly describes a specific process of updating the residual resource amount of the available resource packages based on the consumption sequence of a plurality of available resource packages and the resource usage of a target instance, wherein in the method, the number of the available resource packages is one, and an applicable machine room of the available resource packages is a virtual machine room; in actual implementation, the number of available resource packages corresponding to a target instance may be multiple or one, if the number of available resource packages is one, an applicable machine room of the available resource packages may be a first physical machine room or a virtual machine room, and for a case where the applicable machine room is the first physical machine room, reference may be made to the prior art, that is, the available resource packages can only be operated in the target instance of the first physical machine room to offset corresponding resource amount; for the case that the applicable machine room is a virtual machine room, the available resource package can provide withstandable resource amount for the target instance running in the first physical machine room, and can also provide consumable resource amount for the corresponding instances running in other physical machine rooms. As shown in fig. 5, the method includes the steps of:
step S502, receiving instance running information aiming at a target instance; the instance running information comprises a first physical machine room for running the target instance and the resource usage of the target instance.
Step S504, obtaining the available resource packages corresponding to the target instance, and if the available resource packages include a plurality of available resource packages, determining the consumption sequence of the available resource packages based on the applicable machine room of each available resource package; the applicable machine room comprises a first physical machine room or a preset virtual machine room; the virtual machine room corresponds to: a plurality of physical rooms including a first physical room.
Step S506, based on the resource usage of the target instance, the resource amount of the available resource package is consumed.
In actual implementation, if the number of the available resource packages corresponding to the obtained target instance is one, and the applicable machine room of the available resource packages is the virtual machine room, that is, the user does not purchase the available resource packages of which the applicable machine room is the first physical machine room, at this time, the available resource packages of which the applicable machine room is the virtual machine room are directly consumed based on the resource usage of the target instance.
Step S508, the remaining resource amount of the available resource package is updated.
When the resource amount in the available resource package of which the applicable machine room is the virtual machine room is consumed, the remaining resource amount of the available resource package can be updated based on the total resource amount of the available resource package; for example, the total resource amount of the available resource package with the applicable machine room as the virtual machine room is 100M, and based on the resource usage of the target instance, the resource amount of the available resource package consumed is 60M, and then the remaining resource amount of the available resource package is 100M-60M — 40M.
The embodiment of the invention provides a statistical method for network resource consumption, which comprises the steps of firstly receiving example running information aiming at a target example; then obtaining available resource packages corresponding to the target instance, and if the available resource packages comprise a plurality of available resource packages, determining the consumption sequence of the available resource packages based on the applicable machine room of each available resource package; and based on the resource usage of the target instance, consuming the resource amount of the available resource packet, and finally updating the residual resource amount of the available resource packet. The method is provided with the virtual machine rooms, the virtual machine rooms correspond to the physical machine rooms, and the resource consumption of running examples of the physical machine rooms corresponding to the virtual machine rooms can be deducted when a user purchases resource packages suitable for the virtual machine rooms, so that the user does not need to purchase resource packages in each physical machine room; meanwhile, when the available resource packages comprise a plurality of available resource packages, the consumption sequence of the available resource packages is optimized based on the applicable machine rooms of the resource packages, so that the cost of purchasing and using the resource packages by users is reduced.
The embodiment of the invention also provides another statistical method for network resource consumption, which is realized on the basis of the method of the embodiment; as shown in fig. 6, the method includes the steps of:
step S602, receiving instance running information aiming at a target instance; the instance running information comprises a first physical machine room for running the target instance and the resource usage of the target instance.
Step S604, obtaining a plurality of available resource packages corresponding to the target instance, and if the available resource packages comprise a plurality of available resource packages, determining the consumption sequence of the plurality of available resource packages based on the applicable machine room of each available resource package; the applicable machine room comprises a first physical machine room or a preset virtual machine room; the virtual machine room corresponds to: a plurality of physical rooms including a first physical room.
Step S606, updating the remaining resource amount of the available resource package based on the consumption order of the plurality of available resource packages and the resource usage amount of the target instance.
Step S608, generating statistical data based on the residual resource amount of the available resource packet; wherein the statistical data is used for counting resource consumption data of the available resource packets.
In actual implementation, after the resource amount of the available resource package is subtracted based on the consumption sequence of the multiple available resource packages and the resource amount of the target instance, statistical data may be generated based on the remaining resource amount of the available resource package, where the statistical data may include resource consumption data such as the consumed resource amount and the remaining resource amount of the available resource package, and if the resource amount of the target instance exceeds the resource amount of the available resource package, the statistical data may also include an exceeded resource amount limit; for example, still taking that the number of the available resource packages may be two, and the applicable machine rooms of the two available resource packages are the first physical machine room and the virtual machine room respectively, according to the determined consumption sequence, the available resource package of the applicable machine room as the first physical machine room is consumed first, and then the available resource package of the applicable machine room as the preset virtual machine room is consumed, assuming that the resource usage of the target instance is 120M, and the resource usage of the two available resource packages is 50M, the statistical data may include the following data: the resource amount consumed by the two available resource packages is 50M, the residual resource amount is 0M, and the exceeding resource amount limit is 120M-50M-20M.
Step S610, sending the statistical data to the designated device, so that the designated device charges the target instance based on the statistical data.
The designated equipment can be a real-time payment system or other equipment capable of charging according to statistical data; in practical implementation, after the consumption of the resource amount in the available resource package is completed, the statistical data is usually fed back to the designated device, if the exceeding resource amount limit is not counted in the statistical data, no extra charge is usually generated, and if the exceeding resource amount limit is counted in the statistical data, the designated device usually performs extra charging based on the exceeding resource amount limit.
The embodiment of the invention provides a statistical method for network resource consumption, which comprises the steps of firstly receiving example running information aiming at a target example; then obtaining available resource packages corresponding to the target instance, and if the available resource packages comprise a plurality of available resource packages, determining the consumption sequence of the available resource packages based on the applicable machine room of each available resource package; and finally updating the residual resource amount of the available resource packets according to the determined consumption sequence of the plurality of available resource packets and the resource usage amount of the target instance contained in the instance running information. Generating statistical data based on the remaining resource amount of the available resource packets; and sending the statistical data to the specified equipment so that the specified equipment charges the target instance based on the statistical data. The method is provided with the virtual machine rooms, the virtual machine rooms correspond to the physical machine rooms, and the resource consumption of running examples of the physical machine rooms corresponding to the virtual machine rooms can be deducted when a user purchases resource packages suitable for the virtual machine rooms, so that the user does not need to purchase resource packages in each physical machine room; meanwhile, when the available resource packages comprise a plurality of available resource packages, the consumption sequence of the available resource packages is optimized based on the applicable machine rooms of the resource packages, so that the cost of purchasing and using the resource packages by users is reduced.
An embodiment of the present invention provides a device for counting network resource consumption, as shown in fig. 7, the device includes: a receiving module 70, configured to receive instance running information for a target instance; the instance running information comprises a first physical machine room for running the target instance and the resource usage of the target instance; a determining module 71, configured to obtain a plurality of available resource packages corresponding to the target instance, and if the available resource packages include multiple available resource packages, determine a consumption order of the multiple available resource packages based on an applicable machine room of each available resource package; the applicable machine room comprises a first physical machine room or a preset virtual machine room; the virtual machine room corresponds to: a plurality of physical machine rooms including a first physical machine room; and an updating module 72, configured to update the remaining resource amount of the available resource package based on the consumption order of the plurality of available resource packages and the resource usage amount of the target instance.
The embodiment of the invention provides a network resource consumption statistical device, which comprises the steps of firstly receiving example running information aiming at a target example; then obtaining available resource packages corresponding to the target instance, and if the available resource packages comprise a plurality of available resource packages, determining the consumption sequence of the available resource packages based on the applicable machine room of each available resource package; and finally updating the residual resource amount of the available resource packets according to the determined consumption sequence of the plurality of available resource packets and the resource usage amount of the target instance contained in the instance running information. The device is provided with a virtual machine room, the virtual machine room corresponds to a plurality of physical machine rooms, and a user can deduct the resource consumption of running examples of the plurality of physical machine rooms corresponding to the virtual machine room when purchasing the resource packages suitable for the virtual machine room, so that the user does not need to purchase the resource packages in each physical machine room; meanwhile, when the available resource packages comprise a plurality of available resource packages, the consumption sequence of the available resource packages is optimized based on the applicable machine rooms of the resource packages, so that the cost of purchasing and using the resource packages by users is reduced.
Further, the instance running information also comprises an identifier of an available resource packet corresponding to the target instance; the determination module 71 is further configured to: and acquiring the available resource packet corresponding to the identifier of the available resource packet.
Further, the apparatus further includes a setting module, and if there is a target available resource package in which the applicable machine room is the virtual machine room in the available resource package, the setting module is configured to: responding to a creating instruction aiming at the target available resource packet, and creating the target available resource packet; the creating instruction of the target available resource packet comprises the specification and price information of the target available resource packet; acquiring identification information of a target available resource packet; and responding to an instruction of determining the selling machine room of the target available resource package as the virtual machine room, and storing the identification information into a function list corresponding to the target available resource package so as to set the applicable machine room of the target available resource package as the virtual machine room.
Further, the available resource packages comprise a first available resource package and a second available resource package, an applicable machine room of the first available resource package is a first physical machine room, and an applicable machine room of the second available resource package is a virtual machine room; if there are more than one available resource package, update module 72 is further configured to: the order of consumption of the first available resource package is prioritized over the order of consumption of the second available resource package.
Furthermore, the available resource packages comprise a first available resource package and a second available resource package, an applicable machine room of the first available resource package is a first physical machine room, an applicable machine room of the second available resource package is a virtual machine room, and the first available resource package has higher consumption priority than the second available resource package; the update module 72 is further configured to: consuming the amount of resources of the first available resource package based on the amount of resources used by the target instance; and if the resource usage of the target instance is larger than the resource amount of the first available resource packet, when the residual resource amount of the first available resource packet is zero, continuously consuming the resource amount of the second available resource packet, and updating the residual resource amount of the second available resource packet.
Further, the apparatus is further configured to: if the resource usage of the target instance is not greater than the resource amount of the first available resource package, the remaining resource amount of the first available resource package is updated.
Furthermore, the number of the available resource packages is one, and the applicable machine room of the available resource packages is a virtual machine room; the update module 72 is further configured to: based on the resource usage of the target instance, consuming the resource amount of the available resource package; the remaining resource amount of the available resource package is updated.
Further, the apparatus is further configured to: generating statistical data based on the remaining resource amount of the available resource packets; the statistical data is used for counting resource consumption data of the available resource packets; and sending the statistical data to the specified equipment so that the specified equipment charges the target instance based on the statistical data.
The implementation principle and the generated technical effect of the statistical device for network resource consumption provided by the embodiment of the present invention are the same as those of the statistical method for network resource consumption described above, and for a brief description, the corresponding content in the statistical method for network resource consumption described above may be referred to where the statistical device for network resource consumption is not mentioned in part.
An embodiment of the present invention further provides a server, as shown in fig. 8, where the server includes a processor 130 and a memory 131, the memory 131 stores machine executable instructions capable of being executed by the processor 130, and the processor 130 executes the machine executable instructions to implement the statistical method for network resource consumption.
Further, the server shown in fig. 8 further includes a bus 132 and a communication interface 133, and the processor 130, the communication interface 133 and the memory 131 are connected through the bus 132.
The Memory 131 may include a high-speed Random Access Memory (RAM) and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 133 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, and the like can be used. The bus 132 may be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 8, but that does not indicate only one bus or one type of bus.
The processor 130 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 130. The Processor 130 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 131, and the processor 130 reads the information in the memory 131 and completes the steps of the method of the foregoing embodiment in combination with the hardware thereof.
The embodiment of the present invention further provides a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are called and executed by a processor, the machine-executable instructions cause the processor to implement the statistical method for network resource consumption, and specific implementation may refer to method embodiments, and is not described herein again.
The statistical method and apparatus for network resource consumption and the computer program product of the server provided in the embodiments of the present invention include a computer-readable storage medium storing program codes, where instructions included in the program codes may be used to execute the method in the foregoing method embodiments, and specific implementations may refer to the method embodiments and are not described herein again.
The functions, if implemented in the form of software functional units 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 invention may be embodied in the form of 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 invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (11)

1. A statistical method of network resource consumption, the method comprising:
receiving instance running information for a target instance; the instance running information comprises a first physical machine room for running the target instance and the resource usage of the target instance;
acquiring available resource packages corresponding to the target instance, and if the available resource packages comprise a plurality of available resource packages, determining the consumption sequence of the available resource packages based on the applicable machine room of each available resource package; the applicable machine room comprises the first physical machine room or a preset virtual machine room; the virtual machine room is correspondingly provided with: a plurality of physical rooms including the first physical room;
updating the remaining resource amount of the available resource package based on the consumption order of the plurality of available resource packages and the resource usage amount of the target instance.
2. The method of claim 1, wherein the instance running information further comprises an identification of the available resource package corresponding to the target instance;
the step of obtaining the available resource package corresponding to the target instance comprises: and acquiring the available resource packet corresponding to the identifier of the available resource packet.
3. The method according to claim 1, wherein if there is an applicable resource package in the available resource packages as a target available resource package of the virtual machine room, an applicable machine room of the target available resource package is set as the virtual machine room in advance by:
creating the target available resource package in response to a creation instruction for the target available resource package; the creating instruction of the target available resource packet comprises specification and price information of the target available resource packet;
acquiring identification information of the target available resource packet;
and responding to an instruction for determining the vending machine room of the target available resource package as the virtual machine room, and storing the identification information into a function list corresponding to the target available resource package so as to set the applicable machine room of the target available resource package as the virtual machine room.
4. The method of claim 1, wherein the available resource packages comprise a first available resource package and a second available resource package, wherein an applicable machine room of the first available resource package is the first physical machine room, and wherein an applicable machine room of the second available resource package is the virtual machine room;
the step of determining the consumption sequence of a plurality of available resource packages based on the applicable machine room of each available resource package if the available resource packages include a plurality of available resource packages comprises: the order of consumption of the first available resource package is prioritized over the order of consumption of the second available resource package.
5. The method of claim 1, wherein the available resource packages comprise a first available resource package and a second available resource package, wherein an applicable room of the first available resource package is the first physical room, wherein an applicable room of the second available resource package is the virtual room, and wherein the first available resource package has a higher consumption priority than the second available resource package;
the step of updating the remaining resource amount of the available resource package based on the consumption order of the plurality of available resource packages and the resource usage amount of the target instance comprises:
consuming an amount of resources of the first available resource package based on the amount of resources used by the target instance;
and if the resource usage of the target instance is larger than the resource amount of the first available resource packet, when the remaining resource amount of the first available resource packet is zero, continuously consuming the resource amount of the second available resource packet, and updating the remaining resource amount of the second available resource packet.
6. The method of claim 5, further comprising:
updating the remaining amount of resources of the first available resource package if the resource usage of the target instance is not greater than the amount of resources of the first available resource package.
7. The method of claim 1, wherein the number of available resource packages is one, and an applicable machine room of the available resource packages is the virtual machine room;
the step of updating the remaining resource amount of the available resource package based on the consumption order of the plurality of available resource packages and the resource usage amount of the target instance comprises:
consuming the amount of resources of the available resource package based on the amount of resources used by the target instance;
and updating the residual resource amount of the available resource packet.
8. The method of claim 1, wherein after the step of updating the remaining amount of resources of the available resource packages based on the consumption order of the plurality of available resource packages and the resource usage of the target instance, the method further comprises:
generating statistical data based on the remaining resource amount of the available resource package; wherein the statistical data is used for counting resource consumption data of the available resource packets;
and sending the statistical data to a designated device so that the designated device charges the target instance based on the statistical data.
9. An apparatus for statistics of network resource consumption, the apparatus comprising:
the receiving module is used for receiving the instance running information aiming at the target instance; the instance running information comprises a first physical machine room for running the target instance and the resource usage of the target instance;
a determining module, configured to obtain an available resource package corresponding to the target instance, and if the available resource package includes multiple available resource packages, determine a consumption order of the multiple available resource packages based on an applicable machine room of each available resource package; the applicable machine room comprises the first physical machine room or a preset virtual machine room; the virtual machine room is correspondingly provided with: a plurality of physical rooms including the first physical room;
and the updating module is used for updating the residual resource amount of the available resource packets based on the consumption sequence of the available resource packets and the resource usage amount of the target instance.
10. A server comprising a processor and a memory, the memory storing machine executable instructions executable by the processor, the processor executing the machine executable instructions to implement the statistical method of network resource consumption of any one of claims 1-8.
11. A machine-readable storage medium having stored thereon machine-executable instructions which, when invoked and executed by a processor, cause the processor to implement the statistical method of network resource consumption of any one of claims 1 to 8.
CN202110232982.7A 2021-03-02 2021-03-02 Statistical method and device for network resource consumption and server Pending CN113037512A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110232982.7A CN113037512A (en) 2021-03-02 2021-03-02 Statistical method and device for network resource consumption and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110232982.7A CN113037512A (en) 2021-03-02 2021-03-02 Statistical method and device for network resource consumption and server

Publications (1)

Publication Number Publication Date
CN113037512A true CN113037512A (en) 2021-06-25

Family

ID=76465587

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110232982.7A Pending CN113037512A (en) 2021-03-02 2021-03-02 Statistical method and device for network resource consumption and server

Country Status (1)

Country Link
CN (1) CN113037512A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023142920A1 (en) * 2022-01-28 2023-08-03 华为云计算技术有限公司 Cloud service billing method and apparatus

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105303400A (en) * 2015-09-30 2016-02-03 腾讯科技(深圳)有限公司 Resource deduction method and device
CN105991694A (en) * 2015-02-05 2016-10-05 阿里巴巴集团控股有限公司 Method and device for realizing distributed service invocation
CN106886847A (en) * 2016-06-22 2017-06-23 阿里巴巴集团控股有限公司 A kind of method for processing resource and device
CN111818509A (en) * 2019-04-12 2020-10-23 中国移动通信集团河南有限公司 Resource conversion method, device and equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105991694A (en) * 2015-02-05 2016-10-05 阿里巴巴集团控股有限公司 Method and device for realizing distributed service invocation
CN105303400A (en) * 2015-09-30 2016-02-03 腾讯科技(深圳)有限公司 Resource deduction method and device
CN106886847A (en) * 2016-06-22 2017-06-23 阿里巴巴集团控股有限公司 A kind of method for processing resource and device
CN111818509A (en) * 2019-04-12 2020-10-23 中国移动通信集团河南有限公司 Resource conversion method, device and equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023142920A1 (en) * 2022-01-28 2023-08-03 华为云计算技术有限公司 Cloud service billing method and apparatus

Similar Documents

Publication Publication Date Title
US20090300608A1 (en) Methods and systems for managing subscriptions for cloud-based virtual machines
WO2019205791A1 (en) Method and device for adjusting data plan for a plurlaity of user identifications
CN107807852B (en) Application program performance control method, device and computer readable storage medium
CN110381455B (en) Flow monitoring processing method and related device and system
CN108846688A (en) A kind of control method, device and electronic equipment that advertisement is launched
CN106302111B (en) Information processing method, terminal and server
CN110839069B (en) Node data deployment method, node data deployment system and medium
CN111404838A (en) Message processing method, device and equipment
CN112395075A (en) Resource processing method and device and resource scheduling system
WO2019019676A1 (en) Service number assigning method and device, computer apparatus, and storage medium
CN111447577A (en) Quota management method and device
CN111641702A (en) Heartbeat message management method and device
CN112202871A (en) Metering and charging method, device and system for cloud computing resources and electronic equipment
CN113015116B (en) Dynamic quota method and device based on flow prediction
CN113037512A (en) Statistical method and device for network resource consumption and server
CN109428733B (en) Method and device for directional flow charging
CN112596985A (en) IT asset detection method, device, equipment and medium
WO2021057981A1 (en) Cloud billing method and apparatus, cloud management platform and system, and storage medium
CN108874805B (en) Data processing method and device
CN110753323B (en) Card resource allocation method and server
CN110262892A (en) A kind of ticketing service dissemination method based on distributed storage data-link, device and data-link node
CN110300000B (en) Charging mode changing method and device, electronic equipment and readable storage medium
CN114493756A (en) Resource management method, device, equipment and storage medium
CN113132928B (en) Charging method and device for video short message service
CN110602665B (en) Method for determining sharing service index based on communication certificate sharing service

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210625