A network service charging method and system
By recording billing point data in the billing service and generating billing bills using billing strategies, the problem of coupling billing logic and business logic is solved, the billing logic and business logic is decoupled, billing efficiency and adaptability are improved, and billing needs of diversified products are supported.
Patent Information
- Application Number
- CN202411994512.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2044-12-31
AI Technical Summary
In the existing billing system, the billing logic and business logic are severely coupled, resulting in low business processing efficiency and difficulty in adapting to diversified billing needs and rapidly iterating Internet products, increasing the probability of adjustments and errors.
By recording billing point data in the billing service, creating billing orders using billing strategies, and generating billing bills through timed tasks, the billing logic and business logic are decoupled, supporting unified billing for diverse products, and adopting flexible billing strategies of billing cycles, types and prepaid and postpaid types.
It realizes the decoupling of billing logic and business logic, can quickly adapt to changes in business needs, improve billing efficiency, reduce the probability of errors, and support the billing needs of diversified products.
Smart Images

Figure CN119788534B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a network service billing method and system. Background Art
[0002] With the rapid development of the Internet industry, it has not only achieved varying degrees of integration with various traditional industries, but has also gradually formed a large-scale and systematic industrial system. Network service providers serving different industries have emerged. There are huge differences in the sales forms and specifications of different network services, which has brought unprecedented challenges to the management of the billing system.
[0003] Existing billing services suffer from a severe coupling between billing logic and business logic. When users request a service, they must not only verify authentication and parameters from a business perspective, but also verify account balances and other parameters from a billing perspective. Furthermore, the billing logic must be processed synchronously after the business logic is processed to complete the deduction. This not only reduces business processing efficiency but can even lead to billing logic anomalies that impact normal business responses. Furthermore, current billing systems struggle to adapt to complex and diverse billing needs. Due to the rapid development and iteration of internet products, and the wide variety of products across various industries, each with varying billing requirements and specifications, current billing systems typically develop specific billing logic for specific billing needs. This logic must also be adjusted with every product logic update. Furthermore, this approach requires re-adjusting all billing logic when adding unified functionality to the billing logic (such as support for discounts), which is time-consuming and labor-intensive, and increases the probability of errors. Summary of the Invention
[0004] In view of the above-mentioned defects or deficiencies in the prior art, the present invention provides a network service billing method and system, which decouples billing logic from business logic and implements unified billing for diversified products through flexible billing strategies.
[0005] In a first aspect, an embodiment of the present invention provides a network service billing method, comprising:
[0006] In response to the activation of the billing service, the billing tracking data is recorded and stored in the billing data table through a scheduled task. The billing order is created using the billing policy corresponding to the current billing service and added to the billing queue;
[0007] Scan the billing queue through a scheduled task, obtain billing orders whose billing time matches the current time, read the billing order and its basic information, execute billing according to the billing policy corresponding to the billing order in the basic information, and generate a billing invoice using the billing logic corresponding to the billing policy;
[0008] In response to the closing of the billing service, the billing order status is modified to being settled, the billing order is removed from the billing queue and added to the settlement queue, settlement is performed through a scheduled task, and the billing order status is modified to closed.
[0009] Furthermore, it also includes planning one or more billing services in advance according to the business requirements and billing methods of the billing products; adding one or more billing strategies under the billing service, and adding one or more billing units under the billing strategy according to the different specifications of the billing products.
[0010] Furthermore, the billing service includes some billing service information, and the billing service information includes: a unique billing service identifier, a billing service name, a related billing product, and a billing service status. The billing service status includes valid, locked, and invalid status.
[0011] Furthermore, the billing policy includes several billing policy information, including: a unique billing policy identifier, a billing policy name, a billing service, a billing cycle, a billing time, a prepaid or postpaid type, a billing type, and a billing policy status;
[0012] The billing types include subscription billing, pay-as-you-go billing, pay-per-use billing, and resource package billing.
[0013] Furthermore, it also includes generating billing bills based on different billing types using corresponding billing logic:
[0014] When the billing type is subscription billing, obtain the unit price in the billing unit, calculate the bill amount based on the unit price and quantity, and write it into the billing invoice;
[0015] When the billing type is pay-as-you-go, the configuration information of the billing service and the billing unit is matched with the data in the billing data table to obtain the billing amount of the billing period, calculate the billing quantity based on the billing amount, obtain the unit price in the billing unit, calculate the bill amount based on the unit price and the billing quantity, and write the result into the billing invoice;
[0016] When the billing type is pay-per-use, the billing amount is input externally, and the bill amount is calculated based on the billing amount and the number of times and written into the billing invoice;
[0017] When the billing type is resource package billing, no billing bill is generated and the balance of the resource package is directly deducted.
[0018] Furthermore, the billing unit includes several billing unit information, and the billing unit information includes: billing unit unique identification, billing unit name, billing service, billing policy, currency, unit price, price unit, configuration information and billing unit status, and the billing unit status includes valid, locked and invalid status.
[0019] Furthermore, the billing order includes several billing order information, and the billing order information includes: unique order number, user information, billing service, billing policy, one or more billing units, billing order status, start date and end date. The billing order status includes created, billing, settling and closed status.
[0020] Furthermore, the billing invoice includes billing order information, currency, bill amount and billing period.
[0021] On the other hand, an embodiment of the present invention further provides a network service billing system, including:
[0022] The order creation module is configured to, in response to the activation of the billing service, record the billing tracking data and store it in the billing data table through a scheduled task, create a billing order using the billing policy corresponding to the current billing service, and add it to the billing queue;
[0023] a billing module configured to scan the billing queue through a scheduled task, obtain a billing order whose billing time matches the current time, read the billing order and its basic information, perform billing according to the billing policy corresponding to the billing order in the basic information, and generate a billing invoice using the billing logic corresponding to the billing policy;
[0024] The settlement module is configured to modify the billing order status to being settled in response to the closing of the billing service, remove the billing order from the billing queue and add it to the settlement queue, execute settlement through a scheduled task and modify the billing order status to closed.
[0025] Furthermore, the system further includes a pre-processing module configured to plan one or more billing services according to the business requirements and billing methods of the billing products; add one or more billing policies under the billing services, and add one or more different billing units under the billing policies according to different specifications of the billing products;
[0026] A billing service module, wherein the billing service module includes billing service information, including a unique billing service identifier, a billing service name, a corresponding billing product, and a billing service status, wherein the billing service status includes valid, locked, and invalid status;
[0027] A billing policy module includes several billing policy information, including: a unique billing policy identifier, a billing policy name, a billing service, a billing cycle, a billing time, a prepaid or postpaid type, a billing type, and a billing policy status; the billing types include subscription billing, pay-per-use billing, pay-per-use billing, and resource package billing;
[0028] The billing bill generation module is configured to generate a billing bill using corresponding billing logic according to different billing types: when the billing type is subscription billing, the unit price in the billing unit is obtained, the bill amount is calculated based on the unit price and the billing quantity, and the bill is written into the billing bill; when the billing type is pay-as-you-go billing, the configuration information of the billing service and the billing unit is matched with the data in the billing data table to obtain the billing amount of the billing cycle, the billing quantity is calculated based on the billing amount, and then the unit price in the billing unit is obtained, the bill amount is calculated based on the unit price and the billing quantity, and the bill is written into the billing bill; when the billing type is pay-as-you-go billing, the billing amount is passed in externally, the bill amount is calculated based on the billing amount and the number of times, and the bill is written into the billing bill; when the billing type is resource package billing, no billing bill is generated, and the balance of the resource package is directly deducted.
[0029] The present invention provides a network service billing method and system, which decouples the billing logic and business logic by recording only the necessary billing point data during the business request processing and storing it in a billing data table as the data source for the billing process. It can also flexibly perform billing according to the corresponding billing logic through the set billing cycle, billing time, prepaid and postpaid type, and billing type billing strategy. It is widely compatible with various network service billing requirements and can quickly adapt to changes in business needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Other features, objects and advantages of the present application will become more apparent upon reading the detailed description of non-limiting embodiments made with reference to the following drawings:
[0031] Figure 1 This is a flowchart of a network service method provided by an embodiment of the present application;
[0032] Figure 2 This is a billing order sequence diagram of a network service method provided by an embodiment of the present application;
[0033] Figure 3 This is a schematic diagram of the structure of a network service system provided by an embodiment of the present application;
[0034] Figure 4 This is a structural diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0035] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0036] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The singular forms "a", "an", "the" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise.
[0037] It should be understood that although the terms first, second, third, etc. may be used to describe the acquisition modules in the embodiments of the present invention, the acquisition modules should not be limited to these terms. These terms are only used to distinguish the acquisition modules from each other.
[0038] The word "if," as used herein, may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to the determination" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)," depending on the context.
[0039] It should be noted that the directional terms such as "upper," "lower," "left," and "right" described in the embodiments of the present invention are described from the perspectives shown in the accompanying drawings and should not be construed as limiting the embodiments of the present invention. Furthermore, in the context, it should be understood that when an element is referred to as being formed "on" or "under" another element, it can be formed not only directly "on" or "under" the other element, but also indirectly "on" or "under" the other element through an intermediate element.
[0040] See also Figure 1 、 2 , an embodiment of the present invention provides a network service billing method, comprising:
[0041] Step S101: In response to the activation of the billing service, the billing tracking data is recorded and stored in the billing data table through a scheduled task. A billing order is created using the billing policy corresponding to the current billing service and added to the billing queue.
[0042] Specifically, one or more billing services are planned in advance based on the business requirements and billing methods of the billing products, one or more billing policies are added under the billing services, and one or more different billing units are added under the billing policies based on the different specifications of the billing products.
[0043] Users use the product to activate services and billing services, record billing data during the service request processing, and store it in the billing data table in the specified format through a scheduled task. During the billing service process, the information in the billing data table is obtained as the data source for executing billing; a billing order is created using the billing policy corresponding to the enabled billing service. When multiple billing policies are used at the same time, a different billing order is created for each billing policy. In addition, each billing policy can only have one long-term valid billing order, or there can be multiple billing orders but the time periods between each billing order do not overlap. After the billing order is created, it is automatically added to the billing queue.
[0044] Among them, the billing service includes several billing service information, and the billing service information includes: the billing service unique identifier, the billing service name, the billing product to which it belongs, the billing service status and other information. The billing service status includes valid, locked and invalid status. When the billing service status is locked, the billing service cannot be used to add new billing policies, billing units and billing orders. The created billing orders can continue to be billed and generate billing invoices; before the billing service expires, ensure that all billing policies, billing units and billing orders associated with the billing service are invalid or closed. After the billing service expires, new data cannot be added based on the billing service.
[0045] The billing policy is used to determine the billing details of the billing service. A billing service can add multiple billing policies of different types, and one or more of the multiple billing policies can be used at the same time. The billing policy includes several billing policy information, including: billing policy unique identifier, billing policy name, billing service, billing cycle, billing time, prepaid or postpaid type, billing type and billing policy status.
[0046] The billing cycle refers to the time span unit for each billing, such as daily, monthly, and annually. If the actual usage time is less than one billing cycle, you need to determine whether to bill based on the time proportion based on your actual billing needs. If so, you will be charged according to: , calculate the final fee for this billing cycle;
[0047] The billing time refers to the time when the billing scheduled task is executed. For example, it is set to the starting time of the billing cycle, such as midnight every day, midnight on the 1st of each month, and midnight on January 1st of each year. This embodiment also supports dynamic configuration of the billing time to meet the situation where billing needs to be executed after the dependent data task is completed. For example, a certain pay-as-you-go billing service completes the statistics of the previous day's usage data at 2:00 am every day, and the billing time is configured to be after 2:00 am;
[0048] Prepaid and postpaid types include prepaid and postpaid types. Prepaid type means that the fees of the current billing cycle are billed at the beginning of each billing cycle and is only applicable to subscription billing. Postpaid type means that the fees of the previous billing cycle are billed at the beginning of each billing cycle and is applicable to all billing types.
[0049] Billing types include subscription, pay-as-you-go, pay-per-use, and resource package billing. Subscription billing is time-based billing, with a fixed fee for each time period, which usually matches the billing cycle. If not, the fee is calculated based on the actual time unit. Pay-as-you-go billing is based on actual usage data within a billing cycle. Pay-as-you-go billing is a one-time fee, regardless of the billing cycle or prepaid / postpaid type. Resource package billing is pre-purchased balance, with actual usage deducted each billing cycle. An alert is sent when the balance is insufficient, and service usage is terminated when the balance is exhausted.
[0050] Billing policy states include valid, locked, and expired. When a billing policy is locked, new billing units and billing orders cannot be added using the billing policy. Existing billing orders can continue to generate billing invoices. Before a billing policy expires, ensure that all billing units and billing orders associated with the billing policy have expired or been closed. After a billing policy expires, new data cannot be added based on the billing policy.
[0051] A billing unit refers to the basic unit of a billing product's price. A billing unit includes several billing unit information, including: billing unit unique identifier, billing unit name, associated billing service, associated billing policy, currency, unit price, price unit, configuration information, and billing unit status. A billing policy can add multiple different billing units according to the specifications of the billing product. For example, the billing of a billing product CDN (content distribution network) is usually divided into bandwidth billing and transcoding billing. According to different bandwidths, different transcoding methods or different transcoding resolutions, the billing products can be divided into different specifications, and different specification codes are defined and written into the configuration information of the corresponding billing units. For example, the codes "CDN:transcode:h264:1080" and "CDN:transcode:h264:2k" are used to represent CDN transcoding specifications with different resolutions, where the first digit represents the product CDN, the second digit represents transcoding or bandwidth, the third digit represents transcoding method, and the fourth digit represents transcoding resolution. A billing policy can use one or more billing units at the same time. When using multiple billing units at the same time, the billing unit unique identifiers of all billing units used need to be included in the billing order created by the billing policy. The unit price is the price of each price unit. For example, the price unit is per day and the billing cycle is monthly, then the total cost of the billing cycle is When the billing type is subscription billing and pay-per-use billing, the billing strategy to which it belongs can only add or use one billing unit. When the billing type is pay-as-you-go and multiple billing units are used at a time, the specifications are indicated in the billing unit configuration information as needed. When obtaining the billing amount from the billing data table, the billing unit specifications are grouped to determine the quantity under each specification, and then matched with the specifications in the billing unit configuration information. For example, the configuration specification in the configuration information of a billing unit is "CDN:transcode:h264:1080". Filter all data with the code "CDN:transcode:h264:1080" and then filter by time to obtain the billing amount for the billing cycle to further determine the final fee. The billing unit status includes valid, locked, and invalid. When the billing unit status is locked, new billing orders cannot be added using the billing unit. Existing billing orders can continue to generate billing invoices. Before a billing unit expires, ensure that all billing orders associated with the billing unit are closed. After a billing unit expires, new data cannot be added based on this billing unit.
[0052] A billing order is the only proof of billing. All billing invoices are generated based on the billing order. A billing order executes billing once in each billing cycle until it is manually closed or automatically closed upon expiration. A billing order includes several billing order information, including: unique order number, user information, billing service, billing policy, one or more included billing units, billing order status, start date, and end date; billing order status includes created, billing in progress, settlement in progress, and closed.
[0053] Step S102: Scan the billing queue through a scheduled task to obtain a billing order whose billing time matches the current time, read the billing order and its basic information, perform billing according to the billing policy corresponding to the billing order in the basic information, and generate a bill using the billing logic corresponding to the billing policy;
[0054] The specific logic of scanning the billing queue through a scheduled task is as follows:
[0055] A 14-digit string is used to represent a scheduled task expression. Usually, a simple task expression only involves elements such as year, month, day, hour, minute, and second. In this embodiment, each element is represented by a digital string and connected together to obtain a 14-digit simple scheduled task expression. Taking Java syntax as an example, the format is: yyyyMMddhhmmss. For example, 20241212020000 means that the task will be executed at 2:00:00 am on December 12, 2024.
[0056] Usually, billing tasks need to be executed repeatedly according to the billing cycle, such as once a day, once a month, etc. A special numeric string is required to indicate that the wildcard on each element indicates that it can be executed at any time. This embodiment uses the number 9 as the wildcard number for all elements, such as 9999999999999, which means that the task will be executed once every year, every month, every day, every hour, every minute, and every second, that is, once every second.
[0057] The above task expression makes it easier to assign a task expression to each billing policy. The task expression in the billing policy also allows you to more intuitively see the billing time. In actual execution, there is often more than one task expression corresponding to each time point (per second). For example, the task expressions 20241224102000 and 999999999999999 both execute tasks at 10:20:00 on December 24, 2024. Furthermore, the two task expressions are split into six elements according to year, month, day, hour, minute, and second. The position of each element in the two task expressions is fixed, and the new task expression formed by arbitrarily exchanging the elements in the same position can represent the execution of the task at this time. For example, 99991224109900 can still represent the execution of the task at 10:20:00 on December 24, 2024. Therefore, there are 64 task expressions (2 to the power of 6) that can represent each specific execution time accurate to the second. This requires using the current time to construct 64 task expressions each time a scheduled task is executed, and then using a range query in the billing queue to obtain the billing orders that match the current time task expression for billing execution.
[0058] Specifically, after a billing order is created, the billing queue is continuously scanned through a scheduled task to obtain billing orders that match the current time. If the billing order start date, i.e., the billing time, matches the current time, billing will be executed in each billing cycle. If the billing order start date is a future date, billing will not be performed until the future date is reached. Optionally, a manual billing interface is also included. After a billing order is created, the corresponding billing order can be filtered through the relevant information of the manual billing order to execute billing. For example, the user ID can be passed in to bill all the user's orders being executed according to the natural billing cycle. A specific order number can also be passed in to execute billing for only a certain order. The billing service and billing policy can also be passed in.
[0059] When billing begins, the billing order and its associated billing services, billing policies, and other basic information are read. One or more billing services for a billing product are stored in the billing data table, which contains the unique identifier of the billing service. When there are multiple billing services, the billing order's associated billing services are first filtered to narrow the scope. Then, based on the billing type in the billing policy, the corresponding billing logic is used to generate the billing invoice, including:
[0060] When the billing type is subscription billing, obtain the unit price in the billing unit, calculate the bill amount based on the unit price and billing quantity, and write it to the billing invoice; the billing quantity is based on the price unit in the billing unit. For example, if the subscription billing price unit is monthly and the billing cycle is monthly, the billing quantity for subscription billing is 1. In special cases, if the billing cycle is monthly but the price unit in the billing unit is daily, the number of days in the month is used as the billing quantity;
[0061] When the billing type is pay-as-you-go, the configuration information of the billing service and billing unit is matched with the data in the billing data table to obtain the billing amount of the billing period, calculate the billing quantity based on the billing amount, then obtain the unit price in the billing unit, calculate the bill amount based on the unit price and the billing quantity, and write it into the billing invoice. For example, the unit price of the file storage service is 10 yuan / GB, and less than 1GB is calculated as 1GB. The price unit is per GB, and the billing amount obtained is 1025MB. Converting the billing amount of 1025MB into the billing quantity is 2, and the bill amount is 10×2=20 yuan.
[0062] When the billing type is pay-per-use, a predetermined billing amount is input externally, and the bill amount is calculated based on the billing amount and the number of times and written into the billing invoice;
[0063] When the billing type is resource package billing, no billing invoice is generated, and the balance of the resource package is directly deducted.
[0064] The billing invoice is the accounting information after billing is executed for each billing cycle, including billing order information, currency, bill amount and billing period.
[0065] Step S103, in response to the closing of the billing service, the billing order status is modified to being settled, the billing order is removed from the billing queue and added to the settlement queue, settlement is performed through a scheduled task and the billing order status is modified to closed.
[0066] When the user closes the billing service or the billing service automatically closes upon expiration, the order status is modified to being settled, the billing order is removed from the billing queue and added to the settlement queue, indicating the settlement deadline and settlement execution date. The settlement queue is continuously scanned by a scheduled task, and the order status is modified to closed and removed from the settlement queue after settlement on the settlement execution date. For example, in the case of postpaid pay-as-you-go billing, when the billing service is closed, the billing volume data of the billing service from the start to the closing stage cannot be immediately obtained, and the billing order cannot be closed immediately. The billing order is added to the settlement queue, the settlement deadline is set to the billing service closing date, and the settlement execution date is set to after the settlement deadline. The settlement queue is scanned by a scheduled task, and the deduction is executed and the billing order is closed on the settlement execution date, and the closed billing order is removed from the settlement queue.
[0067] A network service billing method provided by an embodiment of the present invention decouples the billing logic and business logic by recording only the necessary billing point data during the business request processing and storing it in a billing data table as the data source for the billing process. In addition, the method can flexibly perform billing according to the corresponding billing logic through the set billing cycle, billing time, prepaid and postpaid type, and billing type billing strategy. It is widely compatible with various network service billing requirements and can quickly adapt to changes in business needs.
[0068] See also Figure 3 Another embodiment of the present invention provides a network service billing system 200, including:
[0069] The order creation module 201 is configured to, in response to the activation of the billing service, record the billing tracking data and store it in the billing data table through a scheduled task, create a billing order using the billing policy corresponding to the current billing service, and add it to the billing queue;
[0070] The billing module 202 is configured to scan the billing queue through a scheduled task, obtain billing orders whose billing time matches the current time, read the billing order and its basic information, perform billing according to the billing policy corresponding to the billing order in the basic information, and generate a billing invoice using the billing logic corresponding to the billing policy;
[0071] The settlement module 203 is configured to, in response to the closing of the billing service, modify the billing order status to being settled, remove the billing order from the billing queue and add it to the settlement queue, perform settlement through a scheduled task and modify the billing order status to closed.
[0072] Furthermore, the system further includes a pre-processing module configured to pre-plan one or more billing services based on the business requirements and billing methods of the billing products; add one or more billing policies under the billing services, and add one or more billing units under the billing policies based on different specifications of the billing products;
[0073] A billing service module, wherein the billing service module includes billing service information, including a unique billing service identifier, a billing service name, a corresponding billing product, and a billing service status, wherein the billing service status includes valid, locked, and invalid status;
[0074] A billing policy module includes several billing policy information, including: a unique billing policy identifier, a billing policy name, a billing service, a billing cycle, a billing time, a prepaid or postpaid type, a billing type, and a billing policy status; the billing types include subscription billing, pay-per-use billing, pay-per-use billing, and resource package billing;
[0075] The billing bill generation module is configured to generate a billing bill using corresponding billing logic according to different billing types: when the billing type is subscription billing, the unit price in the billing unit is obtained, the bill amount is calculated based on the unit price and the billing quantity, and the bill is written into the billing bill; when the billing type is pay-as-you-go billing, the configuration information of the billing service and the billing unit is matched with the data in the billing data table to obtain the billing amount of the billing cycle, the billing quantity is calculated based on the billing amount, and then the unit price in the billing unit is obtained, the bill amount is calculated based on the unit price and the billing quantity, and the bill is written into the billing bill; when the billing type is pay-as-you-go billing, the billing amount is passed in externally, the bill amount is calculated based on the billing amount and the number of times, and the bill is written into the billing bill; when the billing type is resource package billing, no billing bill is generated, and the balance of the resource package is directly deducted.
[0076] It should be noted that the network service billing system 200 provided in this embodiment corresponds to a technical solution that can be used to execute various method embodiments. Its implementation principle and technical effects are similar to those of the method and will not be repeated here.
[0077] See also Figure 4 Another embodiment of the present invention further provides an electronic device 300 for implementing the aforementioned network service billing method. Electronic device 300 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes to implement the methods described in the various embodiments of the present invention based on programs stored in a read-only memory (ROM) 302 or programs loaded from a storage device 308 into a random access memory (RAM) 303. RAM 303 also stores various programs and data required for the operation of electronic device 300. Processing device 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to bus 304.
[0078] Typically, the following devices may be connected to the I / O interface 305: an input device 306 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 308 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 309. The communication device 309 may allow the electronic device 300 to communicate with other devices wirelessly or by wire to exchange data. Figure 4 The electronic device 300 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.
[0079] In particular, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart, thereby implementing the method described above. In such an embodiment, the computer program can be downloaded and installed from the network via the communication device 309, or installed from the storage device 308, or installed from the ROM 302. When the computer program is executed by the processing device 301, the above-mentioned functions defined in the method of the embodiment of the present invention are performed.
[0080] Another embodiment of the present invention further provides a computer-readable storage medium, which may be included in the electronic device or may exist independently without being incorporated into the electronic device. The computer program can be implemented when executed by a processor.
[0081] The above description is merely a preferred embodiment of the present invention. Those skilled in the art should understand that the scope of the present invention is not limited to technical solutions formed by specific combinations of the above-mentioned technical features. It also encompasses other technical solutions formed by any combination of the above-mentioned technical features or their equivalents, without departing from the above-mentioned disclosure. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this invention.
Claims
1. A network service billing method, characterized in that: include: In response to the activation of the billing service, the billing tracking data is recorded and stored in the billing data table through a scheduled task. The billing order is created using the billing policy corresponding to the current billing service and added to the billing queue; Scan the billing queue through a scheduled task, obtain billing orders whose billing time matches the current time, read the billing order and its basic information, execute billing according to the billing policy corresponding to the billing order in the basic information, and generate a billing invoice using the billing logic corresponding to the billing policy; In response to the closing of the billing service, the billing order status is modified to being settled, the billing order is removed from the billing queue and added to the settlement queue, settlement is performed through a scheduled task, and the billing order status is modified to closed.
2. A network service billing method according to claim 1, characterized in that: Also includes: Plan one or more billing services in advance based on the business needs and billing methods of the billing products; Add one or more billing policies under the billing service, and add one or more billing units under the billing policy according to different specifications of the billing product.
3. A network service billing method according to claim 2, characterized in that: The billing service includes some billing service information, and the billing service information includes: a unique billing service identifier, a billing service name, a corresponding billing product, and a billing service status. The billing service status includes valid, locked, and invalid status.
4. A network service billing method according to claim 2, characterized in that: The billing policy includes several billing policy information, including: a unique billing policy identifier, a billing policy name, a billing service, a billing cycle, a billing time, a prepaid or postpaid type, a billing type, and a billing policy status; The billing types include subscription billing, pay-as-you-go billing, pay-per-use billing, and resource package billing.
5. A network service billing method according to claim 4, characterized in that: It also includes generating billing bills based on different billing types using corresponding billing logic: When the billing type is subscription billing, obtain the unit price in the billing unit, calculate the bill amount based on the unit price and billing quantity, and write it into the billing invoice; When the billing type is pay-as-you-go, the configuration information of the billing service and the billing unit is matched with the data in the billing data table to obtain the billing amount of the billing period, calculate the billing quantity based on the billing amount, obtain the unit price in the billing unit, calculate the bill amount based on the unit price and the billing quantity, and write the result into the billing invoice; When the billing type is pay-per-use, the billing amount is input externally, and the bill amount is calculated based on the billing amount and the number of times and written into the billing invoice; When the billing type is resource package billing, no billing bill is generated and the balance of the resource package is directly deducted.
6. A network service billing method according to claim 5, characterized in that: The billing unit includes a unique billing unit identifier, a billing unit name, a billing service, a billing policy, a currency, a unit price, a price unit, configuration information, and a billing unit status. The billing unit status includes valid, locked, and invalid status.
7. A network service billing method according to claim 1, characterized in that: The billing order includes a unique order number, user information, the billing service to which it belongs, the billing policy to which it belongs, one or more billing units, the billing order status, the start date and the end date. The billing order status includes created, billing, settling and closed.
8. A network service billing method according to claim 1, characterized in that: The billing invoice includes billing order information, currency, bill amount and billing period.
9. A network service billing system, characterized in that: include: The order creation module is configured to, in response to the activation of the billing service, record the billing tracking data and store it in the billing data table through a scheduled task, create a billing order using the billing policy corresponding to the current billing service, and add it to the billing queue; a billing module configured to scan the billing queue through a scheduled task, obtain a billing order whose billing time matches the current time, read the billing order and its basic information, perform billing according to the billing policy corresponding to the billing order in the basic information, and generate a billing invoice using the billing logic corresponding to the billing policy; The settlement module is configured to modify the billing order status to being settled in response to the closing of the billing service, remove the billing order from the billing queue and add it to the settlement queue, execute settlement through a scheduled task and modify the billing order status to closed.
10. A network service billing system according to claim 9, characterized in that: Also includes: A pre-processing module configured to plan one or more billing services according to the business requirements and billing methods of the billing products; Add one or more billing policies under the billing service, and add one or more different billing units under the billing policy according to different specifications of the billing service; A billing service module, wherein the billing service module includes billing service information, including a unique billing service identifier, a billing service name, a corresponding billing product, and a billing service status, wherein the billing service status includes valid, locked, and invalid status; A billing policy module includes several billing policy information, including: a unique billing policy identifier, a billing policy name, a billing service, a billing cycle, a billing time, a prepaid or postpaid type, a billing type, and a billing policy status; the billing types include subscription billing, pay-per-use billing, pay-per-use billing, and resource package billing; The billing bill generation module is configured to generate a billing bill using corresponding billing logic according to different billing types: when the billing type is subscription billing, the unit price in the billing unit is obtained, the bill amount is calculated based on the unit price and quantity, and the bill is written into the billing bill; when the billing type is pay-as-you-go billing, the configuration information of the billing service and the billing unit is matched with the data in the billing data table to obtain the billing amount of the billing cycle, the billing quantity is calculated based on the billing amount, and then the unit price in the billing unit is obtained, the bill amount is calculated based on the unit price and the billing quantity, and the bill is written into the billing bill; when the billing type is pay-as-you-go billing, the billing amount is passed in externally, the bill amount is calculated based on the billing amount and the number of times, and the bill is written into the billing bill; when the billing type is resource package billing, no bill is generated, and the balance of the resource package is directly deducted.
Citation Information
Patent Citations
Charging management system, method and equipment of cloud computing product and readable storage medium
CN114331404A
Consumer-to-consumer settlement apparatus and program
JP2005182665A