CN114257463A - Charging method, charging device, electronic equipment and computer readable storage medium - Google Patents

Charging method, charging device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN114257463A
CN114257463A CN202010952466.7A CN202010952466A CN114257463A CN 114257463 A CN114257463 A CN 114257463A CN 202010952466 A CN202010952466 A CN 202010952466A CN 114257463 A CN114257463 A CN 114257463A
Authority
CN
China
Prior art keywords
tenant
sub
target
domain name
total
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010952466.7A
Other languages
Chinese (zh)
Inventor
陈雨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Cloud Network Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Cloud Network Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN202010952466.7A priority Critical patent/CN114257463A/en
Publication of CN114257463A publication Critical patent/CN114257463A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/14Charging, metering or billing arrangements for data wireline or wireless communications
    • H04L12/1403Architecture for metering, charging or billing

Abstract

The embodiment of the application provides a charging method, a charging device, electronic equipment and a computer readable storage medium, wherein the method comprises the following steps: for each sub-tenant contained in the target tenant, determining a domain name corresponding to the sub-tenant based on a preset corresponding relation between the sub-tenant and the domain name; calculating the ratio of the flow value generated when the user accesses the domain name corresponding to the sub-tenant and the total flow value, and taking the ratio as the flow ratio corresponding to the sub-tenant; calculating the total cost to be paid by the target tenant aiming at each domain name based on the total flow value; and calculating the product of the flow occupation ratio corresponding to each sub-tenant and the total cost as the cost allocated by the sub-tenant. Based on the above processing, the cost to be shared by each sub-tenant included in the target tenant can be determined.

Description

