A fee settlement system

By designing a distributed asynchronous billing model of the fee settlement system, the problems of reduced billing performance and high concurrency processing capabilities caused by concentrated gas meter data reporting in the prior art are solved, and the terminal table is quickly obtained to obtain billing results and improve high concurrency processing capabilities.

CN119396609BActive Publication Date: 2025-04-15GOLDCARD HIGH TECH +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411981344.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-15
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

The data reporting of existing gas meters is concentrated in the early morning, which causes the server to frequently perform I/O operations with the database during billing, affecting the data reading and writing speed, reducing the billing performance, and thus affecting high concurrency processing capabilities, and even causing the terminal table to fail to obtain billing results.

Method used

Design a fee settlement system, including a collection module, message center, trial calculation engine, cache service and billing engine. Through the distributed asynchronous billing mode, priority is given to the charging trial calculation results to the terminal table, reducing I/O operations with the database and shortening the time of communication channels.

Benefits of technology

It realizes the terminal table to quickly obtain billing results, improves the high concurrency processing capability of the fee settlement system, and avoids missed communication time windows due to excessive billing processing time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119396609B_ABST
    Figure CN119396609B_ABST
Patent Text Reader

Abstract

The present application discloses a fee settlement system, including: a collection module, which is used to establish communication with a terminal meter and obtain the reported data of the terminal meter; a message center, which receives the reported data transmitted by the collection module and generates a first fee settlement queue; a trial calculation engine, which responds to the settlement request sent by the collection module and feeds back the trial calculation result to the collection module. The settlement request is generated after the collection module subscribes to the first fee settlement queue from the message center. The collection module is configured to send the trial calculation result to the terminal meter; a cache service, which receives the settlement request for completing the trial calculation sent by the trial calculation engine and generates a second fee settlement queue according to the settlement request for completing the trial calculation; a billing engine, which is configured to subscribe to the second fee settlement queue from the cache service, process the fee settlement message, and modify the relevant form in the database according to the processing result. The present application can realize the rapid sending of the billing result to the terminal meter and improve the high concurrent processing capability of the fee settlement system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a fee settlement system. Background Art

[0002] Most of the existing gas meters communicate and report data in the early morning. As the number of meters increases, the reporting time is concentrated. The server frequently performs I / O operations with the database during billing, which greatly affects the data reading and writing speed, reduces billing performance, and causes the server's ability to handle high concurrency to decrease, which in turn affects communication with the meter, and even causes the terminal meter to fail to obtain the billing results.

[0003] Existing solutions are mostly solved by increasing hardware deployment, expanding database server memory, hard disk, etc., but the cost of updating hardware is high and urgently needs to be solved through technological innovation. Summary of the invention

[0004] In order to solve the deficiencies of the prior art, this application adopts the following technical solutions:

[0005] The present application provides a fee settlement system, the fee settlement system comprising:

[0006] A collection module, used to establish communication with a terminal meter and obtain the reported data of the terminal meter;

[0007] A message center, the message center is configured to receive the reported data transmitted by the collection module and generate a first fee settlement queue;

[0008] a trial calculation engine, the trial calculation engine being configured to respond to a settlement request sent by the acquisition module and to feed back a trial calculation result to the acquisition module, the settlement request being generated after the acquisition module subscribes to the first fee settlement queue from the message center, and the acquisition module being configured to send the trial calculation result to the terminal meter;

[0009] a cache service configured to receive a settlement request for completing the trial calculation sent by the trial calculation engine, and generate a second fee settlement queue according to the settlement request for completing the trial calculation;

[0010] The billing engine is configured to subscribe the second fee settlement queue to the cache service, process the fee settlement message, and modify the relevant form in the cache service according to the processing result.

