Cloud product metering and billing system and method, electronic equipment and storage medium

The cloud product billing system addresses the complexity of charging diverse cloud products by using a modular approach with data storage, billing, and task scheduling, ensuring precise and scalable billing across different types and forms.

CN120321058APending Publication Date: 2025-07-15ALIBABA CLOUD COMPUTING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410052035.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-12
Publication Date
2025-07-15

AI Technical Summary

Technical Problem

Under the payment-based model, the complexity of billing of cloud products is difficult to achieve accurate billing due to the diversity of types and forms.

Method used

Design a cloud product metering and billing system, including a data storage module, a billing module, a task scheduling module and multiple metering data acquisition modules. By storing billing rules and metering data, the metering data is collected and billed according to the billing cycle, supporting different types and forms of cloud products.

Benefits of technology

It realizes easy to expand and high-precision billing for different types and forms of cloud products, can be billed accurately, supports second-level billing, and ensures system stability through high availability design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120321058A_ABST
    Figure CN120321058A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a cloud product metering and billing system and method, electronic equipment and a storage medium, the cloud product metering and billing system comprises a data storage module, a billing module, a task scheduling module and a plurality of different metering data acquisition modules, and the plurality of different metering data acquisition modules are in one-to-one correspondence with a plurality of different cloud products. Charging rules and metering data of a plurality of different cloud products are stored in the data storage module; for any cloud product, a metering data acquisition module of the cloud product periodically generates target metering data of the cloud product according to a charging period under the control of a task scheduling module; and under the control of the task scheduling module, the charging module charges the target metering data of the cloud product periodically by using the charging rule of the cloud product according to a charging period. Therefore, the cloud product metering and billing system which is easy to expand and high in precision is provided, and precise billing can be carried out on a plurality of different cloud products of different types and different forms.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of cloud computing technology, and in particular, to a cloud product metering and billing system, method, electronic device, and storage medium. Background Art

[0002] With the rise of cloud computing technology, various cloud service products (also known as cloud products), such as cloud databases, elastic computing services, cloud desktops, or cloud servers, have emerged. These cloud products play a fundamental role like "water, coal, and electricity" in the information age. Taking cloud databases as an example, different cloud service providers offer different types of cloud databases, and at the same time, various cloud databases have multiple different forms. For example, a certain cloud service provider offers cloud databases in various forms such as single-node version, cluster version, and elastic version. Due to the large variety of cloud product types and the multiple different forms of the same type of cloud product, it has become very complex to accurately bill cloud products under the pay-per-use model. Summary of the Invention

[0003] Multiple aspects of this application provide a cloud product metering and billing system, method, electronic device, and storage medium, which make it very simple to accurately bill cloud products under the pay-per-use model.

[0004] An embodiment of this application provides a cloud product metering and billing system, including: a data storage module, a billing module, a task scheduling module, and multiple different metering data collection modules. The multiple different metering data collection modules correspond to multiple different cloud products one by one. The data storage module is respectively connected to the billing module and the multiple different metering data collection modules. The task scheduling module is respectively connected to the billing module and the multiple different metering data collection modules. The data storage module is used to store the billing rules and metering data of multiple different cloud products. The metering data collection module is used to collect the metering data of the corresponding cloud product from the data storage module, and use the metering data processing logic of the cloud product to process the metering data of the cloud product to obtain the target metering data of the cloud product, and store the target metering data of the cloud product into the data storage module. The billing module is used to obtain the billing rules and target metering data of the cloud product from the data storage module, and use the billing rules of the cloud product to bill the target metering data of the cloud product to obtain the billing data of the cloud product. The task scheduling module is used to trigger the work of the metering data collection module and the billing module of the cloud product according to the billing cycle of the cloud product.

[0005] The embodiments of the present application further provide a cloud product metering and billing method, which is applied to a cloud product metering and billing system. The system includes: a data storage module, a billing module, a task scheduling module, and multiple different metering data collection modules. The multiple different metering data collection modules correspond to multiple different cloud products one by one. The data storage module is respectively connected to the billing module and the multiple different metering data collection modules, and the task scheduling module is respectively connected to the billing module and the multiple different metering data collection modules. The method includes: The data storage module stores the billing rules and metering data of multiple different cloud products; The metering data collection module collects the metering data of the corresponding cloud product from the data storage module, and processes the metering data of the cloud product using the metering data processing logic of the cloud product to obtain the target metering data of the cloud product, and stores the target metering data of the cloud product into the data storage module; The billing module obtains the billing rules and target metering data of the cloud product from the data storage module, and bills the target metering data of the cloud product using the billing rules of the cloud product to obtain the billing data of the cloud product; The task scheduling module triggers the work of the metering data collection module and the billing module of the cloud product according to the billing cycle of the cloud product.

[0006] The embodiments of the present application further provide an electronic device, which includes: a memory and a processor; The memory is used to store a computer program; The processor is coupled to the memory and is used to execute the computer program to execute the steps in the cloud product metering and billing method.

[0007] The embodiments of the present application further provide a computer-readable storage medium storing a computer program, which causes the processor to be able to implement the steps in the cloud product metering and billing method when the computer program is executed by the processor.

[0008] The cloud product metering and billing system provided by the embodiments of the present application includes a data storage module, a billing module, a task scheduling module, and multiple different metering data collection modules. The multiple different metering data collection modules correspond to multiple different cloud products one by one. The billing rules and metering data of multiple different cloud products are stored in the data storage module; For any cloud product, the metering data collection module of the cloud product periodically generates the target metering data of the cloud product according to the billing cycle under the control of the task scheduling module; The billing module periodically bills the target metering data of the cloud product using the billing rules of the cloud product under the control of the task scheduling module. Thus, a cloud product metering and billing system that is easy to expand and has high precision is provided, which can accurately bill multiple different cloud products of different types and forms. Description of the Drawings

[0009] The accompanying drawings described herein are used to provide a further understanding of the present application and form a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation to the present application. In the drawings:

[0010] Figure 1 is an architecture diagram of a cloud product metering and billing system provided by an embodiment of the present application;

[0011] Figure 2 is another architecture diagram of a cloud product metering and billing system provided by an embodiment of the present application;

[0012] Figure 3 is another architecture diagram of a cloud product metering and billing system provided by an embodiment of the present application;

[0013] Figure 4a is an exemplary diagram of the self-healing process of a cloud product metering and billing system failure provided by an embodiment of the present application;