Charging method, charging device, electronic equipment and computer readable storage medium
Technical Field
The present application relates to the field of computer network technologies, and in particular, to a charging method, an apparatus, an electronic device, and a computer-readable storage medium.
Background
With the rapid development of computer Network technology, the use of CDN (Content Delivery Network) is also becoming more and more widespread. The CDN may include a plurality of nodes, and a node in the CDN is configured to process a service request sent by a terminal.
The CDN provider may provide the tenants with the CDN's rental service. The tenant may create multiple domain names based on the CDN to provide network services for the user, for example, the tenant may provide live video services for the user through the CDN. When the preset charging time is reached, for each domain name created by the tenant, the CDN provider may count the traffic value generated when the user accesses the domain name in the current charging period, and further, for a tenant, may count the total traffic value generated when the user accesses each domain name created by the tenant in the current charging period, and calculate the total cost that the tenant should pay for each domain name based on the total traffic value.
However, one tenant may include a plurality of sub-tenants, and in the related art, a corresponding method is not provided to determine the cost that should be shared by each of the plurality of sub-tenants.
Disclosure of Invention
Embodiments of the present application provide a charging method, an apparatus, an electronic device, and a computer-readable storage medium, which are capable of determining respective costs allocated to each sub-tenant included in a tenant. The specific technical scheme is as follows:
in a first aspect, to achieve the above object, an embodiment of the present application discloses a charging method, where the method includes:
for each sub-tenant contained in the target tenant, determining a domain name corresponding to the sub-tenant based on a preset corresponding relation between the sub-tenant and the domain name;
calculating the ratio of the flow value generated when the user accesses the domain name corresponding to the sub-tenant and the total flow value, and taking the ratio as the flow ratio corresponding to the sub-tenant; wherein the total traffic value represents a sum of traffic values generated by users accessing domain names created by the target tenant;
calculating the total fee to be paid by the target tenant for each domain name based on the total flow value;
and calculating the product of the flow occupation ratio corresponding to each sub-tenant and the total cost as the cost allocated by the sub-tenant.
Optionally, the method further includes:
when a domain name adding instruction sent by the target tenant is received, extracting a target domain name carried in the domain name adding instruction and a tenant identification of a target sub-tenant;
and correspondingly adding the target domain name and the tenant identification of the target sub-tenant into the corresponding relation.
Optionally, the calculating, based on the total flow value, a total fee that the target tenant should pay for each domain name includes:
determining a flow value interval to which the total flow belongs from preset adjacent flow value intervals as a first flow value interval;
and calculating the total fee to be paid by the target tenant for each domain name based on the total flow value and the charging unit price corresponding to the first flow value interval.
Optionally, the calculating, based on the total traffic value and the charging unit price corresponding to the first traffic value interval, a total fee that the target tenant should pay for each domain name includes:
calculating a difference value between the total flow value and a minimum value in the first flow value interval as a target difference value;
calculating the product of the target difference value and the charging unit price corresponding to the first traffic value interval as a first fee;
and calculating the total fee to be paid by the target tenant for each domain name based on the first fee.
Optionally, before the calculating, based on the first fee, a total fee that the target tenant should pay for each domain name, the method further includes:
calculating the product of the length of the second traffic value interval and the charging unit price corresponding to the second traffic value interval as the second cost corresponding to the second traffic value interval aiming at each second traffic value interval smaller than the first traffic value interval;
the calculating, based on the first fee, a total fee that the target tenant should pay for each domain name includes:
and calculating a sum of the second cost and the first cost corresponding to each second traffic value interval as a total cost to be paid by the target tenant for each domain name.
Optionally, after the calculating, for each sub-tenant, a product of the traffic ratio corresponding to the sub-tenant and the total cost, as the cost shared by the sub-tenant, the method further includes:
and generating a bill of the target tenant in the current charging period, wherein the bill records each sub-tenant contained in the target tenant, the cost respectively allocated by each sub-tenant, and a flow value generated when a user accesses a domain name corresponding to each sub-tenant.
In a second aspect, in order to achieve the above object, an embodiment of the present application discloses a charging apparatus, including:
the domain name determining module is used for determining a domain name corresponding to each sub-tenant contained in the target tenant based on the preset corresponding relation between the sub-tenant and the domain name;
the flow ratio calculation module is used for calculating the ratio of the flow value generated when the user accesses the domain name corresponding to the sub-tenant and the total flow value, and the ratio is used as the flow ratio corresponding to the sub-tenant; wherein the total traffic value represents a sum of traffic values generated by users accessing domain names created by the target tenant;
a first fee calculation module, configured to calculate, based on the total flow value, a total fee that the target tenant should pay for each domain name;
and the second expense calculation module is used for calculating the product of the flow occupation ratio corresponding to the sub-tenant and the total expense for each sub-tenant, and the product is used as the expense allocated by the sub-tenant.
Optionally, the apparatus further comprises:
the extracting module is used for extracting a target domain name carried in the domain name adding instruction and a tenant identification of a target sub-tenant when the domain name adding instruction sent by the target tenant is received;
and the adding module is used for correspondingly adding the target domain name and the tenant identification of the target sub-tenant into the corresponding relationship.
Optionally, the first fee calculating module includes:
the first flow value interval determining submodule is used for determining a flow value interval to which the total flow belongs from preset adjacent flow value intervals to serve as a first flow value interval;
and the total charge calculation submodule is used for calculating the total charge which the target tenant should pay for each domain name based on the total flow value and the charging unit price corresponding to the first flow value interval.
Optionally, the total cost calculating sub-module includes:
a target difference value calculation unit for calculating a difference value between the total flow value and a minimum value in the first flow value interval as a target difference value;
the first charge calculation unit is used for calculating the product of the target difference value and the charging unit price corresponding to the first flow value interval as a first charge;
and the total fee calculating unit is used for calculating the total fee to be paid by the target tenant aiming at each domain name based on the first fee.
Optionally, the apparatus further comprises:
a third fee calculating module, configured to calculate, for each second traffic value interval smaller than the first traffic value interval, a product of a length of the second traffic value interval and a charging unit price corresponding to the second traffic value interval as a second fee corresponding to the second traffic value interval before calculating, based on the first fee, a total fee to be paid by the target tenant for each domain name;
the total cost calculating unit is specifically configured to calculate a sum of the first cost and the second cost corresponding to each second traffic value interval, as a total cost that the target tenant should pay for each domain name.
Optionally, the apparatus further comprises:
and the bill generation module is used for calculating the product of the flow rate occupation ratio corresponding to each sub-tenant and the total cost of the sub-tenant, and generating a bill of the target tenant in the current charging period after the product is used as the cost allocated by the sub-tenant, wherein the bill records the cost of each sub-tenant and the cost allocated by each sub-tenant contained in the target tenant, and a flow rate value generated when a user accesses a domain name corresponding to each sub-tenant.
On the other hand, in order to achieve the above object, an embodiment of the present application further discloses an electronic device, which includes a memory and a processor;
the memory is used for storing a computer program;
the processor is configured to implement the charging method according to the first aspect when executing the program stored in the memory.
On the other hand, in order to achieve the above object, an embodiment of the present application further discloses a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the charging method according to the first aspect.
On the other hand, in order to achieve the above object, an embodiment of the present application further discloses a computer program product containing instructions, which when run on a computer, causes the computer to execute the charging method according to the first aspect.
The embodiment of the application provides a charging method, aiming at each sub-tenant contained in a target tenant, determining a domain name corresponding to the sub-tenant based on a preset corresponding relation between the sub-tenant and the domain name; calculating the ratio of the flow value generated when the user accesses the domain name corresponding to the sub-tenant and the total flow value, and taking the ratio as the flow ratio corresponding to the sub-tenant; calculating the total cost to be paid by the target tenant aiming at each domain name based on the total flow value; and calculating the product of the flow occupation ratio corresponding to each sub-tenant and the total cost as the cost allocated by the sub-tenant. Based on the above processing, the cost respectively allocated to each sub-tenant included in the target tenant can be determined.
Of course, not all advantages described above need to be achieved at the same time in the practice of any one product or method of the present application.
Drawings
In order to more clearly illustrate the embodiments of the present application 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 application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a charging method according to an embodiment of the present application;
fig. 2 is a flowchart of another charging method provided in the embodiment of the present application;
fig. 3 is a flowchart of another charging method provided in the embodiment of the present application;
fig. 4 is a flowchart of another charging method provided in the embodiment of the present application;
fig. 5 is a schematic diagram of data processing in a charging method according to an embodiment of the present application;
fig. 6 is a structural diagram of a charging apparatus according to an embodiment of the present application;
fig. 7 is a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, 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 application.
A tenant renting CDN services may include a plurality of sub-tenants, and in the related art, no corresponding method is provided for determining the cost that each of the plurality of sub-tenants should share.
In order to solve the above problem, an embodiment of the present application provides a charging method, where the method may be applied to an electronic device, and the electronic device may be a node in a CDN, or the electronic device may also be a device capable of performing data communication with the node in the CDN. The electronic device can acquire a traffic value obtained by node statistics in the CDN, and further can determine the cost respectively allocated to a plurality of sub-tenants contained in one tenant according to the acquired traffic value.
Referring to fig. 1, fig. 1 is a flowchart of a charging method provided in an embodiment of the present application, where the method may include the following steps:
s101: and determining the domain name corresponding to each sub-tenant contained in the target tenant based on the preset corresponding relation between the sub-tenant and the domain name.
S102: and calculating the ratio of the flow value generated by the user accessing the domain name corresponding to the sub-tenant to the total flow value, and taking the ratio as the flow ratio corresponding to the sub-tenant.
Wherein the total traffic value represents the sum of the traffic values generated by the users accessing the domain names created by the target tenant.
S103: and calculating the total fee to be paid by the target tenant aiming at each domain name based on the total flow value.
S104: and calculating the product of the flow occupation ratio corresponding to each sub-tenant and the total cost as the cost allocated by the sub-tenant.
The charging method provided by the embodiment of the application can determine the respective allocated cost of each sub-tenant contained in the target tenant.
In an implementation manner, the method of the embodiment of the application can be applied to a cloud platform.
For step S101, the target tenant may be any tenant renting the CDN service. For example, the target tenant may be a company, and each sub-tenant included in the target tenant may be each department included in the company.
The preset corresponding relationship between the sub-tenants and the domain name can be determined according to the domain name created by the target tenant and the sub-tenants corresponding to each domain name set by the target tenant.
In one embodiment, a sub-tenant may correspond to one or more projects, a project may be understood as a network service developed by a department, and a project may correspond to one or more domain names, that is, a domain name corresponding to a sub-tenant may include all domain names corresponding to projects corresponding to the sub-tenant.
With respect to step S102, in one embodiment, the fee to be paid by the target tenant may be calculated according to a preset charging period. For example, a month can be taken as a charging period, and at the end of each month, the sum of the traffic values generated by the user accessing each domain name created by the target tenant in the month can be counted.
Further, the total fee that the target tenant should pay for each domain name in the month and the respective shared fees of each sub-tenant included in the target tenant in the month can be calculated.
In one embodiment, the method may further comprise the steps of:
the method comprises the following steps: when a domain name adding instruction sent by a target tenant is received, a target domain name carried in the domain name adding instruction and a tenant identification of a target sub-tenant are extracted.
Step two: and correspondingly adding the target domain name and the tenant identification of the target sub-tenant into the corresponding relation.
In the embodiment of the present application, as the service of the target tenant extends, the target tenant may add a new domain name.
Correspondingly, when a new domain name is added by the target tenant, the corresponding relation between the sub-tenant and the domain name can be updated based on the new domain name added by the target tenant.
In an implementation manner, a domain name adding interface may be displayed, and further, a target tenant may input a domain name to be added (i.e., a target domain name in this embodiment of the present application) in the domain name adding interface.
In addition, the target tenant may also set a sub-tenant corresponding to the added domain name in the domain name addition interface (i.e., the target sub-tenant in the embodiment of the present application). In one implementation, the target tenant may input the tenant identity of the target sub-tenant in a domain name addition interface. For example, if the target tenant represents a company, the tenant identity of the target sub-tenant may be a department name of a department contained by the company.
Further, the target domain name and the tenant identity of the target sub-tenant may be correspondingly added to the correspondence based on the information input by the target tenant.
In one embodiment, in order to reduce the cost of the tenant as much as possible, referring to fig. 2, step S103 may include the following steps:
s1031: and determining a flow value interval to which the total flow belongs from preset adjacent flow value intervals as a first flow value interval.
S1032: and calculating the total cost to be paid by the target tenant aiming at each domain name based on the total flow value and the charging unit price corresponding to the first flow value interval.
In this embodiment of the application, the preset adjacent flow value intervals may be set by a CDN service provider based on a service requirement.
For example, the preset adjacent flow value intervals may include: [0G, 500G ], (500G, 1000G ], (1000G, 10000G ], and (10000G, ∞).
If the total flow rate is 1900G, the first flow rate value interval may be determined to be (1000G, 10000G).
Each flow value interval may correspond to a different charging unit price, for example, the charging unit price of [0G, 500G ] may be 1 yuan/G, (the charging unit price of 500G, 1000G ] may be 0.95 yuan/G, (the charging unit price of 1000G, 10000G ] may be 0.9 yuan/G, (the charging unit price of 10000G, infinity) may be 0.85 yuan/G.
Correspondingly, the total flow is 1900G, and the total fee that the target tenant should pay for each domain name can be calculated based on the charging unit price of 0.9 yuan/G of (1000G, 10000G).
In one implementation, the product of the total traffic value and the charging unit price corresponding to the first traffic value interval may be directly calculated as the total fee that the target tenant should pay for each domain name.
For example, 1900G × 0.9 yuan/G can be directly calculated, and the total fee that the target tenant should pay for each domain name is obtained.
In one embodiment, referring to fig. 3, step S1032 may include the steps of:
s10321: and calculating the difference value between the total flow value and the minimum value in the first flow value interval as a target difference value.
S10322: and calculating the product of the target difference value and the charging unit price corresponding to the first traffic value interval as the first cost.
S10323: and calculating the total fee to be paid by the target tenant for each domain name based on the first fee.
In the embodiment of the application, after the first flow value interval is determined, for the flow value part belonging to the first flow value interval, the charging unit price corresponding to the first flow value interval can be adopted for calculation; for the traffic value part not belonging to the first traffic value interval, other charging unit prices can be adopted for calculation.
For example, the preset adjacent flow value intervals may include: the charging unit price of [0G, 500G ], (500G, 1000G ], (1000G, 10000G ], and (10000G, ∞) [0G, 500G ] may be 1 yuan/G, the charging unit price of (500G, 1000G ] may be 0.95 yuan/G, the charging unit price of (1000G, 10000G ] may be 0.9 yuan/G, and the charging unit price of (10000G, ∞) may be 0.85 yuan/G.
If the total flow is 1900G, then the first flow value interval may be determined to be (1000G, 10000G.) the difference between the total flow value 1900G and the minimum value 1000G in the first flow value interval is 900G (i.e., the target difference).
Further, the product of the target difference 900G and the charging unit price of 0.9 yuan/G corresponding to the first traffic value interval may be calculated as the first fee.
Furthermore, the fees corresponding to other 1000G flows can be calculated, and the total fee to be paid by the target tenant for each domain name can be obtained by combining the first fee.
In one embodiment, referring to fig. 4, prior to step S10323, the method may further comprise the steps of:
s105: and calculating the product of the length of the second traffic value interval and the charging unit price corresponding to the second traffic value interval as the second cost corresponding to the second traffic value interval aiming at each second traffic value interval smaller than the first traffic value interval.
Accordingly, referring to fig. 4, S10323 may include the steps of:
S10323A: and calculating the sum of the second cost and the first cost corresponding to each second flow value interval as the total cost to be paid by the target tenant for each domain name.
For example, the preset adjacent flow value intervals may include: the charging unit price of [0G, 500G ], (500G, 1000G ], (1000G, 10000G ], and (10000G, ∞) [0G, 500G ] may be 1 yuan/G, the charging unit price of (500G, 1000G ] may be 0.95 yuan/G, the charging unit price of (1000G, 10000G ] may be 0.9 yuan/G, and the charging unit price of (10000G, ∞) may be 0.85 yuan/G.
If the total flow is 1900G, then the first flow value interval may be determined to be (1000G, 10000G.) the difference between the total flow value 1900G and the minimum value 1000G in the first flow value interval is 900G (i.e., the target difference).
Further, the product of the target difference 900G and the charging unit price of 0.9 yuan/G corresponding to the first traffic value interval may be calculated as the first fee.
Then, it may also be determined that the second flow value interval comprises: [0G, 500G ] and (500G, 1000G ].
For [0G, 500G ], 500 Gx 1 Yuan/G can be calculated, resulting in a corresponding second cost.
For (500G, 1000G ], 500G × 0.95 Yuan/G can be calculated, resulting in a corresponding second cost.
Then, 900 gx 0.9 yuan/G +500 gx 1 yuan/G +1000 gx 0.95 yuan/G can be calculated, and the total fee to be paid by the target tenant for each domain name can be obtained.
In this embodiment of the application, step S105, step S10321, and step S10322 may be executed simultaneously, or may be executed sequentially, and the execution sequence of step S105, step S10321, and step S10322 is not limited.
In one embodiment, in order to improve the user experience of the tenant, after step S104, the method may further include the steps of:
and generating a bill of the target tenant in the current charging period.
The bill records sub-tenants contained in the target tenant, the cost respectively allocated by the sub-tenants, and a flow value generated when the user accesses a domain name corresponding to each sub-tenant.
Correspondingly, the tenant can download the generated bill, and further, the target tenant can determine the cost respectively allocated by each sub-tenant and the traffic value generated when the user accesses the domain name corresponding to each sub-tenant.
Referring to fig. 5, fig. 5 is a schematic diagram of data processing in a charging method according to an embodiment of the present application.
The preset adjacent flow value intervals may include: the charging unit price of [0G, 500G ], (500G, 1000G ], (1000G, 10000G ], and (10000G, ∞) [0G, 500G ] may be 1 yuan/G, (the charging unit price of 500G, 1000G ] may be 0.95 yuan/G, (the charging unit price of 1000G, 10000G ] may be 0.9 yuan/G, (the charging unit price of 10000G, ∞) may be 0.85 yuan/G, and the total flow rate is 1900G.
In fig. 5, item 1, item 2, and item 3 may belong to different sub-tenants, respectively, and based on fig. 5, the cost shared by each item may be obtained, and further, for each sub-tenant, the sum of the costs shared by the items corresponding to the sub-tenant may be calculated as the cost shared by the sub-tenant.
Based on the same inventive concept, an embodiment of the present application further provides a charging apparatus, referring to fig. 6, where fig. 6 is a structural diagram of the charging apparatus provided in the embodiment of the present application, and the apparatus includes:
a domain name determining module 601, configured to determine, for each sub-tenant included in the target tenant, a domain name corresponding to the sub-tenant based on a preset correspondence between the sub-tenant and the domain name;
a traffic proportion calculation module 602, configured to calculate a ratio of a traffic value generated when the user accesses the domain name corresponding to the sub-tenant and a total traffic value, where the ratio is used as the traffic proportion corresponding to the sub-tenant; wherein the total traffic value represents a sum of traffic values generated by users accessing domain names created by the target tenant;
a first fee calculating module 603, configured to calculate, based on the total traffic value, a total fee that the target tenant should pay for each domain name;
a second cost calculating module 604, configured to calculate, for each sub-tenant, a product of the traffic ratio corresponding to the sub-tenant and the total cost, as the cost shared by the sub-tenant.
In one embodiment, the apparatus further comprises:
the extracting module is used for extracting a target domain name carried in the domain name adding instruction and a tenant identification of a target sub-tenant when the domain name adding instruction sent by the target tenant is received;
and the adding module is used for correspondingly adding the target domain name and the tenant identification of the target sub-tenant into the corresponding relationship.
In one embodiment, the first fee calculation module 603 includes:
the first flow value interval determining submodule is used for determining a flow value interval to which the total flow belongs from preset adjacent flow value intervals to serve as a first flow value interval;
and the total charge calculation submodule is used for calculating the total charge which the target tenant should pay for each domain name based on the total flow value and the charging unit price corresponding to the first flow value interval.
In one embodiment, the total cost calculation submodule includes:
a target difference value calculation unit for calculating a difference value between the total flow value and a minimum value in the first flow value interval as a target difference value;
the first charge calculation unit is used for calculating the product of the target difference value and the charging unit price corresponding to the first flow value interval as a first charge;
and the total fee calculating unit is used for calculating the total fee to be paid by the target tenant aiming at each domain name based on the first fee.
In one embodiment, the apparatus further comprises:
a third fee calculating module, configured to calculate, for each second traffic value interval smaller than the first traffic value interval, a product of a length of the second traffic value interval and a charging unit price corresponding to the second traffic value interval as a second fee corresponding to the second traffic value interval before calculating, based on the first fee, a total fee to be paid by the target tenant for each domain name;
the total cost calculating unit is specifically configured to calculate a sum of the first cost and the second cost corresponding to each second traffic value interval, as a total cost that the target tenant should pay for each domain name.
In one embodiment, the apparatus further comprises:
and the bill generation module is used for calculating the product of the flow rate occupation ratio corresponding to each sub-tenant and the total cost of the sub-tenant, and generating a bill of the target tenant in the current charging period after the product is used as the cost allocated by the sub-tenant, wherein the bill records the cost of each sub-tenant and the cost allocated by each sub-tenant contained in the target tenant, and a flow rate value generated when a user accesses a domain name corresponding to each sub-tenant.
An embodiment of the present application further provides an electronic device, as shown in fig. 7, including a memory 701 and a processor 702;
a memory 701 for storing a computer program;
the processor 702 is configured to implement the charging method provided in the embodiment of the present application when executing the program stored in the memory 701.
Specifically, the charging method includes:
for each sub-tenant contained in the target tenant, determining a domain name corresponding to the sub-tenant based on a preset corresponding relation between the sub-tenant and the domain name;
calculating the ratio of the flow value generated when the user accesses the domain name corresponding to the sub-tenant and the total flow value, and taking the ratio as the flow ratio corresponding to the sub-tenant; wherein the total traffic value represents a sum of traffic values generated by users accessing domain names created by the target tenant;
calculating the total fee to be paid by the target tenant for each domain name based on the total flow value;
and calculating the product of the flow occupation ratio corresponding to each sub-tenant and the total cost as the cost allocated by the sub-tenant.
It should be noted that other implementation manners of the charging method are the same as those of the foregoing method embodiment, and are not described herein again.
The electronic device may be provided with a communication interface for realizing communication between the electronic device and another device.
The processor, the communication interface, and the memory are configured to communicate with each other through a communication bus, where the communication bus may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus may be divided into an address bus, a data bus, a control bus, etc.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In yet another embodiment provided by the present application, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any of the above charging methods.
In yet another embodiment provided by the present application, there is also provided a computer program product containing instructions that, when run on a computer, cause the computer to perform any of the charging methods of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, system, electronic device, computer-readable storage medium, and computer program product embodiments, the description is relatively simple as it is substantially similar to the method embodiments, and reference may be made to some descriptions of the method embodiments for relevant points.
The above description is only for the preferred embodiment of the present application and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (14)