[0011] In summary, the present application provides a fee settlement system, in which a message center generates a first fee settlement queue based on the reported data of the terminal meter, the collection module generates and sends a settlement request to the trial calculation engine, the trial calculation engine responds to the settlement request to obtain the fee settlement information, and performs a billing trial calculation on the fee settlement information. After the billing trial calculation is completed, the trial calculation engine returns the billing trial calculation result directly to the terminal meter through the collection module, and the cache service generates a second fee settlement queue based on the settlement request for the completed trial calculation; after the billing trial calculation is completed, the billing engine consumes the second fee settlement queue, and the billing engine calls the relevant forms from the cache service to perform formal billing operations. After the formal billing is completed, the billing engine updates the relevant data of the relevant forms to ensure the accuracy of the billing results. Through the cooperation of the above-mentioned trial calculation engine, message center, billing engine and other modules, the fee settlement system provided by the present application realizes a distributed asynchronous billing mode, which gives priority to feeding back the billing trial calculation results to the terminal meters, avoiding frequent I / O operations between the settlement system and the database resulting in long billing processing time, thereby avoiding missing the time window for communication with the terminal meter due to long billing processing time, enabling the terminal meter to quickly obtain the billing results, and improving the high concurrency processing capability of the fee settlement system.

[0012] Furthermore, the trial calculation engine includes a wide table model, and the trial calculation engine performs a trial calculation on the current gas consumption and gas consumption amount based on the wide table model to generate the trial calculation result;

[0013] The wide meter model is generated based on a gas form, a contract form and a product form, wherein the gas form includes one or more of the following information: meter identification, last billing reading, last billing date and cycle end reading; the contract form includes one or more of the following information: meter identification, and, product identification pointing to the product form; the product form includes one or more of the following information: product identification, number of steps, step total amount of any step, step balance and step price;

[0014] The calculation engine obtains the gas form, the contract form and the product form from the cache service.

[0015] Furthermore, the calculation engine is configured to perform any of the following calculations based on the wide table model to generate the calculation results, including: single price calculation, tiered price calculation, cross-tiered calculation, and cross-cycle calculation.

[0016] Furthermore, the calculation engine calculates the gas consumption and gas consumption amount based on the wide table model, including:

[0017] Check whether the number of levels and the level prices of each level in the wide table model are consistent with the latest price information. If not, the calculation engine performs calculations according to the latest price information, wherein the latest price information is obtained by the calculation engine from the cache service.

[0018] Furthermore, the trial calculation engine is also configured to: in response to the number of steps in the wide table model and the step prices of each step being consistent with the latest price information, determine whether the current billing date spans a cycle; if it is determined that it does not span a cycle, the trial calculation engine performs a trial calculation according to the wide table model.

[0019] Further, the trial calculation engine is configured to: determine whether the current billing date plus the corresponding date is before or equal to the cycle deadline, and in response to being before or equal to the cycle deadline, the trial calculation engine determines that the current billing date does not cross the cycle, wherein the cycle deadline is preset based on a monthly or annual basis.

[0020] Furthermore, the trial calculation engine is also configured to add the next billing unit price to the generated trial calculation result, wherein, in response to determining that the current billing date plus a corresponding date is equal to the cycle end date, the trial calculation engine uses the first step unit price of the new cycle as the next billing unit price.

[0021] Furthermore, the calculation engine is further configured to: determine whether the date corresponding to the current billing date plus one is later than the cycle deadline,

[0022] In response to being later than the cycle deadline, the calculation engine determines that the current billing date spans a cycle, and the calculation engine uses the cycle deadline as a dividing point, calculates the portion that does not span a cycle according to the wide table model, and calculates the portion that spans a cycle according to the price of the new cycle, wherein the price of the new cycle is obtained by the calculation engine from the cache service.

[0023] Furthermore, the billing engine is further configured to:

[0024] Obtain billing settlement related forms from the cache service, process fee settlement messages, update at least part of the billing settlement related forms based on the processing results, and update and maintain the wide table model in the trial calculation engine.

[0025] Further, the collection module includes a front-end service and a collection processing engine, the front-end service is configured to establish communication with the terminal meter, parse the reported data of the terminal meter to generate a parsed message, and write the parsed message to the message center to generate the first fee settlement queue in the message center;

[0026] The collection and processing engine subscribes to the first fee settlement queue, and initiates the settlement request to the trial calculation engine, triggering the trial calculation engine to perform trial calculation and feed back the trial calculation result;

[0027] The acquisition processing engine generates instructions to be sent based on the trial calculation results, writes the instructions to be sent into the cache service, and writes the sending right into the message center;