[0014] Figure 4b is a schematic diagram of an application scenario provided by an embodiment of the present application;

[0015] Figure 5 is a flowchart of a cloud product metering and billing method provided by an embodiment of the present application;

[0016] Figure 6 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Detailed Embodiments

[0017] To make the objectives, technical solutions, and advantages of the present application clearer, the technical solutions of the present application will be clearly and completely described below in conjunction with the specific embodiments of the present application and the corresponding accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the scope of protection of the present application.

[0018] In the embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "And / or" describes the access relationship of associated objects and indicates that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. Among them, A and B may be singular or plural. In the text description of the present application, the character " / " generally represents an "or" relationship between the associated objects before and after. In addition, in the embodiments of the present application, "first", "second", "third", etc. are only used to distinguish the contents of different objects and have no other special meanings.

[0019] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data that have been authorized by the user or fully authorized by all parties. And the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or reject.

[0020] With the rise of cloud computing technology, various cloud service products (also known as cloud products), such as cloud databases, elastic computing services, cloud desktops, or cloud servers, have emerged. These cloud products play a fundamental role like "water, coal, and electricity" in the information age. Taking cloud databases as an example, different cloud service providers offer different types of cloud databases, and at the same time, various cloud databases have multiple different forms. For example, cloud service providers offer cloud databases in various forms such as single-node version, cluster version, and elastic version. Due to the large variety of cloud product types and multiple different forms of the same type of cloud product, it becomes very complicated to accurately bill cloud products under the pay-per-use model.

[0021] The embodiments of this application provide a cloud product measurement and billing system, method, electronic device, and storage medium. Among them, the cloud product measurement and billing system provided by the embodiments of this application includes a data storage module, a billing module, a task scheduling module, and multiple different measurement data collection modules, and the multiple different measurement data collection modules correspond to multiple different cloud products one by one. The billing rules and measurement data of multiple different cloud products are stored in the data storage module; for any cloud product, the measurement data collection module of the cloud product periodically generates the target measurement data of the cloud product according to the billing cycle under the control of the task scheduling module; the billing module periodically bills the target measurement data of the cloud product according to the billing cycle under the control of the task scheduling module using the billing rules of the cloud product. Thus, a cloud product measurement and billing system that is easy to expand and has high precision is provided, which can accurately bill multiple different cloud products of different types and different forms.

[0022] The following will detail the technical solutions provided by the embodiments of this application with reference to the accompanying drawings.

[0023] Figure 1 It is an architecture diagram of a cloud product measurement and billing system provided by the embodiments of this application. Refer to Figure 1, the cloud product metering and billing system may include: a data storage module 10, a billing module 30, a task scheduling module 40, and multiple different metering data collection modules 20. The multiple different metering data collection modules 20 correspond to multiple different cloud products one by one. The data storage module 10 is respectively connected to the billing module 30 and the multiple different metering data collection modules 20; the task scheduling module 40 is respectively connected to the billing module 30 and the multiple different metering data collection modules 20. Among them, the data storage module 10, the billing module 30, the task scheduling module 40, the metering data collection module 20, etc. may be composed of software and / or hardware, and there is no limitation thereto.

[0024] For example, Figure 1 includes: cloud product 1, cloud product 2... cloud product n, where n is a positive integer. The number of metering data collection modules 20 is also n. Each cloud product corresponds to one metering data collection module 20, and each metering data collection module 20 collects the metering data of one cloud product.

[0025] In this embodiment, the types and forms of cloud products are not limited. Different cloud products may be different types of cloud products, or different forms of the same type of cloud products. For example, cloud databases, elastic computing services, cloud desktops, or cloud servers are cloud products of different types. For another example, different types of cloud databases provided by different cloud service providers are different cloud products. For another example, various forms such as single-node version, cluster version, and elastic version of the same type of cloud database are different cloud products. In this embodiment, the data storage module 10 is used to store the billing rules and metering data of multiple different cloud products. Among them, the data storage module 10 includes, for example, but is not limited to: relational databases, non-relational databases, local databases, cloud databases, etc.

[0026] Specifically, the pay-as-you-go billing mode is a post-payment billing method where you pay for what you use. The pay-as-you-go billing mode can accurately bill according to various time granularities such as second-level, minute-level, hour-level, day-level, etc. In the pay-as-you-go billing mode, the original metering data generated during the use of the cloud product is collected, the original metering data is cleaned to obtain the metering data of the cloud product, and the metering data of the cloud product is stored in the data storage module 10. Among them, data cleaning can remove some dirty data, delete duplicate information, correct existing errors, and ensure data consistency.

[0027] In practical applications, the billing cycle of cloud products includes billing cycles of different time granularities. The billing cycle is, for example, 1 second, 1 minute, 1 hour, 1 day, etc. Metering data is collected periodically according to the billing cycle. Correspondingly, the metering data of cloud products includes metering data of different time granularities, such as second-level metering data, minute-level metering data, hour-level metering data, and day-level metering data, etc.

[0028] In this embodiment, different cloud products may have different charging items, and the measurement data corresponding to different charging items is different. For example, the charging items of a certain cloud product include computing resource charging items, public network bandwidth charging items, and storage capacity charging items.

[0029] Among them, the measurement data of the computing resource charging item includes the instance specifications of computing resources and the charging duration, etc. Taking the computing resources including vCPUs (virtual CPUs) and memory as an example, the instance specifications of computing resources vary according to the number of vCPU cores or the memory size. For example, the instance specifications of computing resources are: 8 cores 32G, 16 cores 32G, 32 cores 96G, etc. 8 cores 32G means the number of vCPU cores is 8 and the memory size is 32G (gigabytes), 16 cores 32G means the number of vCPU cores is 16 and the memory size is 32G, and 32 cores 96G means the number of vCPU cores is 32 and the memory size is 96G.

[0030] Among them, the measurement data of the public network bandwidth charging item includes the public network bandwidth traffic flowing out of the cloud product instance. Among them, the cloud product instance is, for example, a cloud server instance, a database instance, etc.

[0031] Among them, the measurement data of the storage capacity charging item includes the cloud disk type, the capacity size of the cloud disk, and the charging duration.

