Charging platform, charging method, charging device, equipment, storage medium and product
By decoupling each step of the billing process into independent microservices, the problem of poor scalability of existing billing platforms is solved, and an efficient and flexible billing platform design is achieved, supporting multi-tenant personalized configuration and business expansion.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-11
- Publication Date
- 2026-04-07
AI Technical Summary
The existing billing platform uses an integrated approach for all key aspects, which is not conducive to the expansion of the platform's functions.
By adopting a microservices design, each step in the billing process is decoupled and encapsulated into an independent microservice, including pricing services, batch pricing services, and payment services. These services interact through standardized APIs and provide a containerized environment at the infrastructure layer.
It improves the platform's maintainability and testability, making it easier to cope with technology upgrades and business changes, supports multi-tenant mode, meets the personalized needs of enterprises of different sizes, and reduces the cost of building an independent fee platform.
Smart Images

Figure CN121814482A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a billing platform, billing method, apparatus, equipment, storage medium and product. Background Technology
[0002] Billing for products and services is an indispensable core capability for internet products and various business support systems, such as internet product billing, operator service billing, and highway toll collection. Most existing billing platforms adopt a centralized architecture, with each key step in the billing process implemented in a single integrated manner, which hinders the expansion of platform functionality. Summary of the Invention
[0003] This application provides a billing platform, billing method, apparatus, equipment, storage medium, and product to solve the problem that the integrated implementation of various key links in the existing billing process is not conducive to the expansion of platform functions.
[0004] To achieve the above objectives, embodiments of this application provide a billing platform, including: an access layer, a gateway layer, a service layer, a data layer, and an infrastructure layer; The access layer is used to receive external requests and forward the external requests to the gateway layer; The gateway layer is used to generate a microservice call request based on the external request and forward it to the service layer; The service layer includes various microservices obtained by decoupling and encapsulating each preset step in the billing process. The service layer is used to call the corresponding microservice according to the microservice call request to execute the corresponding preset step in the billing process. The data layer is used to store data related to the billing process; The infrastructure layer is used to provide a containerized environment for the access layer, the gateway layer, the service layer, and the data layer.
[0005] As an improvement to the above solution, the microservices include at least one of the following: Pricing services are used to define and manage tenant billing rules; A pricing service is used to calculate the fees for tenant users based on the aforementioned billing rules; Billing service, used to generate bills for tenant users based on the fees; Payment services are provided for paying the aforementioned bills; A data recording service for recording and managing target data; wherein the target data includes at least one of tenant user usage records, billing records, and behavior records; Data analysis services are used to analyze the target data; User management service is used to manage tenant information and tenant user information.
[0006] As an improvement to the above solution, the pricing service is implemented in the following way: The billing rules are stored in a first database; A first API is set up so that other microservices of the aforementioned microservices can query the billing rules through the first API.
[0007] As an improvement to the above scheme, the billing rules are updated within a preset period.
[0008] As an improvement to the above solution, the batch pricing service is implemented in the following way: The usage records are obtained through the data recording service; The billing rules are obtained through the pricing service; The fee is calculated based on the usage records and the billing rules.
[0009] As an improvement to the above solution, the costs are stored in a second database.
[0010] As an improvement to the above solution, the billing service is implemented in the following way: The fee is obtained through the aforementioned pricing service; The payment service is used to obtain the payment transaction information of tenant users; The bill is generated based on the fees and the payment transaction information; A second API is set up so that other microservices of the aforementioned microservices can query the bill through the second API.
[0011] As an improvement to the above solution, the payment service is implemented in the following way: Integrate the API of third-party payment platforms; Configure a third API so that other microservices of the aforementioned microservices can invoke the API of the third-party payment platform to pay the bill through the third API; After the bill is paid, the payment transaction information is recorded.
[0012] As an improvement to the above solution, the data recording service is implemented in the following way: The target data is stored in a third database. A fourth API is set up so that other microservices of the aforementioned microservices can query and write the target data through the fourth API.
[0013] As an improvement to the above solution, the data analysis service is implemented in the following way: The target data is analyzed to obtain analysis and recommendations. A fifth API is configured so that other microservices of the aforementioned microservices can query the analysis and recommendation results through the fifth API.
[0014] As an improvement to the above solution, the step of analyzing the target data to obtain analysis and recommendation results includes: The target data is obtained through the data recording service; The target data is preprocessed; The preprocessed target data is analyzed to obtain the analysis and recommendations.
[0015] As an improvement to the above solution, the user management service is implemented in the following way: Different storage spaces are allocated in the tenant management database for different tenants to store their own tenant information and tenant user information; A sixth API is set up so that other microservices of the aforementioned microservices can query and manage the tenant information and the tenant user information through the sixth API.
[0016] As an improvement to the above solution, the user management service is also used to manage tenant access permissions.
[0017] As an improvement to the above solution, the gateway layer includes: The API gateway is used to generate the microservice call request based on the external request and forward it to the service layer; The service registration and discovery module is used for the registration and invocation of the aforementioned microservices; The configuration center is used to centrally manage the configuration information of the various microservices.
[0018] As an improvement to the above solution, the API gateway includes: The routing and proxy unit is used to generate the microservice call request based on the external request and forward it to the service layer; The authentication and authorization unit is used to verify the identity of tenant users; A flow control unit is used to limit the rate at which API requests are received. The logging and monitoring unit records logs and monitors API performance and API usage; wherein the logs include: API request logs and API response logs; An error handling unit is used to handle errors returned by the service layer; The API version management unit is used to manage API versions; The caching unit is used to cache data related to the billing process.
[0019] As an improvement to the above scheme, the access layer includes at least one of the following: An elastic load balancing module is used to receive the external request and forward the external request to the gateway layer through a first load balancing algorithm. The soft load balancing module is used to receive the external request and forward the external request to the gateway layer through the second load balancing algorithm.
[0020] As an improvement to the above scheme, the data layer includes: The tenant management library is used to store tenant information and tenant user information; The pricing database is used to store billing rules; The call detail record (CDR) database is used to store call detail record information for tenant users. A billing database is used to store the call detail record (CDR) fees obtained from the billing of the CDR information; A billing database is used to store bills obtained based on the call detail records (CDRs).
[0021] To achieve the above objectives, this application also provides a billing method applied to the aforementioned billing platform, comprising: Receive external requests; Based on the external request, generate a microservice call request; Based on the microservice call request, the corresponding microservice is invoked to execute the preset steps in the billing process.
[0022] To achieve the above objectives, embodiments of this application also provide a billing device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the billing method as described above when executing the computer program.
[0023] To achieve the above objectives, embodiments of this application also provide a computer-readable storage medium, the computer-readable storage medium including a stored computer program; wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the billing method as described above.
[0024] To achieve the above objectives, embodiments of this application also provide a computer program product, including a computer program / instructions, which, when executed by a processor, implement the billing method as described above.
[0025] Compared with the prior art, the billing platform, billing method, apparatus, equipment, storage medium and product provided in this application embodiment, through microservice design, decouples and encapsulates each preset link in the billing process into an independent microservice, which not only improves the maintainability and testability of the platform, but also makes the platform more able to cope with future technology upgrades or business changes, and is more conducive to the expansion of platform functions. Attached Figure Description
[0026] Figure 1 This is a structural block diagram of a billing platform provided in an embodiment of this application; Figure 2 This is a flowchart of a billing method apparatus provided in an embodiment of this application; Figure 3 This is a structural block diagram of a billing device provided in an embodiment of this application. Detailed Implementation
[0027] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0028] In the description of this application, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0029] In this application description, the terms "exemplary" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0030] In this application description, the terms "first," "second," etc., are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus. The term "based on" means "at least partially based on." The term "according to" means "at least partially according to." The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments." The term "and / or" means at least one of the connected objects, such as A and / or B, indicating three cases: including only A, only B, and both A and B. Unless otherwise stated, the term "multiple" means two or more.
[0031] See Figure 1 , Figure 1 This is a structural block diagram of a billing platform provided in an embodiment of this application. The billing platform includes: an access layer, a gateway layer, a service layer, a data layer, and an infrastructure layer. The access layer is used to receive external requests and forward the external requests to the gateway layer; It is worth noting that external requests are sent by the client to the billing platform, and are received by the access layer of the billing platform and forwarded to the gateway layer.
[0032] The gateway layer is used to generate a microservice call request based on the external request and forward it to the service layer; It is worth noting that after the gateway layer receives the external request forwarded by the access layer, it parses it, generates a microservice call request based on the parsing result, and forwards it to the service layer.
[0033] The service layer includes various microservices obtained by decoupling and encapsulating each preset step in the billing process. The service layer is used to call the corresponding microservice according to the microservice call request to execute the corresponding preset step in the billing process. It is worth noting that this embodiment decouples and encapsulates the various preset steps in the billing process into independent microservices. These microservices collaborate with each other through a lightweight communication protocol, ensuring the platform's efficient operation and rapid response. These microservices reside in the service layer. After receiving a microservice call request forwarded by the gateway layer, the service layer invokes the microservice corresponding to the microservice call request to execute the corresponding preset step in the billing process, thereby completing the specific business logic.
[0034] Specifically, the pre-set steps in the billing process include, but are not limited to: pricing service, batch pricing service, and payment service.
[0035] The data layer is used to store data related to the billing process; It is worth noting that during the execution of microservices, the relevant data of the billing process is stored in the data layer to provide data support for the billing process.
[0036] The infrastructure layer is used to provide a containerized environment for the access layer, the gateway layer, the service layer, and the data layer.
[0037] It's worth noting that the infrastructure layer includes cloud environment resources such as computing, storage, and networking, enabling the use of Kubernetes + Docker technology to provide a containerized environment for the access layer, gateway layer, service layer, and data layer. Kubernetes is a container orchestration engine, and Docker is an open-source application container engine.
[0038] This application embodiment uses a microservice design to decouple and encapsulate each preset step in the billing process into an independent microservice. This not only improves the maintainability and testability of the platform, but also makes it easier for the platform to cope with future technology upgrades or business changes, and facilitates the expansion of platform functions.
[0039] In one alternative embodiment, the microservices include at least one of the following: Pricing services are used to define and manage tenant billing rules; A pricing service is used to calculate the fees for tenant users based on the aforementioned billing rules; Billing service, used to generate bills for tenant users based on the fees; Payment services are provided for paying the aforementioned bills; A data recording service for recording and managing target data; wherein the target data includes at least one of tenant user usage records, billing records, and behavior records; Data analysis services are used to analyze the target data; User management service is used to manage tenant information and tenant user information.
[0040] In this embodiment of the application, the preset steps in the billing process are decoupled and encapsulated into independent microservices, including but not limited to: Pricing Service, Rating Service, Billing Service, Payment Service, Usage Record Service, Data Analysis Service, and User Management Service.
[0041] The microservice design described above enables a highly scalable and flexible cloud application integrated unified billing platform. Each microservice has a clearly defined function and responsibility, and each microservice can interact through a standardized API (Application Programming Interface), ensuring the platform's efficient operation and maintenance. This design not only improves the platform's performance and reliability but also facilitates future expansion and optimization.
[0042] Specifically, a tenant user's usage record refers to their resource and service usage, such as CPU utilization, memory usage, network traffic, storage space, as well as the number of times, duration, and frequency of use. For example, in the case of billing for communication services, the tenant user's usage record specifically includes call detail records (CDRs).
[0043] Tenant user billing records refer to detailed information for each billing, such as billing amount, billing period, and billing rules.
[0044] Tenant user behavior refers to operation records, such as login time, usage frequency, service selection, etc.
[0045] Furthermore, all the above microservices support multi-tenancy, allowing multiple tenants to share the same platform. Each tenant has its own tenant information, such as tenant identifier (tenant ID), tenant name, contact information, creation time, etc. It also supports personalized configuration of each microservice by each tenant, with personalized configurations including at least one of the following: Pricing service: Supports configuring different billing rules for each tenant, such as pricing models, discount strategies, and promotional offers.
[0046] The pricing service allows each tenant to set different billing cycles, such as daily, weekly, or monthly.
[0047] Billing service: Generates bills periodically based on tenant usage records and billing rules, and notifies tenants via API or email, while also allowing tenants to query and download bills.
[0048] Payment services: Allows tenants to choose different payment methods to pay their bills.
[0049] User management service: Supports each tenant to have their own information and service level agreement (SLA), including service availability, response time, etc.
[0050] The billing platform in this application adopts a multi-tenant mode, which allows different tenants to customize personalized configurations according to their own needs. This helps to meet the different requirements of enterprises of different sizes for cost control and service quality, and greatly saves the cost of building an independent billing platform.
[0051] In one alternative embodiment, the pricing service is implemented in the following manner: The billing rules are stored in a first database; A first API is set up so that other microservices of the aforementioned microservices can query the billing rules through the first API.
[0052] For example, a detailed description of the defined service is provided: Functions: Define and manage tenant billing rules; support multiple billing rules such as on-demand billing, usage-based billing, and tiered billing.
[0053] Implementation method: The billing rules are stored in a first database; Set up a first API so that other microservices of each microservice can query billing rules through the first API.
[0054] The interactions involved include: Interacting with the management interface allows administrators to configure and manage billing rules. The configured billing rules are stored in the first database. For example, if the billing platform is used to calculate communication services, the first database is specifically a tariff database. Interact with the pricing service to provide the latest billing rules for calculating costs.
[0055] In one alternative embodiment, the billing rules are updated within a preset period.
[0056] This application embodiment supports dynamically updating billing rules to ensure that the platform can reflect market price changes in a timely manner.
[0057] In one optional embodiment, the bulk pricing service is implemented in the following manner: The usage records are obtained through the data recording service; The billing rules are obtained through the pricing service; The fee is calculated based on the usage records and the billing rules.
[0058] For example, a detailed description of the pricing service is provided: Function: Calculate the cost for tenant users based on the billing rules provided by the pricing service; Implementation method: The usage records of tenant users are obtained through data logging services; Obtain billing rules through pricing services; Calculate the tenant user's fees based on usage records and billing rules.
[0059] The interactions involved include: Interact with the data logging service to obtain usage records; Interact with the pricing service to obtain billing rules; Interact with the billing service to provide the calculated fees for generating an invoice.
[0060] In an alternative embodiment, the fees are stored in a second database.
[0061] In this embodiment, tenant user fees are stored in a second database for querying. For example, if the billing platform is used to calculate communication services, the first database is specifically a billing database.
[0062] In one optional embodiment, the billing service is implemented in the following manner: The fee is obtained through the aforementioned pricing service; The payment service is used to obtain the payment transaction information of tenant users; The bill is generated based on the fees and the payment transaction information; A second API is set up so that other microservices of the aforementioned microservices can query the bill through the second API.
[0063] For example, a detailed description of the billing service is provided: Functionality: Generate bills for tenant users based on their fees; supports both periodic and on-demand billing, and allows for the export and sending of bills.
[0064] Implementation method: We acquire tenant user fees through pricing services; The payment service obtains the payment transaction information of tenant users; the payment transaction information refers to the transaction information of historical payments.
[0065] Generate bills for tenant users based on fees and payment transaction information; Set up a second API so that other microservices of each microservice can query invoices through the second API.
[0066] The interactions involved include: Interact with the pricing service to obtain fee information.
[0067] Interact with payment services to obtain payment transaction information.
[0068] In addition, it interacts with user management services to manage billing information.
[0069] In one optional embodiment, the payment service is implemented in the following way: Integrate the API of third-party payment platforms; Configure a third API so that other microservices of the aforementioned microservices can invoke the API of the third-party payment platform to pay the bill through the third API; After the bill is paid, the payment transaction information is recorded.
[0070] For example, a detailed description of the payment service is provided: Function: Pay tenant users' bills; specifically, in response to a bill payment request, pay the tenant users' bills. Implementation method: It integrates the API of third-party payment platforms and supports multiple payment methods. Set up a third API so that other microservices of each microservice can invoke the API of a third-party payment platform to pay the bill through the third API; Record the payment transaction information after the bill is paid. This ensures the traceability of the transaction.
[0071] The interactions involved include: Interact with the billing service to receive the bill and initiate a payment request to trigger the API of a third-party payment platform to pay the bill; In addition, it interacts with the user management service to verify the identity of tenant users and their payment permissions.
[0072] In one alternative embodiment, the data recording service is implemented in the following manner: The target data is stored in a third database. A fourth API is set up so that other microservices of the aforementioned microservices can query and write the target data through the fourth API.
[0073] For example, a detailed description of the data recording service is provided: Function: Records and manages target data. Supports real-time updates and historical queries of target data.
[0074] Implementation method: The target data is stored in a third database. Set up a fourth API so that other microservices of each microservice can query and write target data through the fourth API.
[0075] The interactions involved include: It interacts with the pricing service to provide tenant users' usage records.
[0076] Interact with data analytics services to provide data for analysis and optimization.
[0077] In one alternative embodiment, the data analysis service is implemented in the following manner: The target data is analyzed to obtain analysis and recommendations. A fifth API is configured so that other microservices of the aforementioned microservices can query the analysis and recommendation results through the fifth API.
[0078] For example, a detailed description of the data analytics service is provided: Function: Analyze target data.
[0079] Implementation method: Analyze the target data to obtain analysis and recommendations; A fifth API is set up so that other microservices of each microservice can query analysis and suggestion results through the fifth API.
[0080] The interactions involved include: Interact with the data logging service to obtain the target data.
[0081] Interact with the management interface to view analysis and recommendations.
[0082] In one optional embodiment, the step of analyzing the target data to obtain analysis and recommendation results includes: The target data is obtained through the data recording service; The target data is preprocessed; The preprocessed target data is analyzed to obtain the analysis and recommendations.
[0083] It is worth noting that data analytics services are a key component. By collecting and analyzing target data, they provide billing optimization suggestions based on that data, helping users reduce costs, improve efficiency, and promote the commercial operation of cloud applications.
[0084] Preprocessing includes: Data cleaning: Remove invalid data and outliers to ensure data accuracy and consistency.
[0085] Data transformation: Converting data into a format suitable for analysis, such as converting timestamps into date and time formats.
[0086] Data aggregation: Aggregating data by time, user, service, and other dimensions to generate summary statistics.
[0087] The analysis includes: Descriptive analysis: This uses statistical analysis methods to describe user usage and billing information, such as average usage, maximum usage, and total billing amount.
[0088] Predictive analytics: Using machine learning algorithms (such as linear regression and time series analysis) to predict future usage and billing trends.
[0089] Diagnostic analysis: Analyze abnormal situations in user usage to identify potential problems and areas for improvement.
[0090] The analysis and recommendations include: Resource optimization results: Based on usage, it is recommended that tenants adjust resource configurations, such as increasing or decreasing the number of instances, or adjusting the instance type.
[0091] Billing optimization results: Based on usage and billing patterns, we recommend that users choose a more suitable billing model, such as pay-as-you-go billing, per-use billing, or tiered billing.
[0092] Service optimization results: Based on user behavior and preferences, more suitable services and functions are recommended, improving user satisfaction.
[0093] In one optional embodiment, the user management service is implemented in the following way: Different storage spaces are allocated in the tenant management database for different tenants to store their own tenant information and tenant user information; A sixth API is set up so that other microservices of the aforementioned microservices can query and manage the tenant information and the tenant user information through the sixth API.
[0094] For example, a user management service is described in detail: Functions: Manage tenant information and tenant user information, including registration, login, permission management and billing management, and support user management for multiple tenants.
[0095] Implementation method: Different storage spaces are allocated in the tenant management database for different tenants to store their own tenant information and tenant user information; Set up a sixth API so that other microservices of each microservice can query and manage tenant information and tenant user information through the sixth API.
[0096] The interactions involved include: Interact with payment services to verify tenant users' payment permissions.
[0097] Interact with the billing service to manage tenant users' bills.
[0098] It interacts with the management interface, providing management functions for tenants and tenant users.
[0099] It is worth noting that each tenant has independent storage space to store their own tenant information and tenant user information, which can ensure data security and privacy. Specifically, the tenant ID is used as the primary key or index field in the tenant management database, and data isolation is achieved through the tenant ID filtering condition in the SQL query.
[0100] In an optional embodiment, the user management service is also used to manage tenant access permissions.
[0101] It is worth noting that each tenant can have different user roles, such as administrators and regular users. Each role has different access permissions. Specifically, fine-grained permission management is achieved through access control lists (ACLs) or role-based access control (RBACs) to ensure that users can only access their own tenant's data and functions.
[0102] The billing platform described in this application supports multiple tenants sharing the same platform while ensuring data isolation, personalized configuration, and access control for each tenant. This design not only enhances the platform's flexibility and scalability but also provides personalized services to tenants of different sizes and needs, improving user experience and satisfaction. The key to multi-tenancy support lies in data isolation, personalized configuration, and access control, ensuring that each tenant can operate independently on the shared platform while enjoying efficient, secure, and flexible services.
[0103] In one optional embodiment, the gateway layer includes: an API gateway, a service registration and discovery module, and a configuration center; The API gateway is used to generate the microservice call request based on the external request and forward it to the service layer; The service registration and discovery module is used for the registration and invocation of the aforementioned microservices; The configuration center is used to centrally manage the configuration information of the various microservices.
[0104] It is worth noting that the API gateway is a core component that is responsible for managing and coordinating communication between various microservices and providing a unified interface to clients. External requests initiated by clients include: management requests, call detail record (CDR) billing requests, payment requests, etc.
[0105] The service registration and discovery module and the configuration center are the core foundation for microservice operation. Microservices are registered and discovered through the service registration and discovery module, and their required configuration information is stored uniformly in the configuration center. When a microservice needs to be invoked, the service registration and discovery module queries the list of available instances of that microservice, and then retrieves the corresponding configuration information from the configuration center, thereby enabling the microservice invocation.
[0106] In one alternative embodiment, the API gateway includes: The routing and proxy unit is used to generate the microservice call request based on the external request and forward it to the service layer; The authentication and authorization unit is used to verify the identity of tenant users; A flow control unit is used to limit the rate at which API requests are received. The logging and monitoring unit records logs and monitors API performance and API usage; wherein the logs include: API request logs and API response logs; An error handling unit is used to handle errors returned by the service layer; The API version management unit is used to manage API versions; The caching unit is used to cache data related to the billing process.
[0107] It's worth noting the following components: Routing and Proxy Unit: Routes external requests to the appropriate microservices. Authentication and Authorization Unit: Ensures only authenticated tenant users can access specific APIs. Traffic Control Unit: Limits the rate of received API requests to prevent overload; API requests include external requests and microservice call requests. Logging and Monitoring Module: Records logs and monitors API performance and usage; logs include API request logs and API response logs; API request logs record information related to API requests, while API response logs record information related to API response. Error Handling Unit: Handles errors returned by the service layer. API Version Management Unit: Supports API version control to ensure backward compatibility. Caching Unit: Stores billing process data to reduce backend service load and improve response speed.
[0108] This application embodiment, through the aforementioned API gateway design, provides a robust, flexible, and secure interface layer to manage communication between various microservices. The API gateway not only simplifies client calls but also provides essential functions such as authentication, traffic control, logging, error handling, API version management, and caching. This ensures the platform's high performance, high availability, and scalability, providing users with a stable and reliable billing platform.
[0109] In one alternative embodiment, the access layer includes at least one of the following: An elastic load balancing module is used to receive the external request and forward the external request to the gateway layer through a first load balancing algorithm. The soft load balancing module is used to receive the external request and forward the external request to the gateway layer through the second load balancing algorithm.
[0110] This application embodiment can utilize an elastic load balancing module or a soft load balancing module to receive external requests and forward the requests to the gateway layer through a first load balancing algorithm or a second load balancing algorithm.
[0111] In one alternative embodiment, the data layer includes: The tenant management library is used to store tenant information and tenant user information; The pricing database is used to store billing rules; The call detail record (CDR) database is used to store call detail record information for tenant users. A billing database is used to store the call detail record (CDR) fees obtained from the billing of the CDR information; A billing database is used to store bills obtained based on the call detail records (CDRs).
[0112] This application embodiment stores tenant information and tenant user information through a tenant management database. The tenant management database includes databases for each tenant to store their own tenant information and tenant user information, achieving data isolation. A tariff database stores billing rules, a call detail record (CDR) database stores tenant user CDR information, a billing database stores CDR fees obtained from CDR information, and a billing database stores bills obtained from CDR fees. This achieves standardized storage of data across the entire communication service billing process, providing reliable data support for billing and adapting to the needs of multi-scenario business expansion.
[0113] See Figure 2 , Figure 2 This is a flowchart of a billing method provided in an embodiment of this application, the billing method including: S1. Receive external requests through the access layer and forward the external requests to the gateway layer; S2. The gateway layer generates a microservice call request based on the external request and forwards it to the service layer; S3. The service layer invokes the corresponding microservice according to the microservice call request to execute the corresponding preset step in the billing process.
[0114] Furthermore, this application also provides a computer-readable storage medium, which includes a stored computer program; wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the billing method as described in any of the above embodiments.
[0115] Furthermore, this application also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the billing method as described in any of the above embodiments.
[0116] See Figure 3 , Figure 3 This is a structural block diagram of a billing device 20 provided in an embodiment of this application. The billing device 20 includes a processor 21, a memory 22, and a computer program stored in the memory 22 and executable on the processor 21. When the processor 21 executes the computer program, it implements the steps in the above-described billing method embodiments. Alternatively, when the processor 21 executes the computer program, it implements the functions of each module / unit in the above-described device embodiments.
[0117] For example, the computer program may be divided into one or more modules / units, which are stored in the memory 22 and executed by the processor 21 to complete this application. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the billing device 20.
[0118] The billing device 20 may include, but is not limited to, a processor 21 and a memory 22. Those skilled in the art will understand that the schematic diagram is merely an example of the billing device 20 and does not constitute a limitation on the billing device 20. It may include more or fewer components than illustrated, or combine certain components, or different components. For example, the billing device 20 may also include input / output devices, network access devices, buses, etc.
[0119] The processor 21 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. The processor 21 is the control center of the billing device 20, connecting all parts of the billing device 20 via various interfaces and lines.
[0120] The memory 22 can be used to store the computer programs and / or modules. The processor 21 implements various functions of the billing device 20 by running or executing the computer programs and / or modules stored in the memory 22 and calling the data stored in the memory 22. The memory 22 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory 22 may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0121] If the modules / units integrated into the billing device 20 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by the processor 21, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.
[0122] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided in this application, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.
[0123] The above description is the preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications are also considered to be within the scope of protection of this application.
Claims
1. A billing platform, characterized in that, include: The access layer, and the gateway layer, service layer, data layer, and infrastructure layer; The access layer is used to receive external requests and forward the external requests to the gateway layer; The gateway layer is used to generate a microservice call request based on the external request and forward it to the service layer; The service layer includes various microservices obtained by decoupling and encapsulating each preset step in the billing process. The service layer is used to call the corresponding microservice according to the microservice call request to execute the corresponding preset step in the billing process. The data layer is used to store data related to the billing process; The infrastructure layer is used to provide a containerized environment for the access layer, the gateway layer, the service layer, and the data layer.
2. The billing platform as described in claim 1, characterized in that, The microservices include at least one of the following: Pricing services are used to define and manage tenant billing rules; A pricing service is used to calculate the fees for tenant users based on the aforementioned billing rules; Billing service, used to generate bills for tenant users based on the fees; Payment services are provided for paying the aforementioned bills; A data recording service for recording and managing target data; wherein the target data includes at least one of tenant user usage records, billing records, and behavior records; Data analysis services are used to analyze the target data; User management service is used to manage tenant information and tenant user information.
3. The billing platform as described in claim 2, characterized in that, The pricing service is implemented in the following ways: The billing rules are stored in a first database; A first API is set up so that other microservices of the aforementioned microservices can query the billing rules through the first API.
4. The billing platform as described in claim 3, characterized in that, The billing rules are updated within a preset period.
5. The billing platform as described in claim 2, characterized in that, The bulk pricing service is implemented in the following ways: The usage records are obtained through the data recording service; The billing rules are obtained through the pricing service; The fee is calculated based on the usage records and the billing rules.
6. The billing platform as described in claim 5, characterized in that, The fees are stored in a second database.
7. The billing platform as described in claim 2, characterized in that, The billing service is implemented in the following ways: The fee is obtained through the aforementioned pricing service; The payment service is used to obtain the payment transaction information of tenant users; The bill is generated based on the fees and the payment transaction information; A second API is set up so that other microservices of the aforementioned microservices can query the bill through the second API.
8. The billing platform as described in claim 2, characterized in that, The payment service is implemented in the following ways: Integrate the API of third-party payment platforms; Configure a third API so that other microservices of the aforementioned microservices can invoke the API of the third-party payment platform to pay the bill through the third API; After the bill is paid, the payment transaction information is recorded.
9. The billing platform as described in claim 2, characterized in that, The data recording service is implemented in the following ways: The target data is stored in a third database. A fourth API is set up so that other microservices of the aforementioned microservices can query and write the target data through the fourth API.
10. The billing platform as described in claim 2, characterized in that, The data analysis service is implemented in the following ways: The target data is analyzed to obtain analysis and recommendations. A fifth API is configured so that other microservices of the aforementioned microservices can query the analysis and recommendation results through the fifth API.
11. The billing platform as described in claim 10, characterized in that, The analysis and recommendations obtained by utilizing the target data include: The target data is obtained through the data recording service; The target data is preprocessed; The preprocessed target data is analyzed to obtain the analysis and recommendations.
12. The billing platform as described in claim 2, characterized in that, The user management service is implemented in the following ways: Different storage spaces are allocated in the tenant management database for different tenants to store their own tenant information and tenant user information; A sixth API is set up so that other microservices of the aforementioned microservices can query and manage the tenant information and the tenant user information through the sixth API.
13. The billing platform as described in claim 12, characterized in that, The user management service is also used to manage tenant access permissions.
14. The billing platform as described in claim 1, characterized in that, The gateway layer includes: The API gateway is used to generate the microservice call request based on the external request and forward it to the service layer; The service registration and discovery module is used for the registration and invocation of the aforementioned microservices; The configuration center is used to centrally manage the configuration information of the various microservices.
15. The billing platform as described in claim 14, characterized in that, The API gateway includes: The routing and proxy unit is used to generate the microservice call request based on the external request and forward it to the service layer; The authentication and authorization unit is used to verify the identity of tenant users; A flow control unit is used to limit the rate at which API requests are received. The logging and monitoring unit records logs and monitors API performance and API usage; wherein the logs include: API request logs and API response logs; An error handling unit is used to handle errors returned by the service layer; The API version management unit is used to manage API versions; The caching unit is used to cache data related to the billing process.
16. The billing platform as described in claim 1, characterized in that, The access layer includes at least one of the following: An elastic load balancing module is used to receive the external request and forward the external request to the gateway layer through a first load balancing algorithm. The soft load balancing module is used to receive the external request and forward the external request to the gateway layer through the second load balancing algorithm.
17. The billing platform as described in claim 1, characterized in that, The data layer includes: The tenant management library is used to store tenant information and tenant user information; The pricing database is used to store billing rules; The call detail record (CDR) database is used to store call detail record information for tenant users. A billing database is used to store the call detail record (CDR) fees obtained from the billing of the CDR information; A billing database is used to store bills obtained based on the call detail records (CDRs).
18. A billing method, characterized in that, Applied to the billing platform as described in claim 1, the billing method includes: Receive external requests; Based on the external request, generate a microservice call request; Based on the microservice call request, the corresponding microservice is invoked to execute the preset steps in the billing process.
19. A billing device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements the billing method as described in claim 18.
20. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program; wherein, when the computer program is executed, it controls the device on which the computer-readable storage medium is located to perform the billing method as described in claim 18.
21. A computer program product, characterized in that, Includes a computer program / instruction that, when executed by a processor, implements the billing method as described in claim 18.