1. A charging method, characterized in that the method comprises:
for each sub-tenant contained in the target tenant, determining a domain name corresponding to the sub-tenant based on a preset corresponding relation between the sub-tenant and the domain name;
calculating the ratio of the flow value generated when the user accesses the domain name corresponding to the sub-tenant and the total flow value, and taking the ratio as the flow ratio corresponding to the sub-tenant; wherein the total traffic value represents a sum of traffic values generated by users accessing domain names created by the target tenant;
calculating the total fee to be paid by the target tenant for each domain name based on the total flow value;
and calculating the product of the flow occupation ratio corresponding to each sub-tenant and the total cost as the cost allocated by the sub-tenant.
2. The method of claim 1, further comprising:
when a domain name adding instruction sent by the target tenant is received, extracting a target domain name carried in the domain name adding instruction and a tenant identification of a target sub-tenant;
and correspondingly adding the target domain name and the tenant identification of the target sub-tenant into the corresponding relation.
3. The method of claim 1, wherein the calculating a total fee that the target tenant should pay for each domain name based on the total flow value comprises:
determining a flow value interval to which the total flow belongs from preset adjacent flow value intervals as a first flow value interval;
and calculating the total fee to be paid by the target tenant for each domain name based on the total flow value and the charging unit price corresponding to the first flow value interval.
4. The method according to claim 3, wherein the calculating a total fee that the target tenant should pay for each domain name based on the total traffic value and the charging unit price corresponding to the first traffic value interval includes:
calculating a difference value between the total flow value and a minimum value in the first flow value interval as a target difference value;
calculating the product of the target difference value and the charging unit price corresponding to the first traffic value interval as a first fee;
and calculating the total fee to be paid by the target tenant for each domain name based on the first fee.
5. The method of claim 4, wherein before the calculating, based on the first fee, a total fee that the target tenant should pay for the domain names, the method further comprises:
calculating the product of the length of the second traffic value interval and the charging unit price corresponding to the second traffic value interval as the second cost corresponding to the second traffic value interval aiming at each second traffic value interval smaller than the first traffic value interval;
the calculating, based on the first fee, a total fee that the target tenant should pay for each domain name includes:
and calculating a sum of the second cost and the first cost corresponding to each second traffic value interval as a total cost to be paid by the target tenant for each domain name.
6. The method according to claim 1, wherein after the calculating, for each of the sub-tenants, a product of the traffic ratio corresponding to the sub-tenant and the total cost as the cost shared by the sub-tenant, the method further comprises:
and generating a bill of the target tenant in the current charging period, wherein the bill records each sub-tenant contained in the target tenant, the cost respectively allocated by each sub-tenant, and a flow value generated when a user accesses a domain name corresponding to each sub-tenant.
7. A charging apparatus, characterized in that the apparatus comprises:
the domain name determining module is used for determining a domain name corresponding to each sub-tenant contained in the target tenant based on the preset corresponding relation between the sub-tenant and the domain name;
the flow ratio calculation module is used for calculating the ratio of the flow value generated when the user accesses the domain name corresponding to the sub-tenant and the total flow value, and the ratio is used as the flow ratio corresponding to the sub-tenant; wherein the total traffic value represents a sum of traffic values generated by users accessing domain names created by the target tenant;
a first fee calculation module, configured to calculate, based on the total flow value, a total fee that the target tenant should pay for each domain name;
and the second expense calculation module is used for calculating the product of the flow occupation ratio corresponding to the sub-tenant and the total expense for each sub-tenant, and the product is used as the expense allocated by the sub-tenant.
8. The apparatus of claim 7, further comprising:
the extracting module is used for extracting a target domain name carried in the domain name adding instruction and a tenant identification of a target sub-tenant when the domain name adding instruction sent by the target tenant is received;
and the adding module is used for correspondingly adding the target domain name and the tenant identification of the target sub-tenant into the corresponding relationship.
9. The apparatus of claim 7, wherein the first fee calculation module comprises:
the first flow value interval determining submodule is used for determining a flow value interval to which the total flow belongs from preset adjacent flow value intervals to serve as a first flow value interval;
and the total charge calculation submodule is used for calculating the total charge which the target tenant should pay for each domain name based on the total flow value and the charging unit price corresponding to the first flow value interval.
10. The apparatus of claim 9, wherein the total cost calculation sub-module comprises:
a target difference value calculation unit for calculating a difference value between the total flow value and a minimum value in the first flow value interval as a target difference value;
the first charge calculation unit is used for calculating the product of the target difference value and the charging unit price corresponding to the first flow value interval as a first charge;
and the total fee calculating unit is used for calculating the total fee to be paid by the target tenant aiming at each domain name based on the first fee.
11. The apparatus of claim 10, further comprising:
a third fee calculating module, configured to calculate, for each second traffic value interval smaller than the first traffic value interval, a product of a length of the second traffic value interval and a charging unit price corresponding to the second traffic value interval as a second fee corresponding to the second traffic value interval before calculating, based on the first fee, a total fee to be paid by the target tenant for each domain name;
the total cost calculating unit is specifically configured to calculate a sum of the first cost and the second cost corresponding to each second traffic value interval, as a total cost that the target tenant should pay for each domain name.
12. The apparatus of claim 7, further comprising:
and the bill generation module is used for calculating the product of the flow rate occupation ratio corresponding to each sub-tenant and the total cost of the sub-tenant, and generating a bill of the target tenant in the current charging period after the product is used as the cost allocated by the sub-tenant, wherein the bill records the cost of each sub-tenant and the cost allocated by each sub-tenant contained in the target tenant, and a flow rate value generated when a user accesses a domain name corresponding to each sub-tenant.
13. An electronic device comprising a memory and a processor;
the memory is used for storing a computer program;
the processor, when executing the program stored in the memory, implementing the method steps of any of claims 1-6.
14. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 6.
CN202010952466.7A 2020-09-11 2020-09-11 Charging method, charging device, electronic equipment and computer readable storage medium Pending CN114257463A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010952466.7A CN114257463A (en) 2020-09-11 2020-09-11 Charging method, charging device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010952466.7A CN114257463A (en) 2020-09-11 2020-09-11 Charging method, charging device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN114257463A true CN114257463A (en) 2022-03-29