[0032] In this embodiment, the charging rules of cloud products define the calculation formula for charging the measurement data. For example, the charging rule of the computing resource charging item is the product of the unit price of the computing resource instance specification and the charging duration; the charging rule of the storage capacity charging item is the product of the cloud disk capacity, the cloud disk unit price, and the charging duration; the charging rule of the public network bandwidth charging item is the product of the public network bandwidth unit price and the public network bandwidth traffic.

[0033] Specifically, for a certain cloud product used by a user, the unit price of the 8-core 32G instance specification is 0.52325 yuan / hour, and the cost of the 8-core 32G instance specification = unit price of the instance specification × charging duration = 0.52325 × 1 = 0.52325 yuan. The cloud disk unit price is 0.00210 yuan / 1G / hour, and the cloud disk cost = cloud disk unit price × cloud disk capacity × charging duration = 0.00210 × 100 × 1 = 0.21. The public network bandwidth unit price is 0.80 yuan / GB, and the public network bandwidth cost = public network bandwidth unit price × traffic = 0.80 × 1 = 0.8. Then the total cost of this cloud product = cost of the 8-core 32G instance specification + cloud disk cost + public network bandwidth cost = 0.52325 + 0.21 + 0.8 = 1.62325.

[0034] In this embodiment, the metering data acquisition module 20 is configured to acquire metering data of a corresponding cloud product from the data storage module 10, process the metering data of the cloud product using the metering data processing logic of the cloud product to obtain the target metering data of the cloud product, and store the target metering data of the cloud product in the data storage module 10.

[0035] In this embodiment, multiple different metering data acquisition modules 20 correspond one-to-one with multiple different cloud products. For example, cloud product 1 corresponds to one metering data acquisition module 20, cloud product 2 corresponds to one metering data acquisition module 20, and cloud product n corresponds to one metering data acquisition module 20, where n is a positive integer. Different cloud products only need to be configured with corresponding metering data acquisition modules 20 to achieve the billing process for the cloud products. The cloud products do not interfere with each other and are independent of each other, and the scalability of the cloud product metering and billing system is good. Preferably, the metering data acquisition module 20 is connected to the cloud product metering and billing system in the form of a plug-in, and the access cost is low, making the cloud product metering and billing system easier to expand.

[0036] Specifically, different cloud products can customize their own metering data processing logic. The metering data processing logic includes, for example: data format conversion method, data unit conversion method, or time dimension data aggregation method. Among them, the time dimension data aggregation method refers to aggregating data in the time dimension. For example, aggregating according to different time dimensions such as 1 second, 1 minute, 1 hour, 1 day, etc. to obtain second-level data, minute-level data, hour-level data, and day-level data, etc.

[0037] It should be noted that for the same cloud product, there may be metering data of one time granularity or multiple different time granularities, and there is no limit to this.

[0038] In this embodiment, the billing module 30 is configured to obtain the billing rules and target metering data of the cloud product from the data storage module 10, and bill the target metering data of the cloud product using the billing rules of the cloud product to obtain the billing data of the cloud product.

[0039] In this embodiment, the task scheduling module 40 is configured to trigger the operation of the metering data acquisition module 20 and the billing module 30 of the cloud product according to the billing cycle of the cloud product.

[0040] Specifically, for any cloud product, the operation of the metering data acquisition module 20 and the billing module 30 of the cloud product is triggered periodically according to the billing cycle. Under the control of the task scheduling module 40, the metering data acquisition module 20 of the cloud product periodically generates the target metering data of the cloud product; under the control of the task scheduling module 40, the billing module 30 periodically bills the cloud product. In addition, in practical applications, the billing module 30 can generate a bill based on the billing data.

[0041] For example, if the billing cycle is 1 second, the metering data collection module 20 of the cloud product generates the second-level target metering data of the cloud product every 1 second under the control of the task scheduling module 40 and stores it in the database module; the billing module 30 obtains the second-level target metering data and billing rules of the cloud product from the database module every 1 second under the control of the task scheduling module 40 for billing processing, and obtains the second-level billing data of the cloud product, that is, realizes second-level billing for the cloud product used by the user in seconds.

[0042] For example, if the billing cycle is 1 hour, the metering data collection module 20 of the cloud product generates the hourly target metering data of the cloud product every 1 hour under the control of the task scheduling module 40 and stores it in the database module; the billing module 30 obtains the hourly target metering data and billing rules of the cloud product from the database module every 1 hour under the control of the task scheduling module 40 for billing processing, and obtains the hourly billing data of the cloud product, that is, realizes hourly billing for the cloud product used by the user in hours.

[0043] The cloud product metering and billing system provided by the embodiment of the present application includes a data storage module, a billing module, a task scheduling module, and a plurality of different metering data collection modules, and the plurality of different metering data collection modules correspond to a plurality of different cloud products one by one. The billing rules and metering data of a plurality of different cloud products are stored in the data storage module; for any cloud product, the metering data collection module of the cloud product periodically generates the target metering data of the cloud product according to the billing cycle under the control of the task scheduling module; the billing module periodically bills the target metering data of the cloud product using the billing rules of the cloud product according to the billing cycle under the control of the task scheduling module. Thereby, a cloud product metering and billing system that is easy to expand and has high precision is provided, which can accurately bill a plurality of different cloud products of different types and forms.

[0044] Figure 2 This is an architecture diagram of another cloud product metering and billing system provided by the embodiment of the present application. In Figure 1 Based on the shown cloud product metering and billing system, referring to Figure 2 , the cloud product metering and billing system may further include: a message queue module 50 and a data consumption module 60. The message queue module 50 is connected to the data consumption module 60, and the data consumption module 60 is connected to the data storage module 10.

[0045] In this embodiment, the message queue module 50 is used to store the second-level raw metering data of a plurality of different cloud products.

[0046] In this embodiment, the data consumption module 60 is configured to obtain the second-level raw measurement data of multiple different cloud products from the message queue module, perform data cleaning on the second-level raw measurement data of the multiple different cloud products to obtain the second-level measurement data of the multiple different cloud products, and store the second-level measurement data of the multiple different cloud products in the data storage module.

[0047] In this embodiment, the second-level raw measurement data of the cloud products is persisted in the message queue module 50, and other raw measurement data of the cloud products except the second-level raw measurement data is persisted in the data storage module. For example, the minute-level raw measurement data, hour-level raw measurement data, day-level raw measurement data, etc. are persisted in the data storage module.

