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

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

Info

Publication number
CN110298677B
CN110298677B CN201810238753.4A CN201810238753A CN110298677B CN 110298677 B CN110298677 B CN 110298677B CN 201810238753 A CN201810238753 A CN 201810238753A CN 110298677 B CN110298677 B CN 110298677B
Authority
CN
China
Prior art keywords
charging
data information
period
charging data
user
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810238753.4A
Other languages
Chinese (zh)
Other versions
CN110298677A (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.)
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software 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 China Mobile Communications Group Co Ltd, China Mobile Suzhou Software Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201810238753.4A priority Critical patent/CN110298677B/en
Publication of CN110298677A publication Critical patent/CN110298677A/en
Application granted granted Critical
Publication of CN110298677B publication Critical patent/CN110298677B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0283Price estimation or determination

Landscapes

  • Business, Economics & Management (AREA)
  • Development Economics (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Strategic Management (AREA)
  • Finance (AREA)
  • Game Theory and Decision Science (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a cloud computing resource charging method and device, electronic equipment and a storage medium, which are used for solving the problems of database lock waiting and memory overflow. The method comprises the following steps: in each acquisition period in the current charging period, the cloud computing management platform acquires and analyzes a first resource metering file with the generation time in the acquisition period; storing the analyzed first charging data information to a memory database server; when the throughput is smaller than a preset throughput threshold, obtaining second charging data of the first data volume from the memory database server and writing the second charging data into the database; and when the charging time of the current charging period comes, charging the cloud computing resources used by each user in the current charging period according to the third charging data written into the database. The internal storage database server is used as a buffer, and charging data are put into a warehouse in batches in an idle time period, so that the risks of waiting of a database lock and overflowing of an internal storage due to overlarge throughput are avoided.

Description

Cloud computing resource charging method and device, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of cloud computing, in particular to a method and a device for charging cloud computing resources, electronic equipment and a storage medium.
Background
Currently, the charging methods for the cloud computing resources used by the users in the industry include: a volume charging mode and a packet period charging mode. According to the method for charging according to the amount, the cloud computing management platform needs to analyze the resource metering file of the cloud computing resource used by the user reported by the bottom subsystem, and count the usage amount of the cloud computing resource of each type by the user, so that the cloud computing resource used by the user is charged according to the pricing condition of the cloud computing resource of each type, and the balance of the account of the user is deducted. The time period is fixed according to the packet period charging mode, the cloud computing management platform can calculate the charge generated by the user only according to the time period, and the resource metering file reported by the bottom subsystem does not need to be considered.
With the expansion of the scale of the cloud computing service platform, the data of the resource measurement file reported by the bottom subsystem is increased, and in the face of the current situation, how to solve the problem of realizing the volume charging by summarizing and counting the mass charging data becomes a hot point problem of the current cloud computing management platform.
In the prior art, the cloud computing management platform collects resource metering files by day or hour by using timed tasks for charging. The cloud computing management platform takes days or hours as a time statistic dimension, and the cloud computing management platform collects and counts the use condition of the cloud computing resources of the user.
When a server of a cloud computing management platform collects resource metering files day by day or hour for metering, a resource metering File of a previous hour may be obtained from a File Transfer Protocol (FTP) server or other type of server according to a preset acquisition period, where the acquisition period may be, for example, one hour, and the resource metering File stored in the FTP server or other type of server is reported to the FTP server or other type of server on a bottom-layer subsystem. The resource metering file can reflect the amount of usage of which user for which category of cloud computing resource, and the charging data information in the resource metering file includes the category of the cloud computing resource, identification information of the user, the generation time of the resource metering file, and usage information of the category of cloud computing resource, where the usage information includes at least one of usage amount, usage time, and usage times. After the cloud computing management platform analyzes the resource metering file, batch writing the charging Data in the resource metering file into a database (Data Base, DB).
If charging is carried out according to the hour, the charging period is one hour, the cloud computing management platform uses the hour as a time statistic dimension to carry out summary statistics on the charging data written into the database, and a charging bill is generated according to the pricing condition of each type of cloud computing resources. If the charging is carried out by day, the charging period is one day, and the cloud computing management platform is 24: and 00, summarizing and counting the charging data in the resource metering file of the day stored in the database, and generating a charging bill according to the pricing condition of the cloud computing resources of each category. Typically, the charging period comprises at least one acquisition period.
In terms of time, charging by hours is compared with charging by days, the time dimension of summary statistics is reduced, and the resource condition used by the user is favorably reflected on the deduction of the balance of the user in each acquisition period, namely each hour in real time. According to the service requirement of the charging granularity, the cloud computing management platform can generate a charging bill with the hour as the statistical dimension to the user.
However, regardless of whether the charging is performed by day or by hour, after the resource metering file is acquired from the FTP server or other type of server, the acquired resource metering file needs to be analyzed and then written into the database.
If the data volume of the acquired resource metering file is too much, all analyzed charging data are written into the database at one time, the data throughput is too large, the risk of database lock waiting and memory overflow exists, the normal operation of the cloud computing management platform is influenced, the performance of the cloud computing management platform is reduced, and the user experience is reduced.
Disclosure of Invention
The embodiment of the invention discloses a cloud computing resource charging method, a cloud computing resource charging device, electronic equipment and a storage medium, which are used for solving the problems that in the prior art, when charging is carried out on cloud computing resources used by a user, all obtained and analyzed charging data are written into a database at one time, the data throughput is overlarge, the database is locked and waits, and a memory overflows.
In order to achieve the above object, an embodiment of the present invention discloses a method for charging cloud computing resources, where the method includes:
in each acquisition period in the current charging period, the cloud computing management platform acquires and analyzes a first resource metering file with the generation time in the acquisition period; storing the analyzed first charging data information of the first resource metering file to a memory database server;
in the current charging period, when the throughput of the database is smaller than a preset throughput threshold, according to a preset first data volume, obtaining second charging data information of the first data volume from a memory database server and writing the second charging data information into the database;
and when the charging time of the current charging period comes, charging the cloud computing resources used by each user in the current charging period according to the third charging data information written into the database.
Through the description, after the first resource metering file in each acquisition cycle is obtained and analyzed, the first resource metering file is not directly stored in the database, but is firstly stored in the memory database server, and when the throughput of the database is identified to be smaller than the preset throughput threshold, the charging data information is obtained from the memory database server in batches according to the preset first data volume and is written into the database. The internal storage database server is used as a buffer, and the charging data information is put into a storage in a batch mode in an idle time period, so that the risks of database lock waiting and internal storage overflow caused by overlarge throughput of the database are avoided.
Further, before storing the parsed first charging data information to the in-memory database server, the method further includes:
identifying whether the first charging data information contains first sub-charging data information belonging to the hotspot user or not according to a prestored hotspot user;
if yes, the step of storing the analyzed first charging data information to the memory database server comprises the following steps:
and storing the first sub-charging data information to a memory database server.
Further, if the first charging data message includes a second sub-charging data message belonging to a non-hotspot user, the method further includes:
writing the second sub-charging data information into a database;
and when the charging moment of the current charging period comes, according to the fourth charging data information written into the database, performing charging processing on the cloud computing resources used by each user in the current charging period, wherein the hot point users have more charging data information than the non-hot point users.
By separating the hotspot user and the non-hotspot user, aiming at the non-hotspot user with less charging data information, in order to avoid resource waste of the memory database server, the charging data information of the non-hotspot user can be directly written into the database, the processing of storing the charging data information to the memory database server is not carried out, and only the second sub-charging data information belonging to the non-hotspot user is directly written into the database.
Further, after obtaining second charging data information of the first data volume from the in-memory database server according to a preset first data volume and writing the second charging data information into the database, before performing charging processing on cloud computing resources used by each user in a current charging period according to third charging data information written into the database, the method further includes:
judging whether the second charging data information of the first data volume contains fifth charging data information of which the generation time is positioned in the last charging period of the current charging period or not;
if not, carrying out the subsequent steps;
if so, filtering the fifth charging data information, taking the charging data information except the fifth charging data information in the third charging data information as the third charging data information, and performing the subsequent steps.
In the scheme of the invention, the times and time that the throughput of the cloud computing management platform is less than the preset throughput threshold value in a certain charging period may not be enough to support the cloud computing management platform to write all the charging data information acquired in the current charging period cached in the memory database server into the database of the cloud computing management platform, and the charging data information with the time in each charging period is definitely determined by determining whether the current charging period contains the last charging data information before charging, so that the charging accuracy of each charging period is improved.
Further, if the second charging data information of the first data amount includes fifth charging data information whose generation time is in a previous charging period of the current charging period, the method further includes:
and updating the charging of the cloud computing resources used by the user in the last charging period according to the fifth charging data information.
And updating the charging in the previous charging period according to the charging data information of which the generation time is positioned in the previous charging, so that the charging accuracy of each charging period is improved.
Further, the method further comprises:
in the current charging period, judging whether the bottom-bound statistical time of the charging data information of the last charging period of the current charging period is reached;
if so, acquiring and analyzing a second resource metering file with the generation time in the last charging period;
writing the analyzed sixth charging data information of the second resource metering file into a database;
and according to the sixth charging data information written into the database, performing charging update on the cloud computing resources used by each user in the last charging period.
In order to avoid delayed reporting of a bottom subsystem and inaccurate charging when wrong billing is carried out, a bottom-bound statistic mode is adopted to acquire and analyze a second resource metering file with the generation time in the last charging period, the charging condition of the charging period is updated, and the charging accuracy is achieved to the maximum extent.
Further, the process of predetermining the hotspot user and the non-hotspot user comprises:
for each user, judging whether a second data volume of seventh charging data information of the user in a preset time period is larger than a preset data volume threshold value;
if so, determining that the user is the hotspot user;
if not, determining that the user is a non-hotspot user.
By the aid of the real-time dynamic hot spot user and non-hot spot user determination method, waste of manpower is reduced, and user experience is provided.
Further, obtaining the resource metering file comprises:
and the resource timing task of each category acquires the resource metering file of the corresponding category from a preset server.
The resource timing task of each type obtains the resource metering file of the corresponding type from the FTP server or other types of servers, and the efficiency of thread concurrent processing is improved.
The embodiment of the invention discloses electronic equipment, which comprises: a processor, a memory, and a transceiver;
the transceiver is used for acquiring a first resource metering file with the generation time in each acquisition period in the current charging period under the control of the processor;
the processor is used for reading the program in the memory and executing the following processes: analyzing a first resource metering file with the generation time in the acquisition period; storing the analyzed first charging data information of the first resource metering file to a memory database server; in the current charging period, when the throughput of the database is smaller than a preset throughput threshold, according to a preset first data volume, obtaining second charging data information of the first data volume from a memory database server and writing the second charging data information into the database; and when the charging time of the current charging period comes, charging the cloud computing resources used by each user in the current charging period according to the third charging data information written into the database.
Further, the processor is further configured to identify whether the first charging data information includes first sub-charging data information belonging to the hotspot user according to a prestored hotspot user before storing the analyzed first charging data information in the memory database server; if yes, the first sub-charging data information is stored in a memory database server.
Further, the processor is further configured to write second sub-charging data information into a database if the first charging data information includes second sub-charging data information belonging to a non-hotspot user; and when the charging moment of the current charging period comes, according to the fourth charging data information written into the database, performing charging processing on the cloud computing resources used by each user in the current charging period, wherein the hot point users have more charging data information than the non-hot point users.
Further, the processor is further configured to, after obtaining second charging data information of the first data volume from a memory database server according to a preset first data volume and writing the second charging data information into a database, determine whether the second charging data information of the first data volume includes fifth charging data information whose generation time is located in a previous charging period of the current charging period before performing charging processing on cloud computing resources used by each user in the current charging period according to third charging data information written into the database; if not, carrying out the subsequent steps; if so, filtering the fifth charging data information, taking the charging data information except the fifth charging data information in the third charging data information as the third charging data information, and performing the subsequent steps.
Further, if the second charging data information of the first data volume includes fifth charging data information whose generation time is in a previous charging period of the current charging period, the processor is further configured to perform charging update on the cloud computing resource used by the user in the previous charging period according to the fifth charging data information.
Further, the processor is further configured to determine, in a current charging period, whether a bottom-bound statistical time for charging data information of a previous charging period of the current charging period is reached; if so, acquiring and analyzing a second resource metering file with the generation time in the last charging period; writing the analyzed sixth charging data information of the second resource metering file into a database; and according to the sixth charging data information written into the database, performing charging update on the cloud computing resources used by each user in the last charging period.
Further, the processor is further configured to determine, for each user, whether a second data volume of seventh charging data information of the user in a preset time period is greater than a preset data volume threshold; if so, determining that the user is the hotspot user; if not, determining that the user is a non-hotspot user.
Further, the processor is specifically configured to obtain the resource metering file of the corresponding category from a preset server by the resource timing task of each category.
The embodiment of the invention discloses a device for charging cloud computing resources, which comprises:
the first acquisition module is used for acquiring a first resource metering file with the generation time in each acquisition period in the current charging period;
the analysis module is used for analyzing the first charging data information in the first resource metering file;
the storage module is used for storing the analyzed first charging data information to the memory database server;
the second obtaining module is used for obtaining second charging data information of the first data volume from the memory database server according to the preset first data volume when the throughput of the database is smaller than a preset throughput threshold value in the current charging period;
the writing module is used for writing the second charging data information of the first data volume into the database;
and the charging module is used for charging the cloud computing resources used by each user in the current charging period according to the third charging data information written into the database when the charging time of the current charging period comes.
The embodiment of the invention discloses electronic equipment, which comprises: the system comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus;
the memory has stored therein a computer program which, when executed by the processor, causes the processor to perform the steps of any of the methods.
An embodiment of the invention discloses a computer-readable storage medium storing a computer program executable by an electronic device, the program causing the electronic device to perform any of the steps of the method when the program is run on the electronic device.
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, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic diagram of a cloud computing resource charging process according to embodiment 1 of the present invention;
fig. 2 is a schematic diagram of a process of entering charging data information by a hotspot user according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a process of charging data information storage by a non-hotspot user according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating a bottom pocket statistics process according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a process of charging cloud computing resources according to an embodiment of the present invention;
fig. 6 is an electronic device according to an embodiment of the present invention;
fig. 7 is a structural diagram of an apparatus for charging cloud computing resources according to an embodiment of the present invention;
fig. 8 is an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the 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 invention.
Example 1:
fig. 1 is a schematic diagram of a process of charging cloud computing resources according to embodiment 1 of the present invention, where the process includes the following steps:
s101: in each acquisition period in the current charging period, the cloud computing management platform acquires and analyzes a first resource metering file with the generation time in the acquisition period; and storing the analyzed first charging data information of the first resource metering file to a memory database server.
The cloud computing resource charging method provided by the embodiment of the invention is applied to a cloud computing management platform, and is particularly applied to electronic equipment provided with the cloud computing management platform.
The user uses the cloud computing resources, and the cloud computing management platform can perform charging processing on the cloud computing resources used by the user. When the charging is performed, the charging bill condition can be embodied in each day or each hour or even every minute according to the requirement of the user, and the time period in which the charging bill condition is embodied is called a charging period.
To implement charging, charging data information should be obtained first, and the charging data information is located in the resource metering file, that is, the resource metering file should be obtained first. When acquiring the resource measurement file, the cloud computing management platform generally acquires the resource measurement file according to a preset time interval, that is, according to a set period, which is called an acquisition period. The charging period may be the same as the acquisition period, that is, after the resource metering file is acquired each time, the charging may be performed, or the charging period may include a plurality of acquisition periods, after the resource metering file is acquired each time, the resource metering file may be accumulated and stored first, and when the charging time of the charging period is reached, the charging processing of the charging period is performed according to the resource metering data in the resource metering file accumulated and stored in the current charging period.
Each charging period and each acquisition period in each charging period are pre-stored in the cloud computing management platform.
In the current charging period, for each acquisition period, the cloud computing management platform acquires a resource metering file belonging to the acquisition period, "belonging" may be understood as that the generation time of the resource metering file is located in a time period corresponding to the acquisition period, that is, when the acquisition time of each acquisition period comes, the cloud computing management platform acquires the resource metering file whose generation time is located in the acquisition period, and the resource metering file acquired in each acquisition period is referred to as a first resource metering file.
When the user uses the cloud computing resources, the underlying subsystems of the cloud computing resources can report the cloud computing resources used by the user to the FTP server or other types of servers in the form of resource metering files.
The cloud computing management platform pre-stores identification information of a destination server for acquiring the resource metering file, and when the resource metering file is acquired, the resource metering file may be acquired from the preset server according to the stored identification information of the destination server, and the preset server may be an FTP server or other types of servers. In each acquisition cycle, the cloud computing management platform sends a resource metering file acquisition request carrying a time period corresponding to the acquisition cycle to the preset server. And the preset server sends the first resource metering file with the generation time in the time period corresponding to the acquisition period to the cloud computing management platform, so that the cloud computing management platform acquires the first resource metering file with the generation time in the acquisition period.
After the cloud computing management platform acquires the first resource metering file in each acquisition cycle, the cloud computing management platform analyzes the first resource metering file, determines charging data information in the first resource metering file, and calls the charging data information in the analyzed first resource metering file as first charging data information. The specific analysis process belongs to the prior art, and is not described in detail in the embodiment of the present invention.
After the cloud computing management platform analyzes the first charging data information in the first resource metering file, the cloud computing management platform can store the first charging data information to the memory database server, and the memory database server can be understood as a memory database.
The memory database server may be a redis server or a Memcached server.
S102: in the current charging period, when the throughput of the database is judged to be smaller than the preset throughput threshold, according to the preset first data volume, if yes, executing S103, and if not, executing S102.
S103: and acquiring second charging data information of the first data volume from the memory database server and writing the second charging data information into the database.
In each charging period, the throughput of the database storing the charging data information in the cloud computing management platform may be small and large, or may not change much all the time. When the throughput of the database is too large, if data is written into the database again at this time, the risk of waiting for the database lock or overflowing the memory is likely to be caused. In order to prevent this, the cloud computing management platform may store a throughput threshold of the database, and only when the throughput is less than the preset throughput threshold, write the charging data information into the database, and in order to prevent the write-once data volume from being too large, the cloud computing management platform may further store a preset data volume, which is referred to as a first data volume, and when the charging data information is written into the database, only once obtain the charging data information of the first data volume from the memory database server and write the charging data information of the first data volume into the database, and call the charging data information of the first data volume obtained from the memory database server as a second charging data information.
In summary, that is, the cloud computing management platform identifies the throughput of the database, compares the throughput with a pre-stored throughput threshold, and when it is determined that the throughput of the database is smaller than the pre-stored throughput threshold, sends a charging data information acquisition request carrying a first data volume to the memory database server, receives second charging data information of the first data volume sent by the memory database server, and writes the second charging data information of the first data volume into the database.
When identifying the throughput of the database, the cloud computing management platform may use an average value of the throughputs over a period of time as the throughput of the database, and a specific process belongs to the prior art and is not described in detail in the embodiment of the present invention.
The database may be a mysql database, or an oracle database, or a conventional relational database.
S104: and when the charging time of the current charging period comes, charging the cloud computing resources used by each user in the current charging period according to the third charging data information written into the database.
Generally, in each charging period, the number of times and the time that the throughput of the cloud computing management platform is smaller than the preset throughput threshold are enough to support the cloud computing management platform to write all the charging data information cached in the memory database server and acquired in the current charging period into the database of the cloud computing management platform.
And each charging period and corresponding charging time are stored in the cloud computing management platform, and in the current charging period, the charging data information written into the database is called as third charging data information.
And if the cloud computing management platform writes all the charging data information obtained in the current charging period cached in the memory database server into a database of the cloud computing management platform, the third charging data information is the charging data information in all the first resource metering files obtained by the cloud computing management platform in the current charging period.
And when the charging time of the current charging period comes, the cloud computing management platform carries out charging processing on the cloud computing resources used by each user in the current charging period according to the third charging data information written into the database.
The pricing condition of each type of cloud computing resource is stored in the cloud computing management platform, the charging data information written into the database comprises the use condition of each user on which type of cloud computing resource, the cloud computing management platform can charge according to the information, the specific charging process belongs to the prior art, and details are not repeated in the embodiment of the invention.
In this embodiment, in order to facilitate charging, the cloud computing management platform may further perform summary statistics on the charging data information, where the summary statistics may be performed on the first charging data information after the first charging data information in the first resource metering file is analyzed each time and before the first charging data information is stored in the memory database server, the summary statistics may be performed after the second charging data information is obtained from the memory database server and before the second charging data information is written into the database, or the summary statistics may be performed after the second charging data information is written into the database and before the charging. The summary statistics may be understood as a number of classification statistics performed on different classes of cloud computing resources used by the same user.
In the embodiment of the invention, after the charging data information is obtained and analyzed, the charging data information is not directly stored in the database, but is firstly stored in the memory database server, and when the throughput of the database is identified to be smaller than the preset throughput threshold, the charging data information is obtained from the memory database server in batches according to the preset first data volume and is written into the database. The internal storage database server is used as a buffer, and the charging data information is put into a storage in a batch mode in an idle time period, so that the risks of database lock waiting and internal storage overflow caused by overlarge throughput of the database are avoided.
Example 2:
in order to avoid resource waste, different storage manners may be adopted for users with more charging data information and users with less charging data, and on the basis of the above embodiment, in the embodiment of the present invention, before storing the parsed first charging data information in the memory database server, the method further includes:
identifying whether the first charging data information contains first sub-charging data information belonging to the hotspot user or not according to a prestored hotspot user;
if yes, the step of storing the analyzed first charging data information to the memory database server comprises the following steps:
and storing the first sub-charging data information to a memory database server.
In the embodiment of the invention, the identification information of the hotspot user and the non-hotspot user is pre-stored in the cloud computing management platform, and the identification information of the hotspot user and the non-hotspot user can be stored in the database and can also be stored in other storage positions. And aiming at the hot spot users and the non-hot spot users, the corresponding charging data can be written into the database in different modes. The hot spot users and the non-hot spot users can be determined and configured for the cloud computing management platform by an administrator according to the conditions of cloud resources opened and used by the users, the hot spot users are active users, and the non-hot spot users are inactive users. Generally, for a hotspot user, after using cloud computing resources, the data volume of a resource metering file reported by a bottom subsystem is relatively limited, the pressure for writing charging data information into the data is not so high as to be not higher than the pressure level that a database can bear, and for the part of data, the charging data information can be directly written into the database. For non-hotspot users, after the non-hotspot users use cloud computing resources, the data volume of the resource metering file reported by the bottom subsystem is large, and if the charging data with large data volume is directly written into the database, the problem of database lock waiting may be caused. The hot spot user can be a user with more charging data information, the non-hot spot user can be a user with less charging data information, that is, in a charging period or an acquisition period, the charging data information of the hot spot user is more than that of the non-hot spot user.
After the cloud computing management platform acquires and analyzes the first charging data information in the first resource metering file, whether the user is a hot user or a non-hot user can be determined according to the identification information of the user contained in the first charging data information, the charging data information of the hot user with more charging data information is only stored in the memory database server, and for the non-hot user with less charging data information, the charging data information of the non-hot user can be directly written into the database without being stored in the memory database server, so that the resource waste of the memory database server can be avoided.
Before the analyzed first charging data information is stored in the memory database server, it may be identified whether the first charging data information includes charging data information of a data hotspot user, the charging data information belonging to the hotspot user is referred to as first sub-charging data information, if the first sub-charging data information belonging to the hotspot user is included, the first sub-charging data information may be stored in the memory database server, that is, when the first charging data information is stored in the memory database server, the first sub-charging data information is actually stored in the memory database server. The first sub-charging data information may be the same as or different from the first charging data information. And subsequently, carrying out charging processing according to the third charging data information written into the database in the current charging period.
The first charging data information may also include charging data information belonging to non-hotspot users, and the charging data information belonging to non-hotspot users is referred to as second sub-charging data information.
If the first charging data information contains second sub-charging data information belonging to non-hotspot users, the method further comprises the following steps:
writing the second sub-charging data information into a database;
and when the charging moment of the current charging period comes, according to the fourth charging data information written into the database, performing charging processing on the cloud computing resources used by each user in the current charging period, wherein the hot point users have more charging data information than the non-hot point users.
In the embodiment of the present invention, the second sub-charging data information belonging to the non-hotspot user is directly written into the database, then the charging data written into the database in the current charging period is called fourth charging data, and when the charging time of the current charging period arrives, the charging process is performed on the cloud computing resource used by each user in the current charging period according to the fourth charging data information written into the database, and a specific charging process belongs to the prior art, which is not described in detail in the embodiment of the present invention.
Example 3:
when the cloud computing management platform acquires the resource metering file, it may be that when a certain timing task reaches time, all the resource metering files in a corresponding time period are acquired, and in order to improve the efficiency of thread concurrent processing, on the basis of the above embodiments, in an embodiment of the present invention, acquiring the resource metering file includes:
and the resource timing task of each category acquires the resource metering file of the corresponding category from a preset server.
The preset server can be an FTP server or other types of servers, that is, each type of resource has a corresponding resource timing task, and when the acquisition time of the acquisition period is reached, each type of resource timing task acquires a corresponding type of resource metering file from the FTP server or other types of servers. The resource types comprise cloud host resources, block storage resources and elastic compliance balance resources.
As shown in fig. 2, in the process of entering charging data information for a hotspot user, data of the hotspot user may be referred to as hotspot data, and a method of buffering, summarizing and counting is adopted for the hotspot data. Each timing task corresponds to a type of resource, and a collection period of a resource metering file is pre-stored in a database, so that the set collection period can be obtained from the database, when the collection time of the collection period comes, a message timing delivery trigger is started, that is, each type of resource timing task obtains a resource metering file of a corresponding type from an FTP server or other types of servers, and analysis, summarization and statistics are performed, and the method specifically comprises the following steps: the cloud host resource summarize and count the resource file timing task, the block storage summarize and count the resource file timing task, the elastic load balance summarize and count the resource file timing task, etc., the analyzed and summarized and counted charging data information is stored in the memory database server, namely, the charging data information is synchronized to the cache in batches, and then the charging data information is obtained from the memory database server and written into the database in batches.
In order to improve the system performance and avoid summarizing statistics for a long time, a time period for summarizing statistics can be set, that is, the overtime time of each task is set, if summarizing statistics on the charging data in all the acquired resource metering files is not completed in the time period, overtime task processing can be performed, that is, summarizing statistics is suspended firstly, summarizing statistics is performed in an idle time period, the time period for summarizing statistics is updated according to the overtime processing condition, the summarizing statistics time period can also be stored in a database, and after the updated time period is determined, the summarizing statistics time period is written into the database for storage to replace the original summarizing statistics time period. I.e., updating the timeout values of the respective timed tasks in fig. 2, and also updating the status of the respective timed tasks, e.g., to get, or not get.
Fig. 3 is a process of putting the charging data information into a database by the non-hotspot user, a data period summary statistical method is adopted for the non-hotspot data, the charging data information of the non-hotspot user is directly put into the database without being stored in the memory database server, and other processes can be described with reference to fig. 2.
Example 4:
in order to improve the accuracy of charging in each charging period, on the basis of the foregoing embodiments, in an embodiment of the present invention, after obtaining second charging data information of a first data volume from a memory database server according to a preset first data volume and writing the second charging data information into a database, before performing charging processing on cloud computing resources used by each user in a current charging period according to third charging data information written into the database, the method further includes:
judging whether the second charging data information of the first data volume contains fifth charging data information of which the generation time is positioned in the last charging period of the current charging period or not;
if not, carrying out the subsequent steps;
if so, filtering the fifth charging data information, taking the charging data information except the fifth charging data information in the third charging data information as the third charging data information, and performing the subsequent steps.
In the embodiment of the present invention, in a certain charging period, the number of times and time that the throughput of the cloud computing management platform is smaller than the preset throughput threshold may not be enough to support the cloud computing management platform to write all charging data information obtained in the current charging period cached in the memory database server into the database of the cloud computing management platform. In this charging period, the charging data information written into the database may not be the entire charging data information obtained, that is, the charging data information in a certain charging period may be written into the database in the next charging period.
In view of the current charging period, the charging data information written in the current charging period may include charging data information whose generation time is in the previous charging period.
The charging data information includes the generation time of the charging data information, and the generation time of the charging data and the generation time of the resource metering file to which the charging data information belongs can be considered to be basically consistent. After acquiring the second charging data information of the first data volume from the in-memory database server according to the preset first data volume each time and writing the second charging data information into the database, before performing charging processing on the cloud computing resource used by each user in the current charging period according to the third charging data information written into the database, it may be determined whether the second charging data information of the first data volume summary includes charging data information whose generation time is within the time period corresponding to the last charging period of the current charging period, according to the generation time in the charging data information and the time period corresponding to the last charging period and the current charging period, and the charging data information located in the last charging period is referred to as fifth charging data information.
If the second charging data information acquired from the memory database server each time does not contain the fifth charging data information of the previous charging period, the charging processing is directly carried out according to the third charging data information written into the database at the charging time of the current charging period.
If the second charging data information acquired from the memory database server contains the fifth charging data information of which the generation time is in the previous charging period, the fifth charging data information in the third charging data information can be filtered when the charging processing is performed on the cloud computing resources used in the current charging period, and the charging processing is performed on the cloud computing resources used by each user in the current charging period only according to the other charging data information except the fifth charging data information in the third charging data information.
In order to further improve the accuracy of charging in each charging period, in this embodiment of the present invention, if the second charging data information of the first data volume includes fifth charging data information whose generation time is located in a previous charging period of the current charging period, the method further includes:
and updating the charging of the cloud computing resources used by the user in the last charging period according to the fifth charging data information.
That is, the price is determined according to the usage of each type of resource in the fifth charging data information and the pricing of each type of resource, and the bill generated in the previous charging period is updated.
Example 5:
under certain conditions, the bottom subsystem may delay reporting of the resource use condition of the user, the current condition of delaying reporting of the resource measurement file in the industry is often treated as a wrong bill, and the problem of balance error of the user is solved through manual script data correction. In order to further improve the accuracy of charging, on the basis of the foregoing embodiments, in an embodiment of the present invention, the method further includes:
in the current charging period, judging whether the bottom-bound statistical time of the charging data information of the last charging period of the current charging period is reached;
if so, acquiring and analyzing a second resource metering file with the generation time in the last charging period;
writing the analyzed sixth charging data information of the second resource metering file into a database;
and according to the sixth charging data information written into the database, performing charging update on the cloud computing resources used by each user in the last charging period.
In the embodiment of the invention, in order to effectively prevent the situation that the time for reporting the resource metering file is delayed due to network, fault, function release and other reasons of the bottom subsystem, and the bill information generated when the cloud computing management platform carries out the charging processing on each charging period is wrong, the charging situation of the charging period can be updated by adopting a bottom-entering statistic mode, and the charging accuracy is achieved to the maximum extent. The bottom-bound statistics means that charging data information in the reported resource metering file delayed by the bottom subsystem is listed in a corresponding charging period for charging.
In order to realize the bottom-bound statistics of each charging period, the bottom-bound statistics time corresponding to the charging period should be located after the charging time of the charging period, and generally located in the next charging period of the charging period.
In the aspect of the current charging period, the bottom holding statistic time corresponding to the previous charging period is located in the time period corresponding to the current charging period.
In the current charging period, the cloud computing management platform judges whether the time reaches the bottom-holding statistical time of the charging data information of the last charging period of the current charging period, if so, the cloud computing management platform performs bottom-holding statistics on the last charging period, or acquires a resource metering file of which the generation time is in a time period corresponding to the last charging period, or calls the resource metering file of which the generation time is in the last charging period as a second resource metering file, specifically, the cloud computing management platform sends a resource metering file acquisition request carrying the time period corresponding to the last charging period to a preset server, and then acquires the second resource metering file of which the generation time is in the last charging period.
After the cloud computing management platform acquires the second resource metering file, the cloud computing management platform analyzes the second resource metering file, determines charging data information in the second resource metering file, and calls the charging data information in the analyzed second resource metering file as sixth charging data information. The specific analysis process belongs to the prior art, and is not described in detail in the embodiment of the present invention.
After the sixth charging data information in the second resource metering file is analyzed, the cloud computing management platform writes the sixth charging data information into the database, and because the generation time of the sixth charging data information is in the last charging period, the charging update can be performed on the last charging period according to the sixth charging data information.
If the general charging period is one day, the way of the bottom-entry statistics may be called as task bottom-entry statistics at end of day, for example, the bottom-entry statistics may be performed after 24 hours of each day and later 30 minutes, that is, the bottom-entry statistics may be performed for 00:30 minutes in the early morning, and the charging condition of the previous charging period, that is, the previous day is 00:00-24:00, is updated.
Fig. 4 is a schematic diagram of a bottom-of-pocket counting process, where at 00:40 minutes in the morning every day, also called 24:40 minutes, bottom-of-pocket triggering summary counting is performed for a day-ending timing task, and specifically, according to a timing task configured in advance in a database DB, a resource metering file of a resource of a corresponding category is obtained, analyzed, and is subjected to summary counting according to each resource category, and is written into the database in batch.
Example 6:
in order to dynamically determine hot spot users and non-hot spot users in real time and reduce the waste of manpower, on the basis of the above embodiments, in the embodiment of the present invention, the process of predetermining the hot spot users and the non-hot spot users includes:
for each user, judging whether a second data volume of seventh charging data information of the user in a preset time period is larger than a preset data volume threshold value;
if so, determining that the user is the hotspot user;
if not, determining that the user is a non-hotspot user.
In the embodiment of the present invention, a preset time period and a data volume threshold are pre-stored in the cloud computing management platform, and the cloud computing management platform may determine, according to charging data information generated by each user in the preset time period, whether the user is a hotspot user or a non-hotspot user, call the charging data information generated by the user in the preset time period as seventh charging data information, and call a data volume corresponding to the seventh charging data information as a second data volume. Because the charging data information of the defined hotspot user is more than the charging data of the non-hotspot user, whether the second data volume of the seventh charging data information of the user in a preset time period is greater than a preset data volume threshold value or not can be judged for each user; if the second data volume is larger than a preset data volume threshold value, determining that the user is a hotspot user; otherwise, determining that the user is a non-hotspot user.
To sum up, the overall flow of the charging processing of the cloud computing resources of the present invention is shown in fig. 5:
the cloud charging management platform firstly determines hot spot users and non-hot spot users, and configures different charging data information storage rules for the hot spot users and the non-hot spot users, wherein for the hot spot users, a mode that acquired and analyzed charging data information is firstly stored in a memory database server for caching, and then in an idle time period, the charging data information is acquired in batches from the memory database server according to a preset data volume and written into a database is adopted, namely a hot spot data buffering and summarizing statistical method. Aiming at non-hotspot users, a mode of directly writing the acquired and analyzed charging data information into a database is adopted, namely a non-hotspot data period summarizing and counting method is adopted. After the charging data information is obtained and analyzed, whether the charging data information belongs to the hot spot user or the non-hot spot user is judged, and corresponding rules are adopted for storage processing. Whether the users are hot users or non-hot users, the daily end timing task bottom-holding statistical processing can be carried out.
Example 7:
fig. 6 is an electronic device provided in an embodiment of the present invention, where the electronic device includes: a processor 61, a memory 62 and a transceiver 63;
in fig. 6, the bus architecture may include any number of interconnected buses and bridges, with one or more processors 61, represented by processor 61, and various circuits of memory 62, represented by memory 62, being linked together. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. The transceiver 63 may be a number of elements including a transmitter and a receiver that provide a means for communicating with various other apparatus over a transmission medium. The processor 61 is responsible for managing the bus architecture and general processing, and the memory 62 may store data used by the processor 61 in performing operations.
Alternatively, the processor 61 may be a CPU (central processing unit), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or a CPLD (Complex Programmable Logic Device).
The transceiver is used for acquiring a first resource metering file with the generation time in each acquisition period in the current charging period under the control of the processor;
the processor is used for reading the program in the memory and executing the following processes: analyzing a first resource metering file with the generation time in the acquisition period; storing the analyzed first charging data information of the first resource metering file to a memory database server; in the current charging period, when the throughput of the database is smaller than a preset throughput threshold, according to a preset first data volume, obtaining second charging data information of the first data volume from a memory database server and writing the second charging data information into the database; and when the charging time of the current charging period comes, charging the cloud computing resources used by each user in the current charging period according to the third charging data information written into the database.
Further, the processor is further configured to identify whether the first charging data information includes first sub-charging data information belonging to the hotspot user according to a prestored hotspot user before storing the analyzed first charging data information in the memory database server; if yes, the first sub-charging data information is stored in a memory database server.
Further, the processor is further configured to write second sub-charging data information into a database if the first charging data information includes second sub-charging data information belonging to a non-hotspot user; and when the charging moment of the current charging period comes, according to the fourth charging data information written into the database, performing charging processing on the cloud computing resources used by each user in the current charging period, wherein the hot point users have more charging data information than the non-hot point users.
Further, the processor is further configured to, after obtaining second charging data information of the first data volume from a memory database server according to a preset first data volume and writing the second charging data information into a database, determine whether the second charging data information of the first data volume includes fifth charging data information whose generation time is located in a previous charging period of the current charging period before performing charging processing on cloud computing resources used by each user in the current charging period according to third charging data information written into the database; if not, carrying out the subsequent steps; if so, filtering the fifth charging data information, taking the charging data information except the fifth charging data information in the third charging data information as the third charging data information, and performing the subsequent steps.
Further, if the second charging data information of the first data volume includes fifth charging data information whose generation time is in a previous charging period of the current charging period, the processor is further configured to perform charging update on the cloud computing resource used by the user in the previous charging period according to the fifth charging data information.
Further, the processor is further configured to determine, in a current charging period, whether a bottom-bound statistical time for charging data information of a previous charging period of the current charging period is reached; if so, acquiring and analyzing a second resource metering file with the generation time in the last charging period; writing the analyzed sixth charging data information of the second resource metering file into a database; and according to the sixth charging data information written into the database, performing charging update on the cloud computing resources used by each user in the last charging period.
Further, the processor is further configured to determine, for each user, whether a second data volume of seventh charging data information of the user in a preset time period is greater than a preset data volume threshold; if so, determining that the user is the hotspot user; if not, determining that the user is a non-hotspot user.
Further, the processor is specifically configured to obtain the resource metering file of the corresponding category from a preset server by the resource timing task of each category.
Example 8:
fig. 7 is a structural diagram of an apparatus for charging cloud computing resources according to an embodiment of the present invention, where the apparatus includes:
a first obtaining module 71, configured to obtain, in each acquisition period in a current charging period, a first resource metering file whose generation time is in the acquisition period;
the analysis module 72 is configured to analyze the first charging data information in the first resource metering file;
the saving module 73 is configured to save the parsed first charging data information to the memory database server;
a second obtaining module 74, configured to, in a current charging period, obtain, according to a preset first data volume, second charging data information of the first data volume from the in-memory database server when the throughput of the database is smaller than a preset throughput threshold;
a writing module 75, configured to write the second charging data information of the first data volume into the database;
and the charging module 76 is configured to, when the charging time of the current charging period comes, perform charging processing on the cloud computing resources used by each user in the current charging period according to the third charging data information written in the database.
Further, the apparatus further comprises: a first judging module 77, configured to identify whether the first charging data information includes first sub-charging data information belonging to a hotspot user according to a prestored hotspot user before storing the analyzed first charging data information in a memory database server;
if the determination result of the first determining module 71 is yes, the storing module 73 is specifically configured to store the first sub-charging data information to the in-memory database server.
Further, if the first charging data information includes second sub-charging data information belonging to a non-hotspot user, the writing module 75 is further configured to write the second sub-charging data information into a database;
the charging module 76 is further configured to, when the charging time of the current charging period comes, perform charging processing on the cloud computing resource used by each user in the current charging period according to the fourth charging data information written in the database, where the hot spot user has more charging data information than the non-hot spot user.
Further, the apparatus further comprises: a second judging module 78, configured to judge whether the second charging data information of the first data volume includes a fifth charging data information whose generation time is in a previous charging period of the current charging period;
if the judgment result of the second judgment module 78 is negative, the charging module 76 is executed;
the device further comprises: a filtering module 79, configured to filter the fifth charging data information if the determination result of the second determining module 78 is yes;
the charging module 76 is specifically configured to use charging data information in the third charging data information, except for the fifth charging data information, as third charging data information, and perform charging processing on the cloud computing resource used by each user in the current charging period according to the third charging data information written in the database.
Further, if the second charging data information of the first data volume includes fifth charging data information whose generation time is in a previous charging period of the current charging period, the charging module 76 is further configured to perform charging update on the cloud computing resource used by the user in the previous charging period according to the fifth charging data information.
Further, the apparatus further comprises: a bottom-holding statistic module 80, configured to determine, in a current charging period, whether a bottom-holding statistic time for charging data information of a previous charging period of the current charging period is reached; if so, acquiring and analyzing a second resource metering file with the generation time in the last charging period; writing the analyzed sixth charging data information of the second resource metering file into a database; and according to the sixth charging data information written into the database, performing charging update on the cloud computing resources used by each user in the last charging period.
Further, the first determining module 77 is further configured to determine, for each user, whether a second data volume of the seventh charging data information of the user in a preset time period is greater than a preset data volume threshold; if so, determining that the user is the hotspot user; if not, determining that the user is a non-hotspot user.
Further, the obtaining module 71 is specifically configured to obtain, by the resource timing task of each category, a resource metering file of a corresponding category from a preset server.
Example 9:
fig. 8 is an electronic device provided in an embodiment of the present invention, where the electronic device includes: the system comprises a processor 81, a communication interface 82, a memory 83 and a communication bus 84, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus;
the memory having stored therein a computer program that, when executed by the processor, causes the processor to perform the steps of:
in each acquisition period in the current charging period, acquiring and analyzing a first resource metering file with the generation time in the acquisition period; storing the analyzed first charging data information of the first resource metering file to a memory database server;
in the current charging period, when the throughput of the database is smaller than a preset throughput threshold, according to a preset first data volume, obtaining second charging data information of the first data volume from a memory database server and writing the second charging data information into the database;
and when the charging time of the current charging period comes, charging the cloud computing resources used by each user in the current charging period according to the third charging data information written into the database.
Further, before storing the parsed first charging data information to the in-memory database server, the method further includes:
identifying whether the first charging data information contains first sub-charging data information belonging to the hotspot user or not according to a prestored hotspot user;
if yes, the step of storing the analyzed first charging data information to the memory database server comprises the following steps:
and storing the first sub-charging data information to a memory database server.
Further, if the first charging data information contains second sub-charging data information belonging to non-hotspot users, writing the second sub-charging data information into a database;
and when the charging moment of the current charging period comes, according to the fourth charging data information written into the database, performing charging processing on the cloud computing resources used by each user in the current charging period, wherein the hot point users have more charging data information than the non-hot point users.
Further, after second charging data information of the first data volume is acquired from a memory database server according to a preset first data volume and is written into a database, whether fifth charging data information of which the generation time is located in a last charging period of the current charging period is included in the second charging data information of the first data volume is judged before charging processing is performed on cloud computing resources used by each user in the current charging period according to third charging data information written into the database;
if not, carrying out the subsequent steps;
if so, filtering the fifth charging data information, taking the charging data information except the fifth charging data information in the third charging data information as the third charging data information, and performing the subsequent steps.
Further, if the second charging data information of the first data volume includes fifth charging data information of which the generation time is located in a previous charging period of the current charging period, charging updating is performed on the cloud computing resources used by the user in the previous charging period according to the fifth charging data information.
Further, in the current charging period, judging whether the bottom-bound statistical time of the charging data information of the last charging period of the current charging period is reached;
if so, acquiring and analyzing a second resource metering file with the generation time in the last charging period;
writing the analyzed sixth charging data information of the second resource metering file into a database;
and according to the sixth charging data information written into the database, performing charging update on the cloud computing resources used by each user in the last charging period.
Further, for each user, judging whether a second data volume of seventh charging data information of the user in a preset time period is larger than a preset data volume threshold value; if so, determining that the user is the hotspot user; if not, determining that the user is a non-hotspot user.
Further, the resource timing task of each category acquires the resource metering file of the corresponding category from a preset server.
The communication bus mentioned in the electronic device in each of the above embodiments may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
And the communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Alternatively, the memory may be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a central processing unit, a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an application specific integrated circuit, a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or the like.
Example 10:
an embodiment of the present invention provides a computer-readable storage medium storing a computer program executable by an electronic device, and when the program runs on the electronic device, the program causes the electronic device to execute the following steps:
the storage is stored with a computer program, when the program is executed by the processor, the processor executes each acquisition cycle in the current charging cycle, and the cloud computing management platform acquires and analyzes a first resource metering file with the generation time in the acquisition cycle; storing the analyzed first charging data information of the first resource metering file to a memory database server;
in the current charging period, when the throughput of the database is smaller than a preset throughput threshold, according to a preset first data volume, obtaining second charging data information of the first data volume from a memory database server and writing the second charging data information into the database;
and when the charging time of the current charging period comes, charging the cloud computing resources used by each user in the current charging period according to the third charging data information written into the database.
Further, before storing the parsed first charging data information to the in-memory database server, the method further includes:
identifying whether the first charging data information contains first sub-charging data information belonging to the hotspot user or not according to a prestored hotspot user;
if yes, the step of storing the analyzed first charging data information to the memory database server comprises the following steps:
and storing the first sub-charging data information to a memory database server.
Further, if the first charging data information contains second sub-charging data information belonging to non-hotspot users, writing the second sub-charging data information into a database;
and when the charging moment of the current charging period comes, according to the fourth charging data information written into the database, performing charging processing on the cloud computing resources used by each user in the current charging period, wherein the hot point users have more charging data information than the non-hot point users.
Further, after second charging data information of the first data volume is acquired from a memory database server according to a preset first data volume and is written into a database, whether fifth charging data information of which the generation time is located in a last charging period of the current charging period is included in the second charging data information of the first data volume is judged before charging processing is performed on cloud computing resources used by each user in the current charging period according to third charging data information written into the database;
if not, carrying out the subsequent steps;
if so, filtering the fifth charging data information, taking the charging data information except the fifth charging data information in the third charging data information as the third charging data information, and performing the subsequent steps.
Further, if the second charging data information of the first data volume includes fifth charging data information of which the generation time is located in a previous charging period of the current charging period, charging updating is performed on the cloud computing resources used by the user in the previous charging period according to the fifth charging data information.
Further, in the current charging period, judging whether the bottom-bound statistical time of the charging data information of the last charging period of the current charging period is reached;
if so, acquiring and analyzing a second resource metering file with the generation time in the last charging period;
writing the analyzed sixth charging data information of the second resource metering file into a database;
and according to the sixth charging data information written into the database, performing charging update on the cloud computing resources used by each user in the last charging period.
Further, for each user, judging whether a second data volume of seventh charging data information of the user in a preset time period is larger than a preset data volume threshold value; if so, determining that the user is the hotspot user; if not, determining that the user is a non-hotspot user.
Further, the resource timing task of each category acquires the resource metering file of the corresponding category from a preset server.
The computer readable storage medium in the above embodiments may be any available medium or data storage device that can be accessed by a processor in an electronic device, including but not limited to magnetic memory such as floppy disks, hard disks, magnetic tape, magneto-optical disks (MOs), etc., optical memory such as CDs, DVDs, BDs, HVDs, etc., and semiconductor memory such as ROMs, EPROMs, EEPROMs, non-volatile memory (NAND FLASH), Solid State Disks (SSDs), etc.
For the system/apparatus embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for relevant points.
It is to be noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or operation from another entity or operation without necessarily requiring or implying any actual such relationship or order between such entities or operations.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely application embodiment, or an embodiment combining application and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (19)

1. A method for charging cloud computing resources, the method comprising:
in each acquisition period in the current charging period, the cloud computing management platform acquires and analyzes a first resource metering file with the generation time in the acquisition period; storing the analyzed first charging data information of the first resource metering file to a memory database server;
in the current charging period, when the throughput of a database is smaller than a preset throughput threshold, according to a preset first data volume, obtaining second charging data information of the first data volume from a memory database server and writing the second charging data information into the database, wherein the first data volume is the preset data volume stored by the cloud computing management platform, and the second charging data information is the charging data information of the first data volume obtained from the memory database server;
and when the charging time of the current charging period comes, performing charging processing on the cloud computing resources used by each user in the current charging period according to third charging data information written into the database, wherein the third charging data information is the charging data information written into the database in the current charging period.
2. The method of claim 1, wherein before saving the parsed first billing data information to the in-memory database server, the method further comprises:
identifying whether the first charging data information contains first sub-charging data information belonging to the hotspot user or not according to a prestored hotspot user;
if yes, the step of storing the analyzed first charging data information to the memory database server comprises the following steps:
and storing the first sub-charging data information to a memory database server.
3. The method as claimed in claim 2, wherein if the first charging data message includes a second sub-charging data message belonging to a non-hotspot subscriber, the method further comprises:
writing the second sub-charging data information into a database;
and when the charging moment of the current charging period comes, according to the fourth charging data information written into the database, performing charging processing on the cloud computing resources used by each user in the current charging period, wherein the hot point users have more charging data information than the non-hot point users.
4. The method of claim 1, wherein after obtaining second charging data information of the first data volume from the in-memory database server according to a preset first data volume and writing the second charging data information into the database, before performing charging processing on cloud computing resources used by each user in a current charging period according to third charging data information written into the database, the method further comprises:
judging whether the second charging data information of the first data volume contains fifth charging data information of which the generation time is positioned in the last charging period of the current charging period or not;
if not, carrying out the subsequent steps;
if so, filtering the fifth charging data information, taking the charging data information except the fifth charging data information in the third charging data information as the third charging data information, and performing the subsequent steps.
5. The method as claimed in claim 4, wherein if the second charging data information of the first data amount includes fifth charging data information whose generation time is located in a last charging period of the current charging period, the method further comprises:
and updating the charging of the cloud computing resources used by the user in the last charging period according to the fifth charging data information.
6. The method of any one of claims 1-5, further comprising:
in the current charging period, judging whether the bottom-bound statistical time of the charging data information of the last charging period of the current charging period is reached;
if so, acquiring and analyzing a second resource metering file with the generation time in the last charging period;
writing the analyzed sixth charging data information of the second resource metering file into a database;
and according to the sixth charging data information written into the database, performing charging update on the cloud computing resources used by each user in the last charging period.
7. The method of claim 2 or 3, wherein the process of predetermining hotspot users and non-hotspot users comprises:
for each user, judging whether a second data volume of seventh charging data information of the user in a preset time period is larger than a preset data volume threshold value;
if so, determining that the user is the hotspot user;
if not, determining that the user is a non-hotspot user.
8. The method of claim 1, wherein obtaining a resource metering file comprises:
and the resource timing task of each category acquires the resource metering file of the corresponding category from a preset server.
9. An electronic device, characterized in that the electronic device comprises: a processor, a memory, and a transceiver;
the transceiver is used for acquiring a first resource metering file with the generation time in each acquisition period in the current charging period under the control of the processor;
the processor is used for reading the program in the memory and executing the following processes: analyzing a first resource metering file with the generation time in the acquisition period; storing the analyzed first charging data information of the first resource metering file to a memory database server; in the current charging period, when the throughput of a database is smaller than a preset throughput threshold, according to a preset first data volume, obtaining second charging data information of the first data volume from a memory database server and writing the second charging data information into the database, wherein the first data volume is the preset data volume stored by a cloud computing management platform, and the second charging data information is the charging data information of the first data volume obtained from the memory database server; and when the charging time of the current charging period comes, performing charging processing on the cloud computing resources used by each user in the current charging period according to third charging data information written into the database, wherein the third charging data information is the charging data information written into the database in the current charging period.
10. The electronic device of claim 9, wherein the processor is further configured to identify whether the first charging data information includes first sub-charging data information belonging to the hotspot user according to a prestored hotspot user before storing the parsed first charging data information in the in-memory database server; if yes, the first sub-charging data information is stored in a memory database server.
11. The electronic device of claim 10, wherein the processor is further configured to write a second sub-charging data message belonging to a non-hotspot user into a database if the first charging data message comprises the second sub-charging data message; and when the charging moment of the current charging period comes, according to the fourth charging data information written into the database, performing charging processing on the cloud computing resources used by each user in the current charging period, wherein the hot point users have more charging data information than the non-hot point users.
12. The electronic device according to claim 9, wherein the processor is further configured to, after obtaining second charging data information of the first data volume from a memory database server according to a preset first data volume and writing the second charging data information into a database, determine whether the second charging data information of the first data volume includes fifth charging data information whose generation time is in a previous charging period of the current charging period before performing charging processing on cloud computing resources used by each user in the current charging period according to third charging data information written into the database; if not, carrying out the subsequent steps; if so, filtering the fifth charging data information, taking the charging data information except the fifth charging data information in the third charging data information as the third charging data information, and performing the subsequent steps.
13. The electronic device of claim 12, wherein if the second charging data information of the first data amount includes fifth charging data information whose generation time is in a previous charging period of the current charging period, the processor is further configured to perform charging update on the cloud computing resource used by the user in the previous charging period according to the fifth charging data information.
14. The electronic device according to any of claims 9-13, wherein the processor is further configured to determine, in a current charging period, whether a bottom-bound statistical time for charging data information of a charging period immediately preceding the current charging period has been reached; if so, acquiring and analyzing a second resource metering file with the generation time in the last charging period; writing the analyzed sixth charging data information of the second resource metering file into a database; and according to the sixth charging data information written into the database, performing charging update on the cloud computing resources used by each user in the last charging period.
15. The electronic device of claim 10 or 11, wherein the processor is further configured to determine, for each user, whether a second data amount of the seventh charging data information of the user within a preset time period is greater than a preset data amount threshold; if so, determining that the user is the hotspot user; if not, determining that the user is a non-hotspot user.
16. The electronic device according to claim 9, wherein the processor is specifically configured to obtain, for each type of resource timing task, a resource metering file corresponding to the type from a preset server.
17. An apparatus for cloud computing resource billing, the apparatus comprising:
the first acquisition module is used for acquiring a first resource metering file with the generation time in each acquisition period in the current charging period;
the analysis module is used for analyzing the first charging data information in the first resource metering file;
the storage module is used for storing the analyzed first charging data information to the memory database server;
a second obtaining module, configured to obtain, in a current charging period and when a throughput of a database is smaller than a preset throughput threshold, second charging data information of a first data volume from a memory database server according to a preset first data volume, where the first data volume is a preset data volume stored by a cloud computing management platform, and the second charging data information is charging data information of the first data volume obtained from the memory database server;
the writing module is used for writing the second charging data information of the first data volume into the database;
and the charging module is used for charging the cloud computing resources used by each user in the current charging period according to third charging data information written into the database when the charging time of the current charging period comes, wherein the third charging data information is the charging data information written into the database in the current charging period.
18. An electronic device, characterized in that the electronic device comprises: the system comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus;
the memory has stored therein a computer program which, when executed by the processor, causes the processor to carry out the steps of the method of any one of claims 1 to 8.
19. A computer-readable storage medium, characterized in that it stores a computer program executable by an electronic device, which program, when run on the electronic device, causes the electronic device to carry out the steps of the method according to any one of claims 1-8.
CN201810238753.4A 2018-03-22 2018-03-22 Cloud computing resource charging method and device, electronic equipment and storage medium Active CN110298677B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810238753.4A CN110298677B (en) 2018-03-22 2018-03-22 Cloud computing resource charging method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810238753.4A CN110298677B (en) 2018-03-22 2018-03-22 Cloud computing resource charging method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110298677A CN110298677A (en) 2019-10-01
CN110298677B true CN110298677B (en) 2021-08-13

Family

ID=68025556

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810238753.4A Active CN110298677B (en) 2018-03-22 2018-03-22 Cloud computing resource charging method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110298677B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114629732A (en) * 2020-12-11 2022-06-14 北京金山云网络技术有限公司 Charging method and device for cloud resources, electronic equipment and medium
CN112633683B (en) * 2020-12-22 2023-09-01 北京百度网讯科技有限公司 Resource usage statistics method, device, system, electronic equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7447145B2 (en) * 2003-05-27 2008-11-04 Nec Corporation Data communication device selecting modulation method with an appropriate threshold value in adaptive modulation
CN102739720A (en) * 2011-04-14 2012-10-17 中兴通讯股份有限公司 Distributed cache server system and application method thereof, cache clients and cache server terminals
CN104468136A (en) * 2014-12-31 2015-03-25 华为技术有限公司 Billing method, analysis center and billing center
CN105471955A (en) * 2014-09-11 2016-04-06 北京金山云网络技术有限公司 Writing method of distributed file system, client device and distributed file system
CN105989129A (en) * 2015-02-15 2016-10-05 腾讯科技(深圳)有限公司 Real-time data statistic method and device
CN106897431A (en) * 2017-02-27 2017-06-27 郑州云海信息技术有限公司 A kind of daily record deriving method and system
CN107040388A (en) * 2016-02-03 2017-08-11 中国移动通信集团山西有限公司 Charge system and method
CN107135088A (en) * 2016-02-29 2017-09-05 华为技术有限公司 The method and apparatus that daily record is handled in cloud computing system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7447145B2 (en) * 2003-05-27 2008-11-04 Nec Corporation Data communication device selecting modulation method with an appropriate threshold value in adaptive modulation
CN102739720A (en) * 2011-04-14 2012-10-17 中兴通讯股份有限公司 Distributed cache server system and application method thereof, cache clients and cache server terminals
CN105471955A (en) * 2014-09-11 2016-04-06 北京金山云网络技术有限公司 Writing method of distributed file system, client device and distributed file system
CN104468136A (en) * 2014-12-31 2015-03-25 华为技术有限公司 Billing method, analysis center and billing center
CN105989129A (en) * 2015-02-15 2016-10-05 腾讯科技(深圳)有限公司 Real-time data statistic method and device
CN107040388A (en) * 2016-02-03 2017-08-11 中国移动通信集团山西有限公司 Charge system and method
CN107135088A (en) * 2016-02-29 2017-09-05 华为技术有限公司 The method and apparatus that daily record is handled in cloud computing system
CN106897431A (en) * 2017-02-27 2017-06-27 郑州云海信息技术有限公司 A kind of daily record deriving method and system

Also Published As

Publication number Publication date
CN110298677A (en) 2019-10-01

Similar Documents

Publication Publication Date Title
CN107239339B (en) System performance optimization parameter determination method, system performance optimization method and device
CN108038130B (en) Automatic false user cleaning method, device, equipment and storage medium
CN111262795B (en) Service interface-based current limiting method and device, electronic equipment and storage medium
US8583783B1 (en) Method and system for adaptive recovery of heap memory
CN110298677B (en) Cloud computing resource charging method and device, electronic equipment and storage medium
CN107688626B (en) Slow query log processing method and device and electronic equipment
CN111651595A (en) Abnormal log processing method and device
CN111290696A (en) Flow control method and device for application program assembly
CN106021054A (en) Method and apparatus for testing upgrading and downgrading stability of BMC
WO2019029149A1 (en) Insurance policy-type status information counting method, terminal apparatus and storage medium
CN111182479B (en) Information sending control method and device
CN110557432B (en) Cache pool balance optimization method, system, terminal and storage medium
CN109992408B (en) Resource allocation method, device, electronic equipment and storage medium
CN111078651A (en) Method and device for counting usage amount of object storage
CN105429792B (en) User behavior flow acquisition methods and device, user behavior analysis method and system
CN112631879A (en) Data acquisition method and device, computer readable medium and electronic equipment
CN112596985B (en) IT asset detection method, device, equipment and medium
US11030024B2 (en) Assigning a severity level to a computing service using tenant telemetry data
CN109150593B (en) Method and device for managing resources in cloud data system
CN108255704B (en) Abnormal response method of script calling event and terminal thereof
CN115438020A (en) Database resource scheduling method, device, equipment and medium
CN112527614A (en) Intelligent device log quantity early warning system and method
CN113238911A (en) Alarm processing method and device
CN111679973A (en) Software test scheduling method and device, computer equipment and readable storage medium
CN112596996A (en) Service monitoring method and device

Legal Events

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