Family

ID=80788035

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010952466.7A Pending CN114257463A (en) 2020-09-11 2020-09-11 Charging method, charging device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN114257463A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1749697A (en) * 2005-08-23 2006-03-22 郑州春泉暖通节能设备有限公司 Equivalent energy charging method for central air conditioner metering fee
US20160205007A1 (en) * 2014-07-31 2016-07-14 Corent Technology, Inc. Multi-Application SaaS Metering Engine
WO2018001181A1 (en) * 2016-06-29 2018-01-04 中兴通讯股份有限公司 Charging method and charging system
CN109743700A (en) * 2019-02-27 2019-05-10 中国联合网络通信集团有限公司 The charging method and message accounting of shared service
CN110311838A (en) * 2019-07-24 2019-10-08 北京神州绿盟信息安全科技股份有限公司 A kind of method and device of security service traffic statistics

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1749697A (en) * 2005-08-23 2006-03-22 郑州春泉暖通节能设备有限公司 Equivalent energy charging method for central air conditioner metering fee
US20160205007A1 (en) * 2014-07-31 2016-07-14 Corent Technology, Inc. Multi-Application SaaS Metering Engine
WO2018001181A1 (en) * 2016-06-29 2018-01-04 中兴通讯股份有限公司 Charging method and charging system
CN109743700A (en) * 2019-02-27 2019-05-10 中国联合网络通信集团有限公司 The charging method and message accounting of shared service
CN110311838A (en) * 2019-07-24 2019-10-08 北京神州绿盟信息安全科技股份有限公司 A kind of method and device of security service traffic statistics

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李华: "动态查询校园网流量计费的实现", 湛江师范学院学报, no. 06, 30 December 2002 (2002-12-30) *