[0048] In this embodiment, the data consumption module 60 pulls and consumes the second-level raw measurement data from the message queue module. Specifically, the data consumption module 60 performs data cleaning on the pulled second-level raw measurement data, and stores the cleaned second-level measurement data in the data storage module 10 according to different cloud products. For example, the unique identifier of the cloud product and its second-level measurement data are stored in the data storage module 10, and the unique identifiers of different cloud products are different, so as to store the second-level raw measurement data of each cloud product in a classified manner in the data storage module 10.

[0049] The cloud product measurement and billing system provided by the embodiment of the present application includes a message queue module, a data consumption module, a data storage module, a billing module, a task scheduling module, and multiple different measurement data collection modules, and the multiple different measurement data collection modules correspond to multiple different cloud products one by one. The billing rules and measurement data of multiple different cloud products are stored in the data storage module; for any cloud product, the measurement data collection module of the cloud product periodically generates the target measurement data of the cloud product according to the billing cycle under the control of the task scheduling module; the billing module periodically bills the target measurement data of the cloud product according to the billing cycle under the control of the task scheduling module by using the billing rules of the cloud product. Thereby, a cloud product measurement and billing system that is easy to expand and has high precision is provided, which can accurately bill multiple different cloud products of different types and forms. Further, a message queue module is introduced to persist the second-level raw measurement data of the cloud products, and the second-level raw measurement data is collected by virtue of the characteristics of real-time transmission and asynchronous processing of the message queue, and finally second-level billing is realized, which greatly expands the billing ability of the cloud product measurement and billing system and can effectively cope with the second-level billing scenarios of elastic computing, elastic storage, elastic bandwidth, and elastic traffic.

[0050] As the basic role of cloud products becomes more and more important, the stability of the cloud product measurement and billing system cannot be ignored. Therefore, it is very necessary to provide a highly available cloud product measurement and billing system.

[0051] Figure 3 This is an architecture diagram of another cloud product metering and billing system provided by an embodiment of the present application. Figure 1 Or Figure 2 Based on the cloud product metering and billing system shown in Figure 3 , the cloud product metering and billing system may further include: a high availability module 70; the high availability module 70 is respectively connected to the task scheduling module 40 and at least one functional module, and the functional module includes at least one of the following: a data storage module 10, a billing module 30, a metering data collection module 20, a message queue module 50, or a data consumption module 60, and the functional module includes a primary node and a secondary node.

[0052] The high availability module 70 is configured to, in response to service registration requests of the primary node and the secondary node, locally register the service registration information of the primary node and the secondary node respectively; receive heartbeat signals periodically sent by the primary node and the secondary node and store them locally;

[0053] The task scheduling module 40 is configured to query service registration information from the high availability module, determine a target primary node and a target secondary node that need to perform heartbeat detection based on the service registration information; periodically perform heartbeat detection on the target primary node and the target secondary node based on the heartbeat signals of each node stored in the high availability module; if the heartbeat detection result indicates that the target primary node stops beating and the target secondary node keeps beating, trigger the primary / secondary switch of the target primary node and the target secondary node, and trigger the new target primary node to work.

[0054] In this embodiment, for any one of the functional modules of the data storage module 10, the billing module 30, the metering data collection module 20, the message queue module 50, or the data consumption module 60, the functional module includes multiple nodes, and one of the multiple nodes is used as the primary node, and the other nodes are used as secondary nodes (also referred to as standby nodes), that is, the functional module is manifested as multiple nodes in a primary / standby form. When the primary node of the functional module fails, a secondary node is selected as the primary node, thereby ensuring the high availability of the functional module.

[0055] It should be noted that in the case where the cloud product metering and billing system includes multiple metering data collection modules 20, all or part of the metering data collection modules 20 among the multiple metering data collection modules 20 can be used as functional modules, and there is no limitation on this. It can be understood that the high availability module 70 is connected to all or part of the metering data collection modules 20, and each metering data collection module 20 among all or part of the metering data collection modules 20 is manifested as multiple nodes in a primary / standby form.

[0056] In this embodiment, the high-availability module ensures the high availability of the entire link of the cloud product metering and billing system. Each functional module such as the data storage module, the billing module, the metering data collection module, the message queue module, or the data consumption module is registered in the high-availability module in the form of service registration. The service registration information includes, for example, the node identifier of the registered node. Each node included in the registered functional module periodically sends a heartbeat signal to the high-availability module, so that the high-availability module saves the heartbeat signals of each node included in the functional module locally. The heartbeat signal includes, for example, the node identifier and the heartbeat signal sending time, etc. The node identifier may include the IP (Internet Protocol Address) address or port of the node.

[0057] In this embodiment, the task scheduling module periodically queries the high-availability module in the way of service query, queries the service registration information of the registered nodes from the high-availability module, and determines the target master node and the target slave node that need to perform heartbeat detection based on the service registration information. The target master node is one of the registered master nodes, and the target slave node is the slave node of the target master node.

[0058] For the target master node and the target slave node, the task scheduling module periodically queries the heartbeat signals of the target master node and the target slave node from the high-availability module. For each period, if the difference between the heartbeat signal sending time of the most recent heartbeat signal sent by the target master node and the current time is greater than or equal to the set difference, it is considered that the target master node has timed out and not sent a heartbeat signal, and the heartbeat detection result is that the target master node has stopped sending heartbeats, that is, the target master node has failed and is an abnormal node; if the difference between the heartbeat signal sending time of the most recent heartbeat signal sent by the target master node and the current time is less than the set difference, it is considered that the target master node has sent a heartbeat signal normally, and the heartbeat detection result is that the target master node maintains a heartbeat. If the difference between the heartbeat signal sending time of the most recent heartbeat signal sent by the target slave node and the current time is greater than or equal to the set difference, it is considered that the target slave node has timed out and not sent a heartbeat signal, and the heartbeat detection result is that the target slave node has stopped sending heartbeats, that is, the target master node has failed and is an abnormal node; if the difference between the heartbeat signal sending time of the most recent heartbeat signal sent by the target slave node and the current time is less than the set difference, it is considered that the target slave node has sent a heartbeat signal normally, and the heartbeat detection result is that the target slave node maintains a heartbeat.

[0059] In this embodiment, if the heartbeat detection result indicates that the target master node has stopped sending heartbeats and the target slave node maintains a heartbeat, the task scheduling module triggers the target master node and the target slave node to perform master-slave switching, and triggers the new target master node to work to ensure that the overall system always maintains high availability.