[0028] The front-end service consumes the sending right from the message center and consumes the to-be-sent instruction from the cache service, and provides remote service to the terminal meter according to the to-be-sent instruction. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 A schematic diagram of the structure of a fee settlement system provided in one embodiment of the present application;

[0030] Figure 2 A schematic diagram of a billing trial calculation process of a fee settlement system provided for an embodiment of the present application;

[0031] Figure 3 A schematic diagram of the formal billing process of a fee settlement system provided for an embodiment of the present application;

[0032] Figure 4 A schematic diagram of a wide table model in a fee settlement system provided in an embodiment of the present application;

[0033] Figure 5 A schematic diagram of a flow chart of a trial calculation engine processing a settlement request in a fee settlement system provided in an embodiment of the present application;

[0034] Figure 6 A schematic diagram of the workflow of the collection module in the fee settlement system provided in one embodiment of the present application. DETAILED DESCRIPTION

[0035] The present application will be described in detail below in conjunction with the specific implementation modes shown in the accompanying drawings, but these implementation modes do not limit the present application. Structural, methodological, or functional changes made by ordinary technicians in the field based on these implementation modes are included in the protection scope of the present application.

[0036] In order to solve the shortcomings of the existing technology, such as Figure 1 As shown, the present application provides a fee settlement system, which is applied to the server side. The fee settlement system includes a collection module, a message center, a calculation engine, a cache service and a billing engine.

[0037] Among them, the collection module is used to establish communication with the terminal meter and obtain the reported data of the terminal meter; the message center is configured to receive the reported data transmitted by the collection module and generate a first fee settlement queue; the trial calculation engine is configured to respond to the settlement request sent by the collection module and feedback the trial calculation result to the collection module. The settlement request is generated after the collection module subscribes to the first fee settlement queue from the message center, and the collection module is configured to send the trial calculation result to the terminal meter; the cache service is configured to receive the settlement request for completing the trial calculation sent by the trial calculation engine, and generate a second fee settlement queue according to the settlement request for completing the trial calculation; the billing engine is configured to subscribe to the second fee settlement queue to the cache service, process the fee settlement message, and modify the relevant form in the cache service according to the processing result.

[0038] For example, the terminal meter takes a smart gas meter as an example, and the acquisition module establishes communication with the smart gas meter, so that the acquisition module obtains the reported data of the smart gas meter, and the reported data includes information such as the meter ID and gas usage data. In the reported data, the meter ID is used to represent user information, and the gas usage data includes gas consumption, current user balance, etc., which are used to settle gas fees.

[0039] like Figure 2 As shown, the acquisition module transmits the reported data to the message center, and the message center parses the reported data to generate the first fee settlement queue. The acquisition module is configured to subscribe to the message center message. After the message center generates the first fee settlement queue based on the reported data, the acquisition module consumes the message of the message center to generate the first fee settlement queue. The acquisition module generates a settlement request and sends the settlement request to the trial calculation engine, requesting the trial calculation engine to process it. The acquisition module is also configured to receive the trial calculation results and send the trial calculation results directly to the corresponding terminal meter, so that the billing trial calculation results can be quickly sent to the terminal meter, reducing the time occupied by the communication channel.

[0040] The trial calculation engine receives the settlement request sent by the acquisition module. In response to the settlement request, the trial calculation engine obtains the first fee settlement queue information corresponding to the settlement request. Based on the wide table model (the wide table model will be explained in detail below), the trial calculation engine obtains the relevant billing parameters of the corresponding user, thereby calculating the fee trial calculation result. The trial calculation engine returns the fee trial calculation result directly to the acquisition module, and the acquisition module receives the trial calculation result and sends the trial calculation result directly to the corresponding terminal meter. During the trial calculation process, the trial calculation engine performs billing trial calculation based on the data in the wide table model. After generating the trial calculation result, the trial calculation result is fed back to the acquisition module, and the trial calculation result is directly sent to the terminal meter through the acquisition module. During the trial calculation process, the form in the cache service is not modified, thereby shortening the response time to the terminal meter and avoiding missing the time window for communication with the terminal meter due to excessive billing processing time.