Similar Documents

Publication Publication Date Title
EP3644264A1 (en) Diagnostic device rental method, server, and storage medium
CN110233741B (en) Service charging method, device, equipment and storage medium
CN110022259B (en) Message arrival rate determining method and device, data statistics server and storage medium
CN111062758A (en) Pricing method, device and system of cloud product
CN111461763A (en) Resource allocation method and device
CN110969492A (en) Pricing method, device and system of cloud product
CN111709777A (en) Payment mode recommendation method, system, terminal device and storage medium
CN113516507A (en) Resource charging method and device for multi-cloud management platform
CN111222861A (en) Method and device for recharging after arrearage and computing equipment
CN113821307B (en) Method, device and equipment for quickly importing virtual machine images
CN111988749A (en) Dynamic tariff generation method and device
CN106934708B (en) Event recording method and device
CN109618070B (en) Call bill charging method, device, equipment and medium
CN109902109B (en) Multi-party collaborative data mining method and device
CN114257463A (en) Charging method, charging device, electronic equipment and computer readable storage medium
JP6418428B1 (en) Private accommodation management support system and private accommodation management support method
CN110969493A (en) Bill amount determining method and device, electronic equipment and storage medium
CN110300000B (en) Charging mode changing method and device, electronic equipment and readable storage medium
CN115456709A (en) Equipment leasing method and device and electronic equipment
CN110602665B (en) Method for determining sharing service index based on communication certificate sharing service
CN103971165A (en) Information processing system and information processing method
CN108346080B (en) Flow package combination optimization method and device
KR101930015B1 (en) Method providing advertisement service using application and server performing the same
CN112312383B (en) Service processing method and device for home user, storage medium and server
CN112950257B (en) Data use price calculating method, device, computer equipment and storage medium

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