[0060] Further optionally, when the task scheduling module detects an abnormal node through heartbeat detection, it outputs an alarm message, which is used to prompt the abnormal node. In practical applications, the abnormal node can be removed and a new node can be launched either manually or through an automated script, so that the system as a whole always maintains high availability.

[0061] Based on the above embodiments, in order to better ensure the high availability of the cloud product metering and billing system. The task scheduling module includes multiple nodes, one of the multiple nodes serves as the main scheduling node, and the other nodes serve as slave scheduling nodes, that is, the task scheduling module is manifested as multiple nodes in a master / backup form. When the main scheduling node fails, a slave scheduling node is selected as the new main scheduling node, thereby improving the high availability of the task scheduling module.

[0062] In this embodiment, the main scheduling node is used to trigger the operation of the metering data collection module and the billing module of the cloud product according to the billing cycle of the cloud product, and register services in the high availability module, and periodically send a heartbeat signal to the high availability module for the high availability module to store the service registration information and heartbeat signal of the main scheduling node;

[0063] The slave scheduling node is used to periodically query the service registration information and heartbeat signal of the main scheduling node in the high availability module; when it is determined based on the service registration information of the main scheduling node that the main scheduling node is not itself, periodically perform a heartbeat detection on the main scheduling node based on the heartbeat signal of the main scheduling node. If the heartbeat detection result indicates that the main scheduling node has stopped beating, the slave scheduling node is switched to the new main scheduling node.

[0064] Specifically, the main scheduling node registers its own service registration information in the high availability module. The service registration information includes the unique identifier of the main scheduling node. The main scheduling node periodically sends its own heartbeat signal to the high availability module, and the high availability module saves the heartbeat signal of the main scheduling node.

[0065] Find the service registration information of the primary scheduling node of the highly available module from the scheduling node. When it is determined that the primary scheduling node registered in the highly available module is not the scheduling node itself based on the unique identifier of the primary scheduling node in the service registration information, the scheduling node periodically performs heartbeat detection on the primary scheduling node based on the heartbeat signal of the primary scheduling node in the highly available module. For each cycle, if the difference between the heartbeat signal sending time of the most recent heartbeat signal sent by the primary scheduling node and the current time is greater than or equal to the set difference, it is considered that the primary scheduling node has timed out and not sent a heartbeat signal, and the heartbeat detection result is that the primary scheduling node has stopped sending a heartbeat, that is, the primary scheduling node has failed and is an abnormal node. At this time, the scheduling node updates the service registration information of the primary scheduling node of the highly available module to the service registration information of the scheduling node, and switches the scheduling node to a new primary scheduling node in a preemptive manner. The new primary scheduling node periodically sends a heartbeat signal to the highly available module; if the difference between the heartbeat signal sending time of the most recent heartbeat signal sent by the primary scheduling node and the current time is less than the set difference, it is considered that the primary scheduling node has sent a heartbeat signal normally, and the heartbeat detection result is that the primary scheduling node maintains a heartbeat.

[0066] Further optionally, the new scheduling node is further configured to output an alarm message, and the alarm message is used to prompt that the old primary scheduling node is abnormal. In practical applications, the abnormal primary scheduling node can be removed and a new node can be started through manual intervention or an automated script method to keep the overall system highly available at all times.

[0067] The cloud product metering and billing system provided by the embodiments of this application includes a message queue module, a data consumption module, a data storage module, a billing module, a task scheduling module, and multiple different metering data collection modules, and the multiple different metering data collection modules correspond to multiple different cloud products one by one. The billing rules and metering data of multiple different cloud products are stored in the data storage module; for any cloud product, the metering data collection module of the cloud product periodically generates the target metering data of the cloud product according to the billing cycle under the control of the task scheduling module; the billing module, under the control of the task scheduling module, periodically bills the target metering data of the cloud product according to the billing rules of the cloud product. Thereby, a cloud product metering and billing system that is easy to expand and has high precision is provided, which can accurately bill multiple different cloud products of different types and forms. Further optionally, a message queue module is introduced to persist the second-level raw metering data of cloud products, and the characteristics of real-time transmission and asynchronous processing of the message queue are used to realize the collection of second-level raw metering data, and finally realize second-level billing, greatly expanding the billing capacity of the cloud product metering and billing system, and can effectively handle the second-level billing scenarios of elastic computing, elastic storage, elastic bandwidth, and elastic traffic. Further optionally, through the combination of service registration and node election as the master, the high availability of the entire link of the cloud product metering and billing system is realized, and the cloud product metering and billing system has the characteristics of easy expansion, high precision, and high availability.

[0068] For ease of understanding, the following combines Figure 4a to introduce the fault self-healing process of the cloud product metering and billing system that is easy to expand, highly available, and has high precision.

[0069] In practical applications, the message queue module, the data consumption module, the data storage module, the billing module, the metering data collection module, and the task scheduling module register the primary node and the standby node with the high-availability module through the service registration method, and regularly update the heartbeat signal to the high-availability module. Different data consumption modules can be configured with the same consumption group to improve the consumption efficiency and ensure the high availability of the overall system. The billing rules of different cloud products are stored in the data storage module.

[0070] In practical applications, during the daily operation and maintenance of each cloud product, the stable data related to the life cycle of the cloud product (such as hourly raw metering data or daily raw metering data) is stored in the data storage module for hourly and daily metering and billing; the second-level raw metering data of the cloud product is asynchronously delivered to the message queue module for second-level metering and billing. The data consumption module listens to the messages in the message queue module and classifies and stores the messages in the data storage module.

[0071] In practical applications, based on service query and heartbeat detection, the task scheduling module can detect faulty nodes, and can issue external alarms to eliminate abnormal nodes and start new nodes. The task scheduling module schedules the metering data collection modules corresponding to each cloud product according to the billing cycles of the cloud products, collects metering data from the data storage module, processes the metering data to generate target metering data, and stores it in the data storage module; the task scheduling module schedules the metering module to perform billing processing on the target metering data using billing rules to generate bills.

[0072] When there is no fault in the link of the cloud product metering and billing system, each main node such as the message queue module (main), data consumption module (main), billing module (main), task scheduling module (main), metering data collection module (main), the data storage module, and the high-availability module cooperate to perform metering and billing for a cloud product such as a single-node version cloud database.