[0041] After the cost calculation is completed, the calculation engine sends the settlement request of the completed trial calculation to the cache service. The cache service generates a second cost settlement queue based on the settlement request of the completed trial calculation. The second cost settlement queue is used by the billing engine to perform formal billing for the settlement request of the completed trial calculation.

[0042] like Figure 3 As shown, the billing engine is configured to subscribe to the second fee settlement queue from the cache service. After the trial calculation engine completes the trial calculation of the current settlement request, the trial calculation engine sends a fee settlement message to the billing engine through the message center to trigger the billing engine to perform the formal billing operation. After the billing engine receives the fee settlement message, the billing engine consumes the second fee settlement queue. The billing engine calls the relevant form from the cache service to perform the formal billing operation. After obtaining the billing result, the billing engine modifies the relevant form in the cache service according to the billing result to ensure the accuracy of the billing parameters when the next fee is calculated.

[0043] Optionally, the trial calculation engine can decide whether to trigger the billing engine to perform formal billing operations based on whether the number of settlement requests for unfinished trial calculations is lower than a preset threshold. Specifically, when the number of settlement requests for unfinished trial calculations is lower than the preset threshold, the trial calculation engine sends a fee settlement message to the billing engine through the message center. After receiving the fee settlement message, the billing engine obtains the fee settlement data from the cache service and performs formal billing to release cache service space. Exemplarily, in an embodiment of the present application, the preset threshold can be set to 1. When the number of settlement requests for unfinished trial calculations is 1, that is, when the trial calculation engine completes the billing trial calculation for the last settlement request, the trial calculation engine sends a fee settlement message to the billing engine through the message center. After receiving the fee settlement message, the billing engine obtains the fee settlement data from the cache service and performs formal billing to release cache service space.

[0044] According to the above description, the present application provides a fee settlement system, in which the message center generates a first fee settlement queue based on the reported data of the terminal meter, the collection module generates and sends a settlement request to the trial calculation engine, the trial calculation engine responds to the settlement request to obtain the fee settlement information, and based on the wide table model, the trial calculation engine performs a billing trial calculation on the fee settlement information. After the billing trial calculation is completed, the trial calculation engine returns the billing trial calculation result directly to the terminal meter through the collection module, and the cache service generates a second fee settlement queue based on the settlement request for the completed trial calculation; after the billing trial calculation is completed, the billing engine consumes the second fee settlement queue, and the billing engine calls the relevant forms from the cache service to perform formal billing operations. After the formal billing is completed, the billing engine updates the relevant forms in the cache service and updates the relevant data of the wide table model to ensure the accuracy of the trial calculation results and the formal billing.

[0045] Through the cooperation of the above-mentioned calculation engine, message center, billing engine and other modules, the fee settlement system provided by the present application realizes a distributed asynchronous billing mode, which gives priority to feeding back the billing calculation results to the terminal meters, thereby avoiding the frequent I / O operation time of the settlement system and the database occupying the communication channel with the terminal meters, shortening the occupation time of the communication channel, enabling the terminal meters to quickly obtain the billing results, and improving the high concurrency processing capability of the fee settlement system.

[0046] As an implementation method, the calculation engine obtains gas forms, contract forms and product forms from the cache service to generate a wide table model in advance, so as to quickly obtain the calculation results during the billing calculation to avoid missing the time window for communication with the terminal meter due to long billing processing time. In addition, the cache service updates the above forms in real time according to the latest price information and other data to ensure the accuracy of the calculation of the calculation engine.

[0047] Furthermore, the trial calculation engine includes a wide table model, and the trial calculation engine is configured to perform a trial calculation on the current gas consumption and gas consumption amount based on the wide table model to generate a trial calculation result.

[0048] like Figure 4 As shown, the wide table model is generated based on the gas form, contract form and product form. It should be noted that in existing gas billing contracts, most are signed on a monthly or annual basis, and in one period, there are billings based on a single price and billings based on gas usage in different tiers. Therefore, in the relevant forms of the cache service, there are fields such as period, tier number and tier price.