[0073] In practical applications, when there is a fault in the link of the cloud product metering and billing system, the overall system can still maintain normal metering and billing. Each standby node such as the message queue module (standby), data consumption module (standby), billing module (standby), task scheduling module (standby), metering data collection module (standby), the data storage module, and the high-availability module cooperate to perform metering and billing for a cloud product such as a single-node version cloud database. It can be understood that after the main node fails, the standby node becomes the new main node.

[0074] Figure 4b This is a schematic diagram of an application scenario provided by an embodiment of this application. Refer to Figure 4b An easy-to-expand, high-precision, and highly available cloud product metering and billing system includes a message queue module, a data consumption module, a data storage module, a billing module, multiple metering data collection modules, a task scheduling module, and a high-availability module. Any one of the message queue module, data consumption module, data storage module, billing module, metering data collection module, and task scheduling module has a main node and a standby node. The message queue module, data consumption module, data storage module, billing module, and multiple metering data collection modules register the main node and the standby node with the high-availability module through service registration, and regularly update the heartbeat signal to the high-availability module.

[0075] In practical applications, during the daily operation and maintenance of each cloud product, stable data related to the life cycle of the cloud product (such as hourly raw metering data, daily raw metering data, monthly raw metering data) is stored in the data storage module for hourly-level metering and billing, daily-level metering and billing, and monthly-level metering and billing; the second-level raw metering data of the cloud product is asynchronously delivered to the message queue module for second-level metering and billing. The data consumption module listens to the messages in the message queue module and classifies and stores the messages in the data storage module.

[0076] In practical applications, based on service query and heartbeat detection, the task scheduling module can detect faulty nodes, and can issue external exception alerts to eliminate the faulty nodes and start new nodes. The task scheduling module schedules the metering data collection modules corresponding to each cloud product according to the billing cycles of the cloud products, collects metering data from the data storage module, processes the metering data to generate target metering data, and stores it in the data storage module; the task scheduling module schedules the metering module to perform billing processing on the target metering data using the billing rules to generate bills.

[0077] When there is no fault in the link of the cloud product metering and billing system, for the second-level billing scenario, the main nodes such as the message queue module (main), data consumption module (main), billing module (main), task scheduling module (main), metering data collection module (main), and data storage module (main) and the high-availability module cooperate to perform second-level metering and billing for cloud products.

[0078] When there is no fault in the link of the cloud product metering and billing system, for the hourly, daily, and monthly billing scenarios, the main nodes such as the billing module (main), task scheduling module (main), metering data collection module (main), and data storage module (main) and the high-availability module cooperate to perform second-level metering and billing for cloud products.

[0079] In practical applications, when there is a fault in the link of the cloud product metering and billing system, the overall system can still maintain normal metering and billing. For the second-level billing scenario, the standby nodes such as the message queue module (standby), data consumption module (standby), billing module (standby), task scheduling module (standby), metering data collection module (standby), and data storage module (standby) and the high-availability module cooperate to perform metering and billing for cloud products. It can be understood that after the main node fails, the standby node becomes the new main node.

[0080] In practical applications, when there is a fault in the link of the cloud product metering and billing system, the overall system can still maintain normal metering and billing. For the hourly, daily, and monthly billing scenarios, the standby nodes such as the billing module (standby), task scheduling module (standby), metering data collection module (standby), and data storage module (standby) and the high-availability module cooperate to perform metering and billing for cloud products. It can be understood that after the main node fails, the standby node becomes the new main node.

[0081] Figure 5The flowchart of a cloud product metering and billing method provided by an embodiment of this application. This method can be applied to a cloud product metering and billing system. The cloud product metering and billing system includes: a data storage module, a billing module, a task scheduling module, and multiple different metering data collection modules. The multiple different metering data collection modules correspond to multiple different cloud products one by one. The data storage module is respectively connected to the billing module and the multiple different metering data collection modules; the task scheduling module is respectively connected to the billing module and the multiple different metering data collection modules; see Figure 5 , the method may include the following steps:

[0082] 501. The data storage module stores the billing rules and metering data of multiple different cloud products.

[0083] 502. The metering data collection module collects the metering data of the corresponding cloud product from the data storage module, and processes the metering data of the cloud product using the metering data processing logic of the cloud product to obtain the target metering data of the cloud product, and stores the target metering data of the cloud product in the data storage module;

[0084] 503. The billing module obtains the billing rules and target metering data of the cloud product from the data storage module, and bills the target metering data of the cloud product using the billing rules of the cloud product to obtain the billing data of the cloud product;

[0085] 504. The task scheduling module triggers the operation of the metering data collection module and the billing module of the cloud product according to the billing cycle of the cloud product.

[0086] Further optionally, the cloud product metering and billing system further includes: a message queue module and a data consumption module. The message queue module is connected to the data consumption module, and the data consumption module is connected to the data storage module; the above method further includes: the message queue module stores the second-level raw metering data of multiple different cloud products; the data consumption module obtains the second-level raw metering data of multiple different cloud products from the message queue module, and performs data cleaning on the second-level raw metering data of multiple different cloud products to obtain the second-level metering data of multiple different cloud products, and stores the second-level metering data of multiple different cloud products in the data storage module.

[0087] Further optionally, the cloud product metering and billing system further includes: a high-availability module; the high-availability module is respectively connected to the task scheduling module and at least one functional module, and the functional module includes at least one of the following: a data storage module, a billing module, a metering data collection module, a message queue module, or a data consumption module, and the functional module includes a primary node and a secondary node; the above method further includes: the high-availability module responds to the service registration requests of the primary node and the secondary node, and locally registers the service registration information of the primary node and the secondary node respectively; receives the heartbeat signals periodically sent by the primary node and the secondary node and stores them locally; the task scheduling module queries the service registration information from the high-availability module, and determines the target primary node and the target secondary node that need to be heartbeat-detected based on the service registration information; periodically performs heartbeat detection on the target primary node and the target secondary node based on the heartbeat signals of each node stored in the high-availability module; if the heartbeat detection result indicates that the target primary node stops heartbeat and the target secondary node maintains heartbeat, triggers the primary-secondary switch of the target primary node and the target secondary node, and triggers the new target primary node to work.

[0088] Further optionally, the task scheduling module includes a primary scheduling node and a secondary scheduling node; the above method further includes: the primary scheduling node triggers the work of the metering data collection module and the billing module of the cloud product according to the billing cycle of the cloud product, and performs service registration in the high-availability module, and periodically sends a heartbeat signal to the high-availability module for the high-availability module to store the service registration information and heartbeat signal of the primary scheduling node; the secondary scheduling node periodically queries the service registration information and heartbeat signal of the primary scheduling node in the high-availability module; when it is determined that the primary scheduling node is not itself based on the service registration information of the primary scheduling node, periodically performs heartbeat detection on the primary scheduling node based on the heartbeat signal of the primary scheduling node, and if the heartbeat detection result indicates that the primary scheduling node stops heartbeat, switches the secondary scheduling node to a new primary scheduling node, and outputs an alarm message, and the alarm message is used to prompt that the old primary scheduling node is abnormal.

[0089] Further optionally, the metering data collection module is accessed to the system in the form of a plugin.

[0090] For the implementation manners of the steps in the method embodiments, reference may be made to the relevant introductions in the foregoing system embodiments, and details are not described herein again.

[0091] The cloud product metering and billing system provided by the embodiments of this application includes a data storage module, a billing module, a task scheduling module, and multiple different metering data collection modules, and the multiple different metering data collection modules correspond to multiple different cloud products one by one. The billing rules and metering data of multiple different cloud products are stored in the data storage module; for any cloud product, the metering data collection module of the cloud product periodically generates the target metering data of the cloud product according to the billing cycle under the control of the task scheduling module; the billing module, under the control of the task scheduling module, periodically bills the target metering data of the cloud product according to the billing rules of the cloud product. Thus, a cloud product metering and billing system that is easy to expand and has high precision is provided, which can accurately bill multiple different cloud products of different types and forms. Further optionally, a message queue module is introduced to persist the second-level raw metering data of cloud products, and the characteristics of real-time transmission and asynchronous processing of the message queue are used to realize the collection of second-level raw metering data, and finally realize second-level billing, greatly expanding the billing ability of the cloud product metering and billing system, and can effectively handle the second-level billing scenarios of elastic computing, elastic storage, elastic bandwidth, and elastic traffic. Further optionally, the high availability of the full link of the cloud product metering and billing system is realized by combining service registration and node election as the master.

[0092] Figure 6 It is a schematic structural diagram of an electronic device provided by the embodiments of this application. As Figure 6 shown, the electronic device includes: a memory 61 and a processor 62;

[0093] The memory 61 is used to store computer programs and can be configured to store various other data to support operations on the computing platform. Examples of these data include instructions for any application program or method for operating on the computing platform, contact data, phone book data, messages, pictures, videos, etc.

[0094] The memory 61 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0095] A processor 62, coupled to a memory 61, is configured to execute a computer program in the memory 61 for performing steps in a cloud product metering and billing method.

[0096] Further optionally, as Figure 6 shown, the electronic device further includes other components such as a communication component 63, a display 64, a power supply component 65, an audio component 66, etc. Figure 6 Only some components are schematically shown, and it does not mean that the electronic device only includes Figure 6 the components shown. Additionally, Figure 6 the components within the dashed-line box are optional components, rather than mandatory components, and can be determined according to the product form of the electronic device. The electronic device in this embodiment can be implemented as a terminal device such as a desktop computer, a laptop computer, a smart phone, or an IOT (Internet of Things) device, or can also be a server device such as a conventional server, a cloud server, or a server array. If the electronic device in this embodiment is implemented as a terminal device such as a desktop computer, a laptop computer, or a smart phone, it may include Figure 6 the components within the dashed-line box; if the electronic device in this embodiment is implemented as a server device such as a conventional server, a cloud server, or a server array, it may not include Figure 6 the components within the dashed-line box.

[0097] For the detailed implementation process of the processor performing each action, reference can be made to the relevant descriptions in the foregoing method embodiment or device embodiment, and details are not described herein again.

[0098] Correspondingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, and when the computer program is executed, it can implement each step executable by the electronic device in the foregoing method embodiment.

[0099] Correspondingly, an embodiment of the present application further provides a computer program product, including a computer program / instructions, and when the computer program / instructions are executed by a processor, the processor can be caused to implement each step executable by the electronic device in the foregoing method embodiment.

[0100] The above-mentioned communication component is configured to facilitate communication between the device where the communication component is located and other devices in a wired or wireless manner. The device where the communication component is located can access a wireless network based on communication standards, such as WiFi (Wireless Fidelity), 2G (2 Generation), 3G (3 Generation), 4G (4 Generation) / LTE (long Term Evolution), 5G (5 Generation), etc. mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component further includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wide Band (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0101] The above-mentioned display includes a screen, and the screen can include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can sense not only the boundaries of touch or swipe actions but also detect the duration and pressure associated with the touch or swipe operations.

[0102] The above-mentioned power supply component provides power for various components of the device where the power supply component is located. The power supply component can include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device where the power supply component is located.

[0103] The above-mentioned audio component can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC), and when the device where the audio component is located is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive external audio signals. The received audio signals can be further stored in the memory or sent via the communication component. In some embodiments, the audio component further includes a speaker for outputting audio signals.

[0104] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0105] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be realized by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate means for realizing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0106] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including instruction means, and the instruction means realizes the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0107] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for realizing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.

[0108] In a typical configuration, a computing device includes one or more processors (Central Processing Unit, CPU), an input / output interface, a network interface, and a memory.