[0049] Specifically, the gas meter form includes one or more of the following information: meter ID, last billing reading, last billing date and cycle end reading, where the cycle end reading indicates the cumulative gas consumption on the gas meter at the end of each billing cycle; the contract form includes one or more of the following information: meter ID, and product ID pointing to the product form; the product form includes one or more of the following information: product ID, number of steps, total amount of any step, balance of steps and price of steps. In the wide meter model, there is a one-to-many relationship between the gas meter form and the contract form, and a one-to-many relationship between the contract form and the product form. The billing wide meter obtains the form data of the billing wide meter through calculation based on the one-to-one relationship with the gas meter form, the indirect one-to-many relationship with the contract form, and the indirect one-to-many relationship with the product form. The billing wide meter covers key information such as meter ID, last billing reading, last billing date, cycle end reading, number of steps, unit price of each step, total amount of each step and balance of each step, to meet the needs of various trial calculation scenarios and ensure the accuracy of the trial calculation results.

[0050] As an implementation method, the calculation engine is configured to perform any of the following calculations based on the wide table model to generate calculation results, including: single price calculation, tiered price calculation, cross-tiered calculation, and cross-cycle calculation. Among them, the single price calculation is used to handle the situation where the gas contract is a fixed unit price, the tiered price calculation is used to handle the situation where the gas usage is within a single tier range, the cross-tiered calculation is used to handle the situation where the gas usage spans multiple tier ranges, and the cross-cycle calculation is used to handle the complex situation where the time period to be billed spans across cycles.

[0051] like Figure 5 As shown, as an implementation method, the trial calculation engine performs a trial calculation on the gas consumption and gas consumption amount based on the wide table model, including: checking whether the number of steps and the step prices of each step in the wide table model are consistent with the latest price information. If they are inconsistent, it indicates that a price adjustment has occurred, and the trial calculation engine performs a trial calculation according to the latest price information obtained from the cache service.

[0052] Specifically, based on the latest form data in the cache service, check whether the number of steps in the wide table model is consistent with the number of steps in the cache service. If they are inconsistent, it means that the user may have replaced the billing contract. The trial calculation engine performs billing trial calculation according to the number of steps in the cache service; based on the form data in the cache service, the trial calculation engine obtains the latest price information and determines whether the step prices of each step in the wide table model are consistent with the latest price information. If they are inconsistent, the trial calculation engine performs trial calculation based on the latest price information to ensure the accuracy of the trial calculation results. In addition, the trial calculation engine selects a trial calculation algorithm based on the number of steps in the wide table model. If the number of steps is 1, it means that the contract signed by the user corresponding to the settlement request is a fixed unit price contract. The trial calculation engine uses a single price trial calculation to generate a trial calculation result; if the number of steps is greater than 1, it means that the contract signed by the user corresponding to the settlement request is a step price contract. The trial calculation engine uses any trial calculation algorithm in the step price trial calculation and the cross-step trial calculation to calculate.

[0053] As an implementation method, the trial calculation engine is also configured to: in response to the number of steps in the wide table model and the step prices of each step being consistent with the latest price information, determine whether the current billing date crosses a cycle; if it is determined that it does not cross a cycle, the trial calculation engine performs a trial calculation according to the wide table model.

[0054] Specifically, based on the latest price information in the cache service, the calculation engine responds to the number of steps in the wide table model and the step prices of each step being consistent with the latest price information, and the calculation engine further determines whether the current billing date crosses a cycle. If the current billing date does not cross a cycle, the calculation engine selects a calculation algorithm based on the number of steps and performs calculation according to the current wide table model; if the current billing date crosses a cycle, the calculation engine uses cross-cycle calculation for calculation.

[0055] As an implementation, the trial calculation engine is configured to: determine whether the date corresponding to the current billing date plus one is before or equal to the cycle deadline. In response to the corresponding date being before or equal to the cycle deadline, the trial calculation engine determines that the current billing date does not cross a cycle, wherein the cycle deadline is preset based on a monthly or annual basis.

[0056] For example, an example is provided in which the corresponding date is prior to the cycle deadline, as follows: Take the billing date as December 30, 2023 and the cycle deadline as January 1, 2024 as an example. The billing date December 30, 2023 plus one is December 31, 2023, which is prior to the cycle deadline January 1, 2024. The trial calculation engine determines that the billing date December 30, 2023 does not cross the cycle. The trial calculation engine selects a trial calculation algorithm based on the ladder level and performs trial calculation according to the current wide table model.