[0109] The memory may include non-permanent memory in the form of computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0110] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can store information by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change RAM (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, magnetic disk storage or other magnetic storage devices, or any other non-transitory media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.

[0111] It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or apparatus comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or apparatus. Without further limitation, an element qualified by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising the element.

[0112] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.

Claims

1. A cloud product metering and billing system, characterized in that Including: A data storage module, a billing module, a task scheduling module, and multiple different metering data collection modules. The multiple different metering data collection modules correspond to multiple different cloud products one by one. The data storage module is respectively connected to the billing module and the multiple different metering data collection modules; the task scheduling module is respectively connected to the billing module and the multiple different metering data collection modules; The data storage module is used to store the billing rules and metering data of multiple different cloud products; The metering data collection module is used to collect the metering data of the corresponding cloud product from the data storage module, and perform data processing on the metering data of the cloud product by using the metering data processing logic of the cloud product to obtain the target metering data of the cloud product, and store the target metering data of the cloud product into the data storage module; The billing module is used to obtain the billing rules and the target metering data of the cloud product from the data storage module, and perform billing on the target metering data of the cloud product by using the billing rules of the cloud product to obtain the billing data of the cloud product; The task scheduling module is used to trigger the operation of the metering data collection module and the billing module of the cloud product according to the billing cycle of the cloud product.

2. The system according to claim 1, wherein It further includes: A message queue module and a data consumption module. The message queue module is connected to the data consumption module, and the data consumption module is connected to the data storage module; The message queue module is used to store the second-level raw metering data of multiple different cloud products; The data consumption module is used to obtain the second-level raw metering data of multiple different cloud products from the message queue module, perform data cleaning on the second-level raw metering data of multiple different cloud products to obtain the second-level metering data of multiple different cloud products, and store the second-level metering data of multiple different cloud products into the data storage module.

3. The system according to claim 1 or 2, characterized in that It further includes: A high-availability module; The high-availability module is respectively connected to the task scheduling module and at least one functional module. The functional module includes at least one of the following: the data storage module, the billing module, the metering data collection module, the message queue module, or the data consumption module. The functional module includes a master node and a slave node; The high-availability module is used to respond to the service registration requests of the master node and the slave node, and locally register the service registration information of the master node and the slave node respectively; Receive the heartbeat signals periodically sent by the master node and the slave node and store them locally; The task scheduling module is used to query the service registration information from the high-availability module, and determine the target master node and target slave node that need to perform heartbeat detection based on the service registration information; Periodically perform heartbeat detection on the target master node and the target slave node based on the heartbeat signals of each node stored in the high-availability module; If the heartbeat detection result indicates that the target master node stops beating and the target slave node keeps beating, trigger the master-slave switch of the target master node and the target slave node, and trigger the new target master node to work.

4. The system according to claim 1 or 2, characterized in that, The task scheduling module includes a primary scheduling node and a secondary scheduling node; The primary scheduling node is used to trigger the operation of the metering data collection module and the billing module of the cloud product according to the billing cycle of the cloud product, register services in the high-availability module, and periodically send heartbeat signals to the high-availability module for the high-availability module to store the service registration information and heartbeat signals of the primary scheduling node; The secondary scheduling node is used to periodically query the service registration information and heartbeat signals of the primary scheduling node in the high-availability module; When it is determined based on the service registration information of the primary scheduling node that the primary scheduling node is not itself, the secondary scheduling node periodically performs heartbeat detection on the primary scheduling node based on the heartbeat signal of the primary scheduling node. If the heartbeat detection result indicates that the primary scheduling node has stopped beating, the secondary scheduling node is switched to a new primary scheduling node, and an alarm message is output, which is used to prompt that the primary scheduling node is abnormal.

5. The system according to claim 1 or 2, characterized in that The metering data collection module is connected to the system in the form of a plug-in.

6. A cloud product metering and billing method, characterized in that Applied to the cloud product metering and billing system, the system includes: a data storage module, a billing module, a task scheduling module, and multiple different metering data collection modules. The multiple different metering data collection modules correspond to multiple different cloud products one by one. The data storage module is respectively connected to the billing module and the multiple different metering data collection modules; the task scheduling module is respectively connected to the billing module and the multiple different metering data collection modules; the method includes: The data storage module stores the billing rules and metering data of multiple different cloud products; The metering data collection module collects the metering data of the corresponding cloud product from the data storage module, processes the metering data of the cloud product using the metering data processing logic of the cloud product to obtain the target metering data of the cloud product, and stores the target metering data of the cloud product in the data storage module; The billing module obtains the billing rules and target metering data of the cloud product from the data storage module, and bills the target metering data of the cloud product using the billing rules of the cloud product to obtain the billing data of the cloud product; The task scheduling module triggers the operation of the metering data collection module and the billing module of the cloud product according to the billing cycle of the cloud product.

7. The method according to claim 6, characterized in that, The system further includes: a message queue module and a data consumption module. The message queue module is connected to the data consumption module, and the data consumption module is connected to the data storage module; the method further includes: The message queue module stores the second-level raw metering data of multiple different cloud products; The data consumption module obtains the second-level raw metering data of multiple different cloud products from the message queue module, performs data cleaning on the second-level raw metering data of multiple different cloud products to obtain the second-level metering data of multiple different cloud products, and stores the second-level metering data of multiple different cloud products in the data storage module.

8. The method according to claim 6 or 7, characterized in that, The system further includes: a high-availability module; the high-availability module is respectively connected to the task scheduling module and at least one functional module, and the functional module includes at least one of the following: the data storage module, the billing module, the metering data acquisition module, the message queue module, or the data consumption module, and the functional module includes a primary node and a secondary node; the method further includes: The high-availability module responds to the service registration requests of the primary node and the secondary node, and locally registers the service registration information of the primary node and the secondary node respectively; receives the heartbeat signals periodically sent by the primary node and the secondary node and stores them locally; The task scheduling module queries the service registration information from the high-availability module, determines the target primary node and the target secondary node that need to be heartbeat-detected based on the service registration information; periodically performs heartbeat detection on the target primary node and the target secondary node based on the heartbeat signals of each node stored in the high-availability module; if the heartbeat detection result indicates that the target primary node stops beating and the target secondary node keeps beating, triggers the primary-secondary switch of the target primary node and the target secondary node, and triggers the new target primary node to work.

9. The method according to claim 6 or 7, characterized in that, The task scheduling module includes a primary scheduling node and a secondary scheduling node; the method further includes: The primary scheduling node triggers the work of the metering data acquisition module and the billing module of the cloud product according to the billing cycle of the cloud product, and periodically sends a heartbeat signal to the secondary scheduling node; The secondary scheduling node periodically performs heartbeat detection on the primary scheduling node. If the heartbeat detection result indicates that the primary scheduling node stops beating, switches the secondary scheduling node to the new primary scheduling node, and outputs an alarm message, and the alarm message is used to prompt that the old primary scheduling node is abnormal.

10. The method according to claim 6 or 7, characterized in that, The metering data acquisition module is connected to the system in the form of a plug-in.

11. An electronic device, characterized in that, including: a memory and a processor; The memory is used to store a computer program; the processor is coupled to the memory and is used to execute the computer program to execute the steps in the method according to any one of claims 6-10.

12. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it causes the processor to be able to implement the steps in the method according to any one of claims 6-10.