[0057] For example, an example is provided in which the corresponding date is equal to the cycle deadline, as follows: Take the billing date as December 31, 2023 and the cycle deadline as January 1, 2024 as an example. The billing date December 31, 2023 plus one is January 1, 2024, which is equal to the cycle deadline January 1, 2024. The trial calculation engine determines that the billing date December 31, 2023 does not cross the cycle. The trial calculation engine selects a trial calculation algorithm based on the ladder level and performs trial calculation according to the current wide table model.

[0058] Further, as an implementation, the trial calculation engine is further configured to add the next billing unit price to the generated trial calculation result. In response to determining that the current billing date plus the corresponding date is equal to the cycle end date, the trial calculation engine uses the first stage unit price of the new cycle as the next billing unit price.

[0059] Specifically, as shown in the example above where the corresponding date is equal to the cycle expiration date, if the current billing date plus the corresponding date is equal to the cycle expiration date, it means that the current billing date is exactly the last day of this cycle. The trial calculation engine performs trial calculation according to the current wide table model to generate the trial calculation result. In addition, after this billing, the next new cycle will be entered for billing. The first stage unit price of the new cycle will be used as the next billing unit price. The trial calculation engine will add the next billing unit price to this trial calculation result. The next calculated unit price will be sent to the collection module as part of this trial calculation result until it is sent to the terminal meter for users to view, thereby improving service quality.

[0060] Furthermore, the calculation engine is further configured to: determine whether the date corresponding to the current billing date plus one is later than the cycle deadline. In response to the corresponding date being later than the cycle deadline, the calculation engine determines that the current billing date spans a cycle, and the calculation engine uses the cycle deadline as a demarcation point to calculate the portion that does not span a cycle according to the wide table model, and calculates the portion that spans a cycle according to the price of the new cycle, wherein the price of the new cycle is obtained by the calculation engine from the cache service.

[0061] Specifically, the calculation engine obtains the last billing date of the meter corresponding to the settlement request, and in response to the last billing date being earlier than the cycle deadline, the calculation engine further determines whether the date corresponding to the current billing date plus one is later than the cycle deadline.

[0062] For example, an example is provided in which the corresponding date is later than the cycle deadline, as follows: Take the last billing date as December 25, 2023, the billing date as January 2, 2024, and the cycle deadline as January 1, 2024. The billing date January 2, 2024 plus one is January 3, 2024, which is later than the cycle deadline January 1, 2024. The trial calculation engine determines that the billing date January 2, 2024 crosses the cycle. Taking the cycle deadline of January 1, 2024 as the dividing point, the trial calculation engine determines that the last billing date of December 25, 2023 to the day before the cycle deadline of December 31, 2023 is the part that does not cross the cycle, and the trial calculation engine performs trial calculation with the current wide table model to generate a first trial calculation result; the trial calculation engine determines that the cycle deadline of January 1, 2024 to the billing date of January 2, 2024 is the cross-cycle part, and the trial calculation engine obtains a new cycle from the buffer service, performs trial calculation with the price of the new cycle, and generates a second trial calculation result; by calculating the sum of the first trial calculation result and the second trial calculation result, the trial calculation engine generates a trial calculation result corresponding to the settlement request.

[0063] As an implementation method, the billing engine is also configured to: obtain billing settlement related forms from the cache service, process fee settlement messages, update at least part of the billing settlement related forms based on the processing results, and update and maintain the wide table model in the trial calculation engine.

[0064] Specifically, after the trial calculation engine completes the trial calculation, the trial calculation engine stores the billing and settlement related data of the meter that has completed the trial calculation into the cache service, the billing engine obtains the billing and settlement related data from the cache service, and the billing engine performs the formal billing operation to obtain the processing result. The calculation engine updates at least part of the billing and settlement related forms according to the processing result to ensure the accuracy of the billing-related form data in the cache service. In addition, the billing engine updates and maintains the wide table model in the trial calculation engine according to the processing result to ensure that the data used by the trial calculation engine for the next trial calculation is accurate.

[0065] As an implementation method, the acquisition module includes a front-end service and an acquisition processing engine.

[0066] like Figure 6 As shown, the front-end service is configured to establish a communication connection with the terminal meter, open a session channel, and the terminal meter reports data. The front-end service parses the reported data of the terminal meter and generates a parsed message. In addition, the front-end service also writes the parsed message into the message center to generate a first fee settlement queue in the message center.

[0067] The collection and processing engine is configured to subscribe to the first fee settlement queue. After the message center generates the first fee settlement queue, the collection and processing engine consumes the message of the message center generating the first fee settlement queue. The collection and processing engine sends a settlement request to the trial calculation engine to trigger the trial calculation engine to perform fee trial calculation and feedback the trial calculation result.

[0068] Furthermore, the collection and processing engine is also configured to generate instructions to be sent based on the trial calculation results, and store the instructions to be sent into a cache service. The instructions to be sent are used to trigger the front-end service to provide remote services for the terminal meter.

[0069] The collection and processing engine also writes the sending rights into the message center. The front-end service consumes the sending rights from the message center, obtains the authority to send messages to the terminal meter, and then consumes the instructions to be sent from the cache service. According to the instructions to be sent, the front-end service provides remote services to the terminal meter and sends the trial calculation results.

[0070] According to the above description, the present application provides a fee settlement system, in which the message center generates a first fee settlement queue based on the reported data of the terminal meter, the collection module generates and sends a settlement request to the trial calculation engine, the trial calculation engine responds to the settlement request to obtain the fee settlement information, and based on the wide table model, the trial calculation engine performs a billing trial calculation on the fee settlement information. After the billing trial calculation is completed, the trial calculation engine returns the billing trial calculation result directly to the terminal meter through the collection module, and the cache service generates a second fee settlement queue based on the settlement request for the completed trial calculation; after the billing trial calculation is completed, the billing engine consumes the second fee settlement queue, and the billing engine calls the relevant form from the cache service to perform the formal billing operation. After the formal billing is completed, the billing engine updates the form in the cache service and updates the relevant data of the wide table model to ensure the accuracy of the next billing trial calculation and formal billing.

[0071] In the fee settlement system of the present application, the trial calculation process of the trial calculation engine simulates the logic of the formal settlement, including judging price adjustments, whether the billing time spans a cycle, etc., to ensure that the trial calculation results are consistent with the results of the formal settlement. In actual tests, the trial calculation took an average of 20ms, and the formal billing took an average of 100ms, which greatly improved the response efficiency of the settlement system. Through the cooperation of the above-mentioned trial calculation engine, message center, billing engine and other modules, the fee settlement system provided by the present application implements a distributed asynchronous billing mode, which gives priority to feeding back the billing trial calculation results to the terminal meter, avoiding the frequent I / O operation time of the settlement system and the database occupying the communication channel with the terminal meter, shortening the occupation time of the communication channel, enabling the terminal meter to quickly obtain the billing results, and improving the high concurrency processing capability of the fee settlement system.

[0072] It will be appreciated that the word "exemplary" as used herein means "serving as an example, instance, or illustration". Any embodiment described as "exemplary" is not necessarily preferred or superior to other embodiments and / or does not exclude the combination of features of other embodiments. It will be appreciated that certain features of the present application described in the context of separate embodiments for the sake of clarity may also be provided in a single embodiment by combination. Conversely, various features of the present application described in the context of a single embodiment for the sake of clarity may also be provided individually or in any suitable combination or as any other described embodiment of the present application.

[0073] The above disclosure is only the preferred embodiment of the present application, but it is not intended to limit the scope of rights of the present application. A person of ordinary skill in the art can understand that without departing from the spirit and scope of the present application and the appended claims, changes, modifications, substitutions, combinations, and simplifications should all be equivalent replacement methods and still fall within the scope of the invention.

Claims

1. A fee settlement system, applied to a server, characterized in that: The fee settlement system adopts a distributed asynchronous billing mode, and the fee settlement system includes: A collection module, used to establish communication with a terminal meter and obtain the reported data of the terminal meter; A message center, the message center is configured to receive the reported data transmitted by the collection module and generate a first fee settlement queue; a trial calculation engine, the trial calculation engine being configured to respond to a settlement request sent by the acquisition module and to feed back a trial calculation result to the acquisition module, the settlement request being generated after the acquisition module subscribes to the first fee settlement queue from the message center, and the acquisition module being configured to send the trial calculation result to the terminal meter; a cache service configured to receive a settlement request for completing the trial calculation sent by the trial calculation engine, and generate a second fee settlement queue according to the settlement request for completing the trial calculation; The billing engine is configured to subscribe the second fee settlement queue to the cache service, process the fee settlement message, and modify the relevant form in the cache service according to the processing result.

2. The fee settlement system according to claim 1, characterized in that: The trial calculation engine includes a wide table model, and the trial calculation engine performs a trial calculation on the current gas consumption and gas consumption amount based on the wide table model to generate the trial calculation result; The wide meter model is generated based on a gas form, a contract form and a product form, wherein the gas form includes one or more of the following information: meter identification, last billing reading, last billing date and cycle end reading; the contract form includes one or more of the following information: meter identification, and, product identification pointing to the product form; the product form includes one or more of the following information: product identification, number of steps, step total amount of any step, step balance and step price; The calculation engine obtains the gas form, the contract form and the product form from the cache service.

3. The fee settlement system according to claim 2, characterized in that: The calculation engine is configured to perform any of the following calculations based on the wide table model to generate the calculation results, including: single price calculation, tiered price calculation, cross-tiered calculation, and cross-period calculation.

4. The fee settlement system according to claim 3, characterized in that: The calculation engine calculates the gas consumption and gas consumption amount based on the wide table model, including: Check whether the number of levels and the level prices of each level in the wide table model are consistent with the latest price information. If not, the calculation engine performs calculations according to the latest price information, wherein the latest price information is obtained by the calculation engine from the cache service.

5. The fee settlement system according to claim 4, characterized in that: The trial calculation engine is also configured to: in response to the number of steps in the wide table model and the step prices of each step being consistent with the latest price information, determine whether the current billing date spans a cycle; if it is determined that it does not span a cycle, the trial calculation engine performs a trial calculation according to the wide table model.

6. The fee settlement system according to claim 5, characterized in that: The calculation engine is configured to determine whether the current billing date plus one corresponding to the date is before or equal to the cycle deadline. In response to being before or equal to the cycle deadline, the calculation engine determines that the current billing date does not cross the cycle, wherein the cycle deadline is preset on a monthly or annual basis.

7. The fee settlement system according to claim 6, characterized in that: The trial calculation engine is also configured to add the next billing unit price to the generated trial calculation result, wherein, in response to determining that the current billing date plus a corresponding date is equal to the cycle end date, the trial calculation engine uses the first step unit price of the new cycle as the next billing unit price.

8. The fee settlement system according to claim 6, characterized in that: The calculation engine is further configured to: determine whether the date corresponding to the current billing date plus one is later than the cycle deadline, In response to being later than the cycle deadline, the calculation engine determines that the current billing date spans a cycle, and the calculation engine uses the cycle deadline as a dividing point, calculates the portion that does not span a cycle according to the wide table model, and calculates the portion that spans a cycle according to the price of the new cycle, wherein the price of the new cycle is obtained by the calculation engine from the cache service.

9. The fee settlement system according to claim 2, characterized in that: The billing engine is further configured to: Obtain billing settlement related forms from the cache service, process fee settlement messages, update at least part of the billing settlement related forms based on the processing results, and update and maintain the wide table model in the trial calculation engine.

10. The fee settlement system according to claim 2, characterized in that: The acquisition module includes a front-end service and an acquisition processing engine. The front-end service is configured to establish communication with the terminal meter, parse the reported data of the terminal meter to generate a parsing message, and write the parsing message to the message center to generate the first fee settlement queue in the message center; The collection and processing engine subscribes to the first fee settlement queue, and initiates the settlement request to the trial calculation engine, triggering the trial calculation engine to perform trial calculation and feed back the trial calculation result; The acquisition processing engine generates instructions to be sent based on the trial calculation results, writes the instructions to be sent into the cache service, and writes the sending right into the message center; The front-end service consumes the sending right from the message center and consumes the to-be-sent instruction from the cache service, and provides remote service to the terminal meter according to the to-be-sent instruction.

Citation Information

Patent Citations

  • Price pre-adjusting method and system for intelligent gas meter system

    CN